wimleers / homebridge-sma-home-manager

SMA Home Manager & Inverter plug-in for Homebridge
GNU General Public License v2.0
10 stars 2 forks source link

[Feature Request] Please could you please include Values from the SMA Energy Meter for people without the Home Manager? #12

Open silvertristan opened 1 year ago

silvertristan commented 1 year ago

I don't have a Home Manager as I don't really require it.

As the Old SMA plugin had I can see my current PV generation and Daily Yield. I would love to have the information like what my house is currently using, what's being fed into the grid plus daily yield and generation. I understand your plugin is to be able to control your homes energy usage using automations via the home app. For someone like me being able to see the value I have request is also a great help. Doing it all in the home app would be great rather than having to use the clunky SMA Energy app.

Inverter:

wimleers commented 1 year ago

Based on the title, it sounds like you have an SMA Energy Meter in addition to your inverter. Is that right?

If so: that should work out of the box, at least according to SMA's own documentation at https://developer.sma.de/fileadmin/content/global/Partner/Documents/SMA_Labs/EMETER-Protokoll-TI-en-10.pdf.

But in your comment you only listed an inverter?

silvertristan commented 1 year ago

Hi, Sorry. First time ever doing something like this with a Homebridge plugin. My apologies if I sound dumb.

Yes, I have the SMA Energy Meter with the Sunnyboy 6 inverter.

I have enabled the modbus and can confirm this as it works with the old SMA plugin.

When I enable your plugin i get this in the log over and over again and I have to disable the plugin to get homebridge working again: 3/6/2023, 12:58:12 PM] [homebridge-sma-home-manager] Discovered SMA energy manager: no [3/6/2023, 12:58:13 PM] [homebridge-sma-home-manager] Discovered SMA inverter: { SerialNumber: 3007638487, FirmwareRevision: '1.1.85.R' }

Thanks for replying. Tristan

wimleers commented 1 year ago

Could you post a photo of your SMA Energy Meter? 🙏

P.S.: you definitely don't sound dumb! This can get pretty confusing 😊

silvertristan commented 1 year ago

IMG_6487

wimleers commented 1 year ago

That's odd, based on the photo and SMA's documentation, this should work just fine! 😬

Could you please:

wimleers commented 1 year ago

Can you please update to https://github.com/wimleers/homebridge-sma-home-manager/releases/tag/1.1.3 and share the logged DeviceType? Thanks 🙏

silvertristan commented 1 year ago

I'm at F1 in Melbourne all weekend. When I'm back on Monday I'll get on it. Thanks again.

silvertristan commented 1 year ago

Hi,

Just to clarify I don't have an Energy Manager. I have a Energy Meter.

This is what I'm currently getting in the Homebridge log once updated: } [11/04/2023, 5:47:16 pm] [homebridge-sma-home-manager] Discovered SMA energy manager: no [11/04/2023, 5:47:17 pm] [homebridge-sma-home-manager] Discovered SMA inverter: { DeviceClass: 'solar inverter', DeviceType: 9405, SerialNumber: 3007638487, FirmwareRevision: 'unknown' }

Inverter Firmware version: 4.0.75.R Devicetype: I can't see it anywhere or I don't know what you mean. Network Path: SMA Energy Meter>(Ethernet)Sunnyboy Inverter>(WiFI)Router/Modem>(WiFi)Homebridge Requested Screenshots below:

Screenshot 2023-04-11 at 5 54 06 pm Screenshot 2023-04-11 at 5 53 56 pm Screenshot 2023-04-11 at 5 51 47 pm

Thanks again for looking into this. Cheers Tristan.

wimleers commented 1 year ago

That all looks fine 😬 (Very similar to what I see!)

Your solar inverter is also of the exact same series as mine — you just have the 6 kW one, I have the 5 kW one.

Could you please:

  1. Can you send me a screenshot of https://169.254.12.3/#/devicemanagement or https://192.168.0.16/#/devicemanagement? (You may need to log in first.)
  2. describe the network path between your SMA Energy Manager and device that Homebridge is running on (for example for me that's SMA Energy Manager → switch → router → switch → Homebridge)

(I still suspect that this is a pure networking problem. i.e. that it's impossible for the computer on which you have Homebridge running to receive multicast packets from the Energy Meter.)

silvertristan commented 1 year ago

image

Just to note and maybe it got missed in previous conversations just so we're not talking about two different things. I only have the inverter and energy meter. No energy manager. Hence why I just wanted to see valves and not controller the energy use like your plugin offers. With the old SMA plug-in I could see current generation and daily yield. With your plug-in you get a lot more info. I would also like to see current usage in addition to the generation and yield.

If we can't get it worked out I don't want to waste your time. You've done a great job with this plug-in and I'm sure you've got bigger fish to fry.

EnergyMeter(Ethernet)>Inverter(wifi)>router/modem(wifi)>homebridge(wifi)

Thanks again.

wimleers commented 1 year ago

That all looks fine 👍

I only have the inverter and energy meter.

Yep!

Hence why I just wanted to see valves and not controller the energy use like your plugin offers.

Well that's the thing: the Home Manager and Energy Meter should be identical as far as this Homebridge plugin is concerned! The only difference is that the Home Manager can independently send signals to devices. For example, for me it controls my heatpump. Either way, you should be able to get the same exact data, and create the same exact automations in Apple HomeKit.

EnergyMeter(Ethernet)>Inverter(wifi)>router/modem(wifi)>homebridge(wifi)

Do you have a single router/modem, no other WiFi access points?

silvertristan commented 1 year ago

Just the one router/modem and that is the only access point.

The modem does have 2 SSID's for 2.4Ghz and 5Ghz but both the inverter and homebridge are on 2.4.

wimleers commented 1 year ago

That's for sure puzzling 🤔

It's a mystery to me why your homebridge instance wouldn't receive the multicast packets that your energy meter is broadcasting via IP multicast…

After some more pondering, I thought of one way this could still not work for you: is it possible that the device running Homebridge has:

If you're up for it: install Wireshark and observe! 😄

silvertristan commented 1 year ago

Hey,

Checked it is IPv4 and no multiple connections to network. I'll have to install wireshark to see what's happening.

Thanks,

wimleers commented 1 year ago

Okay. To clarify: if there were multiple connections, it would have been possible that this plugin was not correctly listening for multicast on all network connections. But if there's only a single one, I don't see how that's possible.

See https://github.com/wimleers/homebridge-sma-home-manager/blob/5a3bd375e33f42165fe62bb1b79b21bcd486e001/index.js#L573-L620.

Actually, there's one thing you could try to do, change:

        this.socket.on('listening', function() {
            this.socket.addMembership(this.homeManagerAddress);
            this.multicastMembershipIntervalId = setInterval(this._keepMembershipActive.bind(this), 120*1000);
        }.bind(this));

to:

        this.socket.on('listening', function() {
            console.log('NOW LISTENING!');
            this.socket.addMembership(this.homeManagerAddress);
            this.multicastMembershipIntervalId = setInterval(this._keepMembershipActive.bind(this), 120*1000);
        }.bind(this));

to get a log entry to know for sure that the plugin actually started listening.

(But really, if it fails, then we should see Log entries generated by the this.socket.on('error' listener… 😬 )

P.S.: one thing I didn't ask you to try yet, is running Homebridge in debug mode. That will generate more log entries and maybe that contains a helpful hint!

raimund-hdr commented 11 months ago

If this issue is not resolved yet you may check the configuration of the energy meter. it is possible to change the multicast destinationthere . Maybe that has been changed. Sometimes installers change that to a unicast address of the inverter to overcome issues with powerline bridges which do not alway handle multicasts correctly (IGMP issue)