Integrating with HomeAssistant

Hello, has anybody got an idiots guide on how to do this? I have been running Emonpi and EmonEVSE for charging car from solar for a while now. I have now had a try with HA and struggling a bit. I would like to send data from emonpi to HA so that I can turn plugs on etc to use excess solar instead of exporting. Any help would be appreciated Thank you.

The old topic was solved so start a new thread.

What have your tried and what doesn’t work?

I use the Emoncms integration for HA, it works well

This is my simple HA setup, photo was taken a while back when electricity prices were crazy cheap!

I have tried the above and keep getting error message in yaml (bad indentation of a mapping entry at line 26, column 3:
platform: emoncms)
I am new to HA and have been trying to get different things working and have got a bit lost. So now trying to get one thing at a time working.

Mark, getting the identation correct in YAML can be a pain, I use Visual Studio code when I work with YAML in HA as I find it is easier to see incorrect indentation which, if I recall correctly, indentation has to be spaces not tabs. It looks like I am about to embark on a similar path once I understand the Emoncms feed.

This is an excerpt from my Home Assistant config YAML where I pull a bunch of feeds into HA entities.

  - platform: emoncms
    api_key: xxxxxxxxxxxxxxxxxxxxxxxx
    url: https://emoncms.org
    scan_interval: 10
    id: 1
    unit_of_measurement: "W"
    value_template: '{{ value| round(0) }}'
    include_only_feed_id:
      - 374689 # import
      - 374691 # solar
      - 374693 # use
      - 405881 # export
    sensor_names:
      374689: "Importing"
      374691: "Generating"
      374693: "Using"
      405881: "Exporting"
1 Like

This is all I put into my configuration.yaml, it just brings everything across from my emonPi which is on the same network. Note you have to use the IP address, you can’t use http://emonpi.

sensor:
  platform: emoncms
  api_key: xxxxxxxxxxxxxxxxxxxxxxxx
  url: http://192.168.1.201/
  id: 1

I think @Zarch probably has a more efficient solution, just choosing the feeds that are needed. I have 95 and didn’t really know which ones I wanted in HA.

Thank you all, for help and suggestion’s. Still struggling, Going to try a clean install of HA and start again from scratch…

I’m using the same(ish) setup as @christian for the same reasons… :-

  platform: emoncms
  api_key: !secret emoncms_api_key
  url: http://192.168.20.20/emoncms
  id: 1

Studio Coder Server throws a wobbly saying “Incorrect type. Expected “array”” but it all seems to work.

If it’s still an issue after the rebuild let us know the errors you are getting.

This is the complete configuration.yaml that I use:

sensor:
  - platform: emoncms
    url: http://localhost/emoncms
    id: 1
    api_key: !secret emoncms

I put the API key in secrets.yaml so I never have to worry about editing the yaml if I’m pasting it online. I also run HA on my emonpi, so it just point it at localhost, but your setup is clearly different and I think you will need to give us a bit more detail so that we can help you.

Details from the log file, as well as which versions you’re running and where, will also be helpful.

Got it working eventually, my fault i have setup nest wifi network which my emonpi and ev are connected to. When i setup HA i plugged into back of router, so was on a different network. When all on same network took a bit of messing about but working ok now. Just got to learn next bit now. Think i have learnt a lesson? Thank you to all that have helped. I am learning slowly.

2 Likes