I am trying to get the Emoncms integration working with Home Assistant. Having been through the process of updating to the emonSD-17Oct19 image (which went flawlessly), I still can’t get Home Assistant to recognise Emoncms.
I have been through the logs and found the following, which seems to be the root of the problem. Does anyone know what this means? I am using the basic setup in configuration.yml (Read API Key, Emonpi ip address and id: 1) accessing my local emonpi.
File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 160, in __init__
self._state = round(float(elem["value"]), DECIMALS)
TypeError: float() argument must be a string or a number, not 'NoneType'
I went through my feeds and found two NULL feeds, which I deleted. I had also not spotted that one of my EmonTHs had a flat battery so this might also have been producing NULLs, but I can’t remember now!
Having re-started Home Assistant, the feeds from EmonCMS are now discovered, so I can start playing with them now.
Sorry, I don’t know what mechanism HA uses to mark a sensor as unavailable, but checking for ValueError and TypeError would probably be the most appropriate exceptions to catch.