For some reason my emonCMS integration in to Home Assistant has stopped working, and I can’t work out why.
In the HA instructions it says to use a url of http://x.x.x.x/emoncms if using a self hosted EmonCMS (which I do). But if I type http://192.168.2.50/emoncms into my browser I get an error
## 406 Not Acceptable
URI not acceptable. **Emoncms** cannot respond to **""**.
Try another link from the menu.
No emon sensor devices / entities show up in HA. I have treble checked my config.yaml and secrets.yaml files, and am using the correct Write API.
[edited by Mod] @JJC
For future reference, when posting code or bash output, please put in 3 ‘backticks’ (found at the top left of the keyboard normally) on a line on their own, then the code, then 3 more backticks on a line following the code.
```
code
```
If it is something like php you can add a language identifier that after the first 3 backticks so ```php
Thanks @JJC ; it is still not working, but looking in /config/home-assistant.log there are a load of issues which all look more involved than I am comfortable with.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 112, in setup_platform
EmonCmsSensor(
File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 157, in __init__
self._state = round(float(elem["value"]), DECIMALS)
TypeError: float() argument must be a string or a number, not 'NoneType'
I deleted all reference to emoncms and re-started HA, and the above errors were not present. But re-entering the emoncms details and back the error came. No idea why …
Even nuking my HA completely, and starting with a vanilla installation, when I add emoncms I get this error in the logs.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 112, in setup_platform
EmonCmsSensor(
File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 157, in __init__
self._state = round(float(elem["value"]), DECIMALS)
TypeError: float() argument must be a string or a number, not 'NoneType'
So I don’t think it is me or a conflict with another component.
did you copy my text in exactly with no blank lines and no leading - before the platform.
I found if it was not exactly correct it would not work though did not show any error during boot up.
Many thanks all; replying to several points raised …
Yes, I did enter exactly that text (changing IP address, and no surrounding the Read API with “”; I think I need to put a leading - character in from of the platform line (and re-indent the following lines) as I also have other sensors under sensor
HA is fully up to date (well, 2021.4.5 actually, but about to update to 2021.4.6)
http://192.168.2.50 and http://192.168.2.50/emoncms work (but to be fair the latter did work a couple of weeks ago).
Where do I find a feed_id? Can I use a feed name (ie O2-Office for example)? I don’t see where my feeds have numbers.
My emonCMS integration did work, so either I or HA has broken something somewhere …
In Emoncms, mouse over the feed name and you will get the ID.
Interesting - could easily be an HA change.
It does depend if you split up your yaml into separate files. If you have a sensor file, you do not need the sensor line, but the indenting changes. You do need the ‘dash’ in from of platform - suprised you did not get an error when you did a check config in HA.
Actually I think the ‘minimal’ config in the HA docs is wrong.