Add entity_id's to EmonCMS intergration

I used the site search to see if this had been requested before, but couldn’t find it. If I’m incorrect, please point me in the direction and feel free to remove this post.

EmonCMS is a separate system used to collect and analyse information primarily around power.

Home Assistant appears to have support for EmonCMS baked in, and is configured using the configuration.yaml file.

However, when importing sensor data entities are not given a unique reference allowing them to be useful in the same way as other devices. I have to assume there’s a good reason for this but I’ve not discovered why in any documentation.

Example payloads from EmonCMS API detail the unique identifier “FeedID” - this ID can’t be edited within EmonCMS and persists for the life of the entity within this system.

Using the platform name, Senor ID and FeedID can we get a unique like “emoncms.{{id}}.{{FeedID}}” in place?

+1 for this. Also experiencing issues in HA relating to the lack of unique IDs of emoncms sensors. prevents using with the energy dashboard, for example.

@changeableface, may i ask whether you were able to find a work around in the meantime? thanks.

It’s been a long time since I logged in, so I didn’t see your response. Yeah, I finally got it working in the energy dashboard.

I hope you got this working, but if not, maybe my experience will help you. It took me far too long to find the correct blog post explaining how this could work.

Originally, my feeds gave me 10w or 20w, depending on the current draw at the exact moment.

I created additional feeds to give me 2943.91kW based on all-time usage, which increases every few seconds.

This new feed is what the energy dashboard needed to see.

Here is a screenshot of my input - this creates three feeds. The “Grid Power” is the current usage, “Grid Export” is my Solar power going back in the grid, and “Grid Import” is my usage from the grid. I’ve had to do some math to turn the import to a positive number as HA doesn’t like negative numbers.

I add the feeds in the normal way;

sensor:
  # Solar PV
  - platform: emoncms
    api_key: !secret emoncms_api_key
    url: http://192.168.10.XXX
    id: 1
    scan_interval: 5
    sensor_names:
   ...
      23 : "Solar"
      24 : "Grid Import"
      25 : "Grid Export"
      26 : "Battery In"
      27 : "Battery Out"

Then, I was able to use these feeds in the energy dashboard.