home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.17k stars 29.85k forks source link

SMA Integration not reporting SMA Energy Meter sensors #55520

Closed tomlut closed 2 years ago

tomlut commented 3 years ago

The problem

I have a Sunnyboy SB6.0-1AV-41 822 with an SMA Power meter.

All values from the SMA meter have become unavailable after updating to the latest beta version 2021.9.0b7

I can connect to both the SMA Inverter and SMA Meter web interfaces and they are communicating with each other via speedwire. Total yield, and power absorbed are visible in the SMA inverter web interface, power absorbed is visible in the meter web interface.

I tried restarting the inverter and meter. No change. No SMA Meter values available in Home Assistant.

I tried reloading the SMA integration. No change. No SMA Meter values available in Home Assistant..

I tried restarting Home Assistant. No change. No SMA Meter values available in Home Assistant.

I tried removing and re adding the SMA integration. The SMA meter entities were not found.

I tried adding the SMA Meter as a separate SMA integration. All I got was the power consumption entity.

What is version of Home Assistant Core has the issue?

core-2021.9.0b7

What was the last working version of Home Assistant Core?

core-2021.9.0b6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SMA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sma/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-09-01 20:21:26 ERROR (MainThread) [homeassistant.components.sma] Timeout fetching sma data
2021-09-01 20:22:06 WARNING (MainThread) [pysma] https://10.1.1.230: error detected, closing session to force another login attempt, got: {'err': 401}
2021-09-01 20:37:14 ERROR (MainThread) [pysma] Could not start session, 404, got {}

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

sma documentation sma source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @kellerza, @rklomp, mind taking a look at this issue as it has been labeled with an integration (sma) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

tomlut commented 3 years ago

Downgraded to 2021.8.8 - no change. Still no energy meter entities discovered when adding the SMA Inverter Integration.

Was like this: Untitled

After deleting and re-adding both the the meter and Inverter SMA integration I now dont see the metered entities in the inverter:

Screenshot 2021-09-01 at 21-19-25 Configuration - Home Assistant Screenshot 2021-09-01 at 21-19-43 Configuration - Home Assistant

The inverter is definitely talking to the meter:

sma

rklomp commented 3 years ago

Can you share debug logging of the SMA integration and pysma?

Turn on debug in the configuration.yaml and than restart HA.

logger:
  default: info
  logs:
    homeassistant.components.sma: debug
    pysma: debug

Make sure you remove credentials etc. from the logs.

tomlut commented 3 years ago

I waited until there was solar power available this morning and re-added the integration. All the metering entities showed up.

So the issue is that the SMA integration can not connect to the SMA meter via the SMA inverter when there is no solar power. Or if a Home Assistant restart is performed when there is no solar power the metering entities become unavailable.

This makes no sense as the SMA Energy meter is powered by the grid and even when there is no solar power available I can see all the values from the meter in the SMA inverter web interface. Also if no restart is performed the metering entities continue to be available when there is no solar power.

Screenshot 2021-09-02 at 07-35-20 Configuration - Home Assistant

Do you require a debug log for a restart when there is no solar power? I can do this in about 12 hours (tonight my time).

kellerza commented 3 years ago

The SMA only supports a single login(single user & single installer might give you two logins), so if you have an web login you typically see this in the logs:

2021-09-01 20:37:14 ERROR (MainThread) [pysma] Could not start session, 404, got {}

You can try a restart when there is no solar power, but not sure that is related

tomlut commented 3 years ago

Home Assistant uses the User login. I used both the Installer and User login to view the SMA inverter webpage. Neither had an issue. I am also very careful to log out as I have had that issue before.

kellerza commented 3 years ago

Good to know you keep that in mind. The best would then be to enable debugging like @rklomp suggested and try do a restart during the night and the day,- maybe we can pick up something from those logs

Hoelli4C commented 3 years ago

I also have the problem that I can not add my SMA devices to HA 2021.9.5. I know that they talk correctly over Speedwire since my EVCC instance can see all values just fine. I even installed a complete new HA installation on a Raspi4 in the same network for testing now and I still can´t add the SMA Home Manager 2.0 nor the SMA Tripower inverter. The only device working is my SMA Sunny Boy Storage, but this one is reachable via WEB, whereas the Tripower can only do Speedwire.

I will enable the debug logs and report back. Should I do it here or on a seperate incident?

rklomp commented 3 years ago

I also have the problem that I can not add my SMA devices to HA 2021.9.5. I know that they talk correctly over Speedwire since my EVCC instance can see all values just fine. I even installed a complete new HA installation on a Raspi4 in the same network for testing now and I still can´t add the SMA Home Manager 2.0 nor the SMA Tripower inverter. The only device working is my SMA Sunny Boy Storage, but this one is reachable via WEB, whereas the Tripower can only do Speedwire.

I will enable the debug logs and report back. Should I do it here or on a seperate incident?

The sma integration only supports web. Speedwire is not supported

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

tomlut commented 2 years ago

The sma integration only supports web. Speedwire is not supported

That's interesting as my SMA meter reports to the SMA inverter via speed wire and its state was visible on the web interface but until the sun came up the integration refused to report the meter values.

kellerza commented 2 years ago

This is not part of the integration, but reads the multicast speedwire: https://github.com/kellerza/hassio-sma-em

I never reports 0/None if you read it directly. There is no code in the integrat to detect if the sun is up/down so it must be the inverter responsible for the None

tomlut commented 2 years ago

There is no code in the integrat to detect if the sun is up/down so it must be the inverter responsible for the None

It's strange that the web interface and Sunny Portal can continue to receive the meter data but the HA SMA integration can't until the inverter starts reporting data from the PV arrays. Is there perhaps something that blocks the integration when it receives unknown for these inverter values even though the meter values are available?

Like unexpected message lengths or missing keys?

kellerza commented 2 years ago

If you enable debug level logging for the pysma library you should see what is sent to and received from the inverter as debug messages. Please post one request/reply during the day and one during the evening (ideally with the same sensors enabled)

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

tomlut commented 2 years ago

If you enable debug level logging for the pysma library you should see what is sent to and received from the inverter as debug messages. Please post one request/reply during the day and one during the evening (ideally with the same sensors enabled)

Sorry I just noticed this.

I don't want to have my energy meter offline all night to log this. I could get you logs while it is working but that won't be much use.

I'll close this for now and if it ever happens again I'll open a new issue with the pysma logs.

Could you please confirm that this would be the config to do that?

logger:
  default: warning
  logs:
    pysma: debug