hi brian,
I haven’t really used HA since setting it up a while ago. From memory, i managed to find an Emon integration (maybe on Github? - - can’t remember) and get it to run in HA. However, i just logged into my HA GUI and found that the data coming from emonCMS is absent and there no longer an integration listed.
Sorry, I’m not much help there!
I’d really like to get HA set up properly again, so will have to find some time to sort it all out. I also want to link it to our heating system but i couldn’t find a Heatmiser integration for HA.
I moved this to a new topic.
You will need to expand on your setup and the HW you have.
Do you mean Run in HA or simply get the data into HA?
Do you have a Pi running emoncms?
hi brian,
I’ve got an EmonPi and EmonTX running for a couple of years.
I’ve setup Home Assistant running in Docker, and have managed to get the emoncms integration kind of working using this guide:
There are a few issues though. I can see the feeds listed as ‘entities’ in HA but the big problem is that the feed data isn’t coming into HA. If i reboot HA the data from the emonCMS feeds gets refreshed, but once HA is running no new data comes in. Other integrations seem to working ok, e.g. data from solarEdge.
You can see in this graph of my emonCMS ‘use’ feed that the data is only refreshed when i’ve rebooted HA
If you click reply to the previous message or Quote me, I’ll get a notification, else your response might get lost.
That (IME) is never a good idea. I used to do this, but decided investing in the same HW the Devs seemed to use was the path of least resistance. So many issues on the forum are from folk running in an ‘unsupported way’.
I’ve no idea why it isn’t pulling in the data.
Is HA up to date?
HA is up to date (latest version downloaded on Sunday). For now i’d rather continue to get it to work in Docker rather than set up another device to run HA.
I had a “doh” moment this morning and realised that i may be using the wrong feeds. I should be using the cumulative kwh data feeds rather than continuous kw data feeds! I’m not at home at the moment so can’t check. Will do that tonight.
Yes, and you may be OK. For me it got too tiresome (that was over 2 years ago). Possibly improved now.
It isn’t anything to do with which feed i use. None of the feeds from emonCMS are being updated by HA. It just refreshes the data value when HA is rebooted, then the feed value doesn’t change.
I had it working on a previous setup using Docker, so it must be possible.
I wouldn’t bet on that as HA changes with alarming regularity. They have done something recently about polling intervals, but my system still works. I don’t really know what might be wrong. Anything in the logs?
hi brian,
most recent log
2023-04-01 23:02:27.876 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform emoncms
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 442, in async_add_entities
await asyncio.gather(*tasks)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 717, in _async_add_entity
await entity.add_to_platform_finish()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 807, in add_to_platform_finish
self.async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 559, in async_write_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 603, in _async_write_ha_state
attr.update(self.extra_state_attributes or {})
File “/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py”, line 224, in extra_state_attributes
ATTR_LASTUPDATETIMESTR: template.timestamp_local(float(self._elem[“time”])),
TypeError: float() argument must be a string or a real number, not ‘NoneType’
2023-04-01 23:02:27.919 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up emoncms platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 301, in _async_setup_platform
await asyncio.gather(*pending)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 442, in async_add_entities
await asyncio.gather(*tasks)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 717, in _async_add_entity
await entity.add_to_platform_finish()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 807, in add_to_platform_finish
self.async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 559, in async_write_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 603, in _async_write_ha_state
attr.update(self.extra_state_attributes or {})
File “/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py”, line 224, in extra_state_attributes
ATTR_LASTUPDATETIMESTR: template.timestamp_local(float(self._elem[“time”])),
TypeError: float() argument must be a string or a real number, not ‘NoneType’
2023-04-01 23:02:53.121 WARNING (MainThread) [homeassistant.components.climate] Setup of climate platform nibe is taking over 10 seconds.
2023-04-01 23:02:53.126 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform nibe is taking over 10 seconds.
2023-04-01 23:02:53.141 WARNING (MainThread) [homeassistant.components.water_heater] Setup of water_heater platform nibe is taking over 10 seconds.
2023-04-01 23:05:10.288 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.emoncms_export_kwh from integration emoncms has state class total_increasing, but its state is negative. Triggered by state -2400.85 with last_updated set to 2023-04-01T22:02:27.870323+00:00. Please create a bug report at Issues · home-assistant/core · GitHub
Is the problem something to do with missing values in the feeds? I recall reading somewhere that having missing values in feeds will cause problems for HA, but i thought that was fixed in most recent version. I have HA version 2023.3.5.
There’s also the error about negative values, which is from the solar energy export feed.
I tried editing the configuration.yaml file to include only specific feeds, hoping that might stop the issue, but i’m not sure what the feed numbers are or where to find them in emonCMS. I guessed some feed numbers to see what happened. But after restarting HA nothing changed.
Example configuration.yaml entry using cloud based Emoncms
sensor:
- platform: emoncms
api_key: XXXXXXXXXXXXXXXXXX
url: http://192.168.1.220/emoncms
id: 1
include_only_feed_id:
- 3
- 6
EDIT - I found the feed numbers in Data Viewer - Feeds in View stats table.
I’ve now set the config yaml to only include specific feeds, and the errors in the logs have stopped appearing on restarting HA. Looks like data is now coming in from emonCMS.
EDIT - I found the feed numbers in Data Viewer - Feeds in View stats table.
Also if you hover your mouse over the name of the feed on the Feeds page of emonCMS.