Energy Management with local emonCMS and EV - looking for help

I am looking for help with setting-up my Energy configuration in HA, using emonCMS and an EV. I have a local emonCMS with an emonTX (with 3 current probes, one for the grid input current, one for the solar panel input and one added to the EV charging device).

In emonCMS i have the following feeds foe the 3 probes:

And in HA i find the following entities for emoncms:

To start, i do not see these sensors in the Energy configuration.
What i do see in Energy is just one sensor coming from my SolarEdge Inverter, but none sensors from emonCMS.
An other strange thing is that i see these entities with (entity-name)_2
I have no idea why these are generatedā€¦

Please can an anyone help me or point me to a tutorial to get started with this configuration?

Need to show how you are attempting to get the CMS feeds into HA.
I send selected kWh Feeds with this config sensor code:

image

1 Like

Hi @MuzzaM Thank you for coming back to my question.
I was not aware that i had to specify Feeds in in the HA-config. Also sensor names?
I wwould like to add these, but where do I get the ID-numbers from?

In ā€¦[config]/includes/sensors.yaml:

#######################################
# emonCMS
#-|---|---|---|---|---|---|---|---|---|
- platform: emoncms
  api_key: !secret emonCMS_API_KEY
  url: http://192.168.178.235/emoncms
  id: 1

I tried to follow this thread: Energy Management in Home Assistant
but could not find this answerā€¦

BTW, i upgraded emonCMS today to the last version 10.8.5.
But i do not find any feed-idā€™s in emonCMS. Perhaps you can tell me where to look for them?
BTW2, My config is an emonTX with the emonESP to use WiFi to connect to the RPi3 with emoncms.

Edit.
Found an iten at the emoncms about feed-idā€™s. So i tried this to get extra info:

http://192.168.178.235/feed/list.json?apikey=(my-read-only api-key)

And got this return:

[{"id":"1","userid":"1","name":"Power","datatype":"1","tag":"Node emonTX-1","public":"0","size":"32771796","engine":"5","processList":"","unit":"W","value":528,"time":1633874651,"start_time":1551875850,"interval":10},{"id":"2","userid":"1","name":"Solar","datatype":"1","tag":"Node emonTX-1","public":"0","size":"32771776","engine":"5","processList":"","unit":"W","value":831,"time":1633874651,"start_time":1551875900,"interval":10},{"id":"3","userid":"1","name":"EV","datatype":"1","tag":"Node emonTX-1","public":"0","size":"32771752","engine":"5","processList":"","unit":"W","value":0,"time":1633874651,"start_time":1551875960,"interval":10},{"id":"4","userid":"1","name":"Netspanning","datatype":"1","tag":"Node emonTX-1","public":"0","size":"32770468","engine":"5","processList":"","unit":"V","value":237.427611,"time":1633874651,"start_time":1551879170,"interval":10},{"id":"5","userid":"1","name":"Temp-meterkast","datatype":"1","tag":"Node emonTX-1","public":"0","size":"5461760","engine":"5","processList":"","unit":"\u00b0C","value":20.2,"time":1633874651,"start_time":1551879180,"interval":60}]

So it looks like the idā€™s are ā€œ1, 2, 3, 4 and 5ā€, but i doubt that this is correct, seeing your feed-idā€™sā€¦

EDIT 2;
If i send this to emoncms http://192.168.178.235//feed/ iā€™l get this outpot, with Feed IDā€™s.
So ā€œ1, 2, 3, 4, 5ā€ must be the right Feed-IDā€™sā€¦

Iā€™m running a emonpi and also other inputs so my feed ids are many, so donā€™t compare to much. I specify the feed ids in the HA config because I find I have much better control of info going into HA. Iā€™d recommend doing the same even if you only have 5 feeds defined (so far).
Also you can control how often feeds update and the sensor names among other things.
Getting a bit late here but will send you a few other tip I learned on integrating Emoncms info with HA in next few days.

Ok, lets try that. I changed my /config/includes/sensors.yaml file to:

#######################################
# emonCMS
#-|---|---|---|---|---|---|---|---|---|

- platform: emoncms
  api_key: API_KEY
  url: https://emoncms.org
  scan_interval: 30
  id: 1
  unit_of_measurement: "W"
  include_only_feed_id:
    - 1 "Grid"
    - 2 "Solar"
    - 3 ""
    - 4 ""
    - 5 ""
  sensor_names:
    1: "Grid"
    2: "Solar-panels"
    3: "EV"
    4: "Netspanning"
    5: "Temp-meterkast"

But i get errors when i check my config in HA:

Invalid config for [sensor.emoncms]: expected int @ data['include_only_feed_id'][0]. Got '1 "Provider-net"'
expected int @ data['include_only_feed_id'][1]. Got '2 "Solar"'
expected int @ data['include_only_feed_id'][2]. Got '3 "EV"'
expected int @ data['include_only_feed_id'][3]. Got '4 "Netspanning"'
expected int @ data['include_only_feed_id'][4]. Got '5 "Temp-metwerkast"'. (See ?, line ?).

I understand the time difference between our countries :slight_smile:
Looking forward the coming days for any help you can give me :wink: Thank you so far!

You got the wrong syntax here. the include_only_feed_id expects a list of numbers only. In my example above I add a comment after each feed id using ā€˜#ā€™ just to remind me what each feed id number is. So like this should work:

include_only_feed_id:
    - 1     #Grid Power
    - 2     #Solar Power
    - 3 
    - 4 
    - 5    # Temperature

The sensor_names look ok. Note that this is where you can control what the sensor names are in HomeAssistant, they donā€™t have to be identical to the feed names from emoncms.

Next point:
Your five feeds are a mix of values, power in watts, Netspanning in volts and a Temperature value in C(?) . I donā€™t specify unit_of_measurement in my HA emoncms yaml config. If you make sure your feeds in emoncms are correctly specified, then they should flow thru to HA correctly without specifying the optional unit_of_measurement config variable.

Once you correct the above you should be a master of getting emoncms feed data into HA. :sunglasses:

Nextā€¦
Your original question was getting data into HA ENERGY Management.
For that you need energy data (in the form of kWh). Which brings me back to your first screen shot at the top of this post, the ā€˜Inputsā€™ screen where I see a summary of emonTX input process steps for CT1, CT2 etcā€¦

For example looking at input CT1 only. The process steps are:
Allow Positive, Log to Feed, Power to kWh

This means you should have two feeds from this CT1 input, (a power feed in watts, and an accumulating energy feed in kWh). This will be in you local emonCMS database.

Can you confirm this?

Or send me more detailed view of CT1 process list by clicking on the spanner on the far right of this:

Hi @MuzzaM . Sorry to raise this post from the past. But there doesnā€™t seem to be too much about on HA vs. emonCMS integration.

Can I please ask, once Iā€™ve added the ā€œ-platformā€ lines to my yaml, with the read api and local url, should HA start to build up a list of entity IDs automatically based on the feeds Iā€™ve created in emonCMS?

I ask as I canā€™t find anything in HA showing the 8 feeds Iā€™ve created in emonCMS:

The ā€œintegrationā€ Iā€™ve used is:

  - platform: emoncms
    api_key: [my read api]
    url: htpp://192.168.101.9/emoncms
    id: 1

Thanks in advance for any pointers.

At first glance it looks like a syntax error. You have htpp ā€¦ should be http :sunglasses:

1 Like

Oh FFS!!!

Iā€™m tired, sleepy, need new glasses, etc [excuses; excuses;]

Thanks for spotting what could be the stupidest error this week.

Hey ā€¦ no problem ā€¦ we have all been there :grinning: