# Emoncms Home Assistant

**URL:** <https://community.openenergymonitor.org/t/emoncms-home-assistant/1667>\
**Category:** Integrations\
**Tags:** homeassistant\
**Created:** [11 September 2016 12:04 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667 "2016-09-11T12:04:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [11 September 2016 12:04 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/1 "2016-09-11T12:04:47Z")

</div>

Nice work! This is really cool, I really like what you’re doing with HA. I wrote a blog post a while back when I experimented with HA running on our emonPi unit. [Home Assistant and emonPi - Blog | OpenEnergyMonitor](https://blog.openenergymonitor.org/2016/04/Home-Assistant/)

Do you have a link to the Emoncms \> HA documentation page. I will list it on our integrations page: [Integrations - Guide | OpenEnergyMonitor](https://guide.openenergymonitor.org/integrations/) . I can’t seem to find emoncms listed under the ‘energy’ section [https://home-assistant.io/components/#energy](https://home-assistant.io/components/#energy) ?

We have also based our user guide and blog on the same Oscalite theme that the HA website uses. Greatest form of flattery?! 😉

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [11 September 2016 14:09 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/2 "2016-09-11T14:09:14Z")

</div>

Hi glyn,

It’s still a pull request, it hasn’t come live yet.  
you can check the pull request for the code [here](https://github.com/home-assistant/home-assistant/pull/3258) and the pull request for the documentation [here](https://github.com/home-assistant/home-assistant.github.io/pull/910) . I made the screenshots from running a preview of the [homeassistant.io](http://homeassistant.io) website locally on my computer so it has not come live yet.

I’ll notify you once it does.

Previously i was also running ha integration through mqqt & mqqt sensors but the problem was that you had to send the data to mqqt from emoncms and for each value you wanted in home assistant you had to create an mqqt sensor. This component just needs one or a few configuration entries in home assistant and you don’t need to send the data through mqqt which makes it a bit easier to add multiple sensors at once and is not that time consuming.

another solution was using a feed api and a rest sensor but this had the same problem of needing to specify a new (rest) sensor for each value you wanted to see in home assistant

Also i managed to reduce my cpu usuage on my intel nuc running mosquito, hass and emoncms by 10-15% by not sending the mqqt messages anymore from emoncms and not using a mqqt sensor. My database disk usage went also down in home assistant.

The problem i had was that emoncms sent a new mqqt message whenever it had gotten data and reacted to it. Now this component i can specify an update interval for the sensor (default 30 secs) so it only updates then and not every time emoncms sends an mqqt message. The only downside which imo is not that big of a deal is you don’t see the last value immediatly while you did when using the mqqt system

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [20 September 2016 18:46 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/3 "2016-09-20T18:46:58Z")

</div>

@glyn.hudson the Pull request as well as the documentation got accepted. It won’t be listed under energy though but under sensor. The latest version of the component is already availible using the dev branch of home assistant. As soon as there is a new home assistant version (that will include it) i’ll give you a private message with the link to the documentation. I don’t know their realease shedules though so not sure how long it would take

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [21 September 2016 19:43 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/4 "2016-09-21T19:43:18Z")

</div>

Great, thanks! Nice work

- sent from my mobile device

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [23 September 2016 01:04 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/5 "2016-09-23T01:04:20Z")

</div>

@glyn.hudson someone using hass had a very nice idea … an extra history component for emons inside hass. There are a few other components like this for hass already like for example the [dweet.io](http://dweet.io) one.

Basically a history component monitors for state changes of entities for example if a sensor’s value changes the component detects it. The emoncms\_history component then uses the input api of emoncms to log a json value to a specific node value with the entityid as name and the changed value as input value for emoncms

In practise this would allow hass to send any sensor’s data ever being made to emoncms.

The use case of the person in question was that he has a “zwave energy meter sensors” and “ecobee temperature sensors” and then those devices data can be send to emoncms with the component acting as a bridge between the device and emoncms.

so if people have perhaps energy loggers that are supported in home assistant but there does not exist some kind of tool to submit the data to emoncms but there does exist a component in hass that displays numerical data, this new component can then be used as a bridge to get the values inside emoncms and do whatever you like with it afterwards in emoncms (creating feeds / graphs / dashboards etc)

If i had known about this myselve for example i wouldn’t had to create a tool in windows to send my nuc cpu use ram use disk use etc to emoncms as i could have used this component then 🙂

same goes for wemo insight switches to send the power usuage data to emoncms.

it opens up a whole lot of possibilities

edt: pull request created:

> <https://github.com/home-assistant/core/pull/3531>
>
> \*\*Description:\*\*
> 
> Emoncms history compnent is a history component just like / ba…sed on the dweet.io history component and has the same functionality but sends the data to emoncms.
> 
> This would for example let people push there power readings from zwave power devices to emoncms for further processing. 
> 
> But can be used to send any (numerical) data
> 
> \*\*Related issue (if applicable):\*\* fixes #
> 
> \*\*Pull request in \[home-assistant.io\](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):\*\* home-assistant/home-assistant.io#
> 
> https://github.com/home-assistant/home-assistant.github.io/pull/991
> 
> \*\*Example entry for \`configuration.yaml\` (if applicable):\*\*
> 
> \`\`\` yaml
> \# Example configuration.yaml entry
> emoncms\_history:
> api\_key: put your emoncms WRITE api key here
> url: https://emoncms.org
> inputnode: 19
> whitelist:
> - sensor.owm\_temperature
> - sensor.owm\_wind\_speed
> - sensor.owm\_humidity
> - sensor.mold\_indicator
> - sensor.emoncms1\_feedid\_29
> - sensor.cpu\_use
> - binary\_sensor.pir\_motion
> \`\`\`
> 
> \*\*Checklist:\*\*
> 
> If user exposed functionality or configuration variables are added/changed:
> \- \[X\] Documentation added/updated in \[home-assistant.io\](https://github.com/home-assistant/home-assistant.io)
> 
> If code communicates with devices, web services, or a:
> \- \[N/A\] Local tests with \`tox\` run successfully. \*\*Your PR cannot be merged unless tests pass\*\*
> tox doesn't run on windows
> \- \[N/A\] New dependencies have been added to the \`REQUIREMENTS\` variable (\[example\]\[ex-requir\]).
> no new dependcies
> \- \[N/A\] New dependencies are only imported inside functions that use them (\[example\]\[ex-import\]).
> no new dependcies
> \- \[N/A\] New dependencies have been added to \`requirements\_all.txt\` by running 
> \`script/gen\_requirements\_all.py\`.
> no new dependcies 
> \- \[X\] New files were added to \`.coveragerc\`.
> 
> If the code does not interact with devices:
> \- \[\] Local tests with \`tox\` run successfully. \*\*Your PR cannot be merged unless tests pass\*\*
> \- \[\] Tests have been added to verify that the new code works.

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [26 September 2016 19:23 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/6 "2016-09-26T19:23:02Z")

</div>

figured something else out…

you can directly view the dashboards from emoncms inside home assistant by making them public and using an iframe panel comonent 🙂

I tried linking to the dashboard without making it public but providing the readapikey but for some reason some of the widgets did not display then so i guess if you want to do this you’d have to make it public

a few example screenshots  
 ![](https://xq40vg.bl3301.livefilestore.com/y3mZ-65TE4qM8pL-xNTTllPR5_QdLPZp8hJBMI2pOgePswu9dKxDQHvMAvh4FK-bEgJoWF9MVRlJ80fWuGRtW8zjCaqBnfgtuVln0NUpo5vn_Fx1_MH9YjkvWPNt2WHlwuYnMFhhZP8FvDSKEE3BCDNSZK02aXOS-TRah8__LABezY?width=1920&height=1137&cropmode=none)

![](https://xg47vg.bl3301.livefilestore.com/y3mong4_SwT9yRt1UTCWqEwjOuyBsY2jD5FU46uBk6Xkkj4uSfEC73O6TcKFogOhU000b30JUpPWDT7aUZr329IIcC4nDXxwHiN4RdHLdXmeIsHZrIvWqNXEzOl9V_mqhfGWZ4_5vEhDk7KH7YbhO8m8Jfw3AVhTrJkGx7gW1YoaKQ?width=1787&height=960&cropmode=none)

![](https://xg48vg.bl3301.livefilestore.com/y3mRjbDz02sbO3glBlv8iaIh8sPFJa8joiRvAt1BtX2PJF7b6r7SxEDgMEBVDL9xi8m23VqG8eQpbCSpq4q91Req-Y6v1qi2vc_tlhl-iXJVufO-FF7DsDc6AAdyvpQ6Vg5PccQ4RQv3SAzq37c8-UoUQdsivWFvaCw8Y5Q4NaeJ-U?width=1315&height=771&cropmode=none)

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [29 September 2016 08:17 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/7 "2016-09-29T08:17:57Z")

</div>

@glyn.hudson Home Assistant 29.1 just got released. The emoncms feeds sensor is included the history component is not yet, that will be for the next release once the pr gets accepted.

The documentation for the emon cms sensor is availible here [https://home-assistant.io/components/sensor.emoncms/](https://home-assistant.io/components/sensor.emoncms/)

once the history component gets released i’ll report as well

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [29 September 2016 10:35 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/8 "2016-09-29T10:35:40Z")

</div>

A post was split to a new topic: [Home Assistant emonSD](https://community.openenergymonitor.org/t/home-assistant-emonsd/1728)

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [29 September 2016 11:02 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/9 "2016-09-29T11:02:48Z")

</div>

A post was merged into an existing topic: [Home Assistant emonSD](https://community.openenergymonitor.org/t/home-assistant-emonsd/1728)

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [20 October 2016 20:59 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/10 "2016-10-20T20:59:24Z")

</div>

Quick update the emoncms\_history component for home assistant got accepted and is due to release in ha 0.31 (normally this weekend, guessing saturday)

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [20 October 2016 23:47 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/11 "2016-10-20T23:47:31Z")

</div>

Nice 👍

How does the Emoncms history component work in HA?

---

<div class="post-metadata">

**Author:** ![joyrider3774](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@joyrider3774](https://community.openenergymonitor.org/u/joyrider3774)\
**Post date:** [21 October 2016 07:28 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/12 "2016-10-21T07:28:25Z")

</div>

You specify the write api key, base url (like [https://emoncms.org](https://emoncms.org) or your local installation), an input node id, optional scan interval and whitelisted entities in the config. Entities are like sensors for example temprature power meters etc

What it does then is every “Scan interval” seconds it will gather all whitelisted entities states (values) and try to convert it to a numeric value place it all in the json format like {entitiy1:entity1value,entitiy2:entity2value,…} and use http post using the data parameter (input api) to send the data to emoncms on the chosen input node id in the config.

That’s basically all it does and how it works.

The default scan interval is set at 30 seconds so every 30 seconds it would send data to emoncms but users can lower this value or make multiple emoncms\_history sensor config’s each with their own scan interval (for example one with whitelisted entities that don’t change much with a higher scan interval and another with one that changes a lot with lower scan itnerval).

This makes it possible to send every (current) number value from components like sensors etc to emoncms to create feeds, graphs, dashboards etc for it afterwards.

So if somone has a zwave power reading outlet and uses home assistant to read its value they can send the power value to emoncms using this component. But it’s not just for power values any numeric value can be send and dashboards can be created for it or the data can be kept in feeds for historical data etc.

there currently is a bug in home assistant with the wemo insights so that it does not update the power value when it changes (it’s reported) but if that’s fixed you can create a template sensor that gets this power value and then you can add the (template) sensor to the whitelisted entities in emoncms\_history component so then you can send power values from wemo insights to emoncms and don’t need any self made code to send the values to emoncms (like i did in the past).

or send the temprature data from open weather map to emoncms anything you can think of basically as long as home assistant supports it and it’s a numeric value it can be send to emoncms

---

<div class="post-metadata">

**Author:** ![haffle](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/h/d07c76/32.png) [@haffle](https://community.openenergymonitor.org/u/haffle)\
**Post date:** [9 December 2019 13:46 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/13 "2019-12-09T13:46:18Z")

</div>

I am trying to bring in emonpi.local data in to my Home Assistant / hassio dashboard, which is running on a separate Raspberry Pi. I have been following the guide on [Emoncms - Home Assistant](https://www.home-assistant.io/integrations/emoncms/) but I keep getting an error. The Feed id of 106 is what I see when I hover over the Feed (Office Temp) within my emonpi.local

The error log states

```auto
Log Details (ERROR)
Mon Dec 09 2019 13:17:54 GMT+0000 (GMT)
HTTPConnectionPool(host='emonpi.local', port=80): Max retries exceeded with url: /feed/list.json?apikey=*my emonpi.local read API is redacted here* (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f86639e10>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

```

**Does anyone know what I should use in place of [http://emonpi.local](http://emonpi.local)** which I think is what the issue is?

TIA, Julian

PS: This is what my config.yaml looks like …

```auto
sensor:
  - platform: emoncms
    api_key: *my emonpi.local read API is redacted here*
    url: http://emonpi.local
    scan_interval: 300
    id: 1
    unit_of_measurement: "ºC"
    include_only_feed_id:
      - 106

```

.

 ![2019-12-09%20emon%20Feed%20ID](https://community.openenergymonitor.org/uploads/default/original/2X/2/26c485564b1310c122956ff67939641a0ce4b7a2.jpeg)

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [9 December 2019 15:13 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/14 "2019-12-09T15:13:16Z")

</div>

Mmmm, never found this component before and I use HA quite a lot!!!

HA has moved on a lot since this was created so it is very possible it is now broken.

Try the IP address?

I currently post everything from EmonCMS to an ‘output’ MQTT topic which I pick up in HA.

I’m about to (over Christmas) move my HA install to a new 4Gb RPi 4 with an HDD. I’ll have a play with the node then.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [9 December 2019 16:39 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/15 "2019-12-09T16:39:00Z")

</div>

Just tried it, works fine with an IP such as `http://192.168.1.10`

---

<div class="post-metadata">

**Author:** ![haffle](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/h/d07c76/32.png) [@haffle](https://community.openenergymonitor.org/u/haffle)\
**Post date:** [9 December 2019 22:05 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/16 "2019-12-09T22:05:24Z")

</div>

Thanks @borpin ; I have finally managed to get it to work - and for the possible benefit of others following in the future, this is what I needed to include…

```auto
sensor:
  - platform: emoncms
    api_key: XXmyAPI_read_key_redactedXX
    url: http://192.168.1.150/emoncms
    id: 1
    unit_of_measurement: "C"
    include_only_feed_id:
      - 106

```

For me, the inclusion of the trailing /emoncms made all the difference.

Yee Gads, this is all very exciting when I get it to work 😀

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [10 December 2019 08:16 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/17 "2019-12-10T08:16:58Z")

</div>

> [@haffle](#):
>
> For me, the inclusion of the trailing /emoncms made all the difference.

There have been some changes in the Apache config so yes, sometimes you need the trailing `emoncms`, depends on when the install was done. It is the same for the HTTP interfacer in emonhub.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Gomes](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/ricardo_gomes/32/17592_2.png) [@Ricardo\_Gomes](https://community.openenergymonitor.org/u/Ricardo_Gomes)\
**Post date:** [8 April 2021 09:58 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/20 "2021-04-08T09:58:51Z")

</div>

![image](https://community.openenergymonitor.org/uploads/default/original/3X/8/5/858b48f0cb1b854021cc7c45b8aa35e64d1a680e.png)  
Since January i cannot write to my emoncms  
I can send by other devices but not with home assistant.  
what can i do to debug?

---

<div class="post-metadata">

**Author:** ![boelle](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/boelle/32/19850_2.png) [@boelle](https://community.openenergymonitor.org/u/boelle)\
**Post date:** [6 September 2021 10:55 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/21 "2021-09-06T10:55:38Z")

</div>

@joyrider3774

nice one, how would you send to multiple nodes?

```auto
emoncms_history:
  api_key: 
  url: 
  scan_interval: 10
  inputnode: 2
  whitelist:
    - sensor.bedroom_bo_battery_level
emoncms_history:
  api_key: 
  url: 
  scan_interval: 10
  inputnode: 1
  whitelist:
    - sensor.openweathermap_temperature
    - sensor.openweathermap_pressure
    - sensor.openweathermap_humidity

```

it only send to the last node, if i swith them arround it will send to node 2

---

<div class="post-metadata">

**Author:** ![boelle](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/boelle/32/19850_2.png) [@boelle](https://community.openenergymonitor.org/u/boelle)\
**Post date:** [7 September 2021 08:02 UTC](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/22 "2021-09-07T08:02:09Z")

</div>

> <https://github.com/home-assistant/core/issues/55892>
>
> \### The problem
> 
> the config example shows only one node, not how to send to mult…iple node id's
> 
> i tried to just insert the example config twice and that failed
> 
> then i repeated just from input node and down, that resulted in only the last one being sent
> 
> \### What is version of Home Assistant Core has the issue?
> 
> core-2021.9.4
> 
> \### What was the last working version of Home Assistant Core?
> 
> core-2021.9.4
> 
> \### What type of installation are you running?
> 
> Home Assistant OS
> 
> \### Integration causing the issue
> 
> Emoncms history 
> 
> \### Link to integration documentation on our website
> 
> https://www.home-assistant.io/integrations/emoncms\_history/
> 
> \### Example YAML snippet
> 
> \`\`\`yaml
> emoncms\_history:
> api\_key: 
> url: 
> scan\_interval: 10
> inputnode: 2
> whitelist:
> - sensor.bedroom\_bo\_battery\_level
> emoncms\_history:
> api\_key: 
> url: 
> scan\_interval: 10
> inputnode: 1
> whitelist:
> - sensor.openweathermap\_temperature
> - sensor.openweathermap\_pressure
> - sensor.openweathermap\_humidity
> \`\`\`
> 
> 
> \### Anything in the logs that might be useful for us?
> 
> \_No response\_
> 
> \### Additional information
> 
> running the raspberry pi image, not sure if that is called home assistant OS
> 
> 
> i'm at a loss here, not sure if this is a bug, or if the integration simply was only made for one input node
> or if the documentation just miss an example for multiple input nodes
> 
> i have tried on discord and i tried to document things there as good i could and i got hit with breaking the flood rules
> you read the rules once and then forget, on top of that once i'm done using a discord server i leave them (why stay just for the sake of staying when you never read/visit). and my request is now for sure drowned
> 
> so if this is the wrong place to ask let me know precise wherei should repost the above
> 
> as a PS i have posted here also https://community.openenergymonitor.org/t/emoncms-home-assistant/1667/5

it was only made for 1 config so that explains it

@joyrider3774 any chance you will revisit it as some point?

[Next page](https://community.openenergymonitor.org/t/emoncms-home-assistant/1667.md?page=2)
