Repository navigation
Add PV input sensors and create sensors at their first value - #23
Merged
Merged
Conversation
Firmware 7 sends a mppt array that had no sensors, and /ders lists DERs a device never reads. An SMA inverter with no Energy Meter lists a meter and an inverter stage but only sends solar, so 15 of its 17 sensors stayed unavailable forever. A device sensor is now created when its first value arrives, from a coordinator listener, so nothing needs a reload when a firmware update starts sending more. A sensor that has had a value stays and shows unavailable when the value stops. The L1-L3 sensors now also take an inverter's phases when the device has no grid meter, positive while supplying like Inverter Power. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 1.1.2. A community user with an SMA inverter and no SMA Energy Meter saw 15 of 17 sensors unavailable on firmware 7.0.3.
Cause
/derslists what a device is configured with, and on firmware 7 that includes DERs it never reads. This inverter listssolar,meterandinverterbut/data/jsononly hassolar. The integration created sensors from/ders, so the rest could never get a value. Thempptarray it does send had no sensors at all.Changes
_REQUIRES_INITIAL_VALUE, which only covered three sensors and only at setup.Existing installs
Sensors that never had a value stay in Home Assistant as "no longer provided" until the user deletes them. I did not remove them automatically, since that would also hit a sensor whose device is only temporarily not reporting.
Testing
pytest: 138 passed.black,isort,mypyclean,pylint10/10. Two old tests pinned the old behaviour and were rewritten.fw7_sma_data.jsonis a captured 7.0.3 payload with the serial replaced.Not tested against a real SMA inverter end to end; the payloads are real, the HTTP server replaying them is not.
🤖 Generated with Claude Code