core: SMA Solar WebConnect sensors not returning any values
Home Assistant release with the issue: 0.84.6 Last working Home Assistant release (if known): Unknown Operating environment (Hass.io/Docker/Windows/etc.): Docker on Ubuntu 18.10 Component/platform: sensor/sma.py
Description of problem: After adding the required configuration for the SMA Solar WebConnect sensors, the sensors are created but do not return a value (all created sensors have Unknown as value).
There are no errors or warnings in the Home Assistant logs.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
- platform: sma
host: x.x.x.x
ssl: false
verify_ssl: false
password: xxx
group: user
sensors:
current_power:
daily_yield:
total_yield:
Additional information: When running the example file from pysma (cloned directly from https://github.com/kellerza/pysma) on the physical machine used for Home Assistant, there are no issues and I do get the requested values:
DEBUG:pysma:{"result": {"012F-730A2A43": {"6100_00543100": {"val": null}, "6180_08214800": {"val": [{"tag": 307}]}, "6400_00543A00": {"val": 0}, "6400_00262200": {"val": 203}, "6100_40263F00": {"val": 105}, "6400_00260100": {"val": 6195580}, "6100_0046C200": {"val": 105}, "6100_00464800": {"val": 22742}}}}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (8 by maintainers)
Commits related to this issue
- Fix #20375 #19541 — committed to kellerza/home-assistant by kellerza 5 years ago
By using the following code, I got rid of all the
[pysma] Sensor ...
warnings from above, and the sensors are working again:I now only get the (expected) warnings in the server logs:
Seems like
json_body
sometimes isEmpty
, but not always as the sensors are returning the correct values in Home Assistant.What SMA inverter do you use? I dont think this would have ever worked for you
The latest library allows some flexibility and uses JMES path to extract the values (the HASS component needs a slight change and does not have a config option for this yet…)
To test, you can try to modify the library & change this line to
JMESPATH_VAL = '.val'
(you will need to find where the pysma library is installed)If you change it and re-run
example.py
it might also show you more decoded values…For reference, you can see the output from my inverter (SB1.5) is somewhat different … and the reason for the current JMESpath value