anyone using / heard of home assistant ?

Hey,

when i got my hue lights i needed something to control them my first attempt was to use openhab as it seemed the way to go but recently i found out about home assisant https://home-assistant.io/ and i like it more then openhab seems to work better for me for doing automations.

I'm also using home assistant to display feed values from emoncms in home assistant. The way i'm currently doing it is by making emoncms post the feed values i want to mqtt and make home assistant use an mqtt sensor to display the values.

But now that i think of it, it really shouldn't be that hard to create a sensor component for emoncms directly in home assistant. Home assistant uses python, i have never written python but since it's only doing a certain http get api call to emoncms to get a feeds value i think i should be able to create a sensor for it. so that i don't need mqtt anymore.

if i ever do make the sensor for home assistant i'll post a new message to let you guys know. But since i read a bit of openhab here i thought it might be a good idea to let u guys know about home assistant as well

Bramco's picture

Re: anyone using / heard of home assistant ?

Looks interesting - wonder how well it will be supported. 

joyrider3774's picture

Re: anyone using / heard of home assistant ?

it seems i don't need to create a new sensor for emoncms values to display in home assistant.

There are 2, perhaps 3 ways to do it, i only tested 2 ways:

1 *tested*) use mqtt, make emoncms post the feed value to mqtt and use an mqtt sensor in homeassistant to display the values. this works although your database size will growe rapidly depending on how fast you post new values to mqtt

2 *tested*) use a restfull sensor and use the emoncms feed api to call. This won't update the value as often and will thus reduce database size, i think it's updated like once every 30 seconds:

here's an example of the yaml config to make it work:

sensor:

  - platform: rest

    resource: http://192.168.0.101:8083/emoncmsnew/feed/value.json?id=61&apikey=readapikey

    value_template: '{{ value | replace("\"","") | float | round(2) }}'

    method: GET

    name: TEST REST

    unit_of_measurement: "W"

the replace is needed because the feed api returns "value" so between quotes, i then take that value, remove it's quotes convert the string to float and round it at 2 decimals.

For each feed value you want to display you would repeat the above and just change the id=61 which reflects the feed id

3 *not tested*) use a command line sensor in combination with curl and call the feed api url as in example 2

Larsjo's picture

Re: anyone using / heard of home assistant ?

2* is working on my setup. thanks

glyn.hudson's picture

Re: anyone using / heard of home assistant ?

Just discovered Home Assistant, it's quite nice. I have published a blog post and example config to integrate with emonPi

borpin123's picture

Re: anyone using / heard of home assistant ?

Quite like it but usi ng the configuration is not intuative.  They need a graphical or in browser editor.  Prefer this to OpenHab as I don't like Java on the Pi.

joyrider3774's picture

Re: anyone using / heard of home assistant ?

hey if you do a github pull now for hass there's a fix for the rest sensor so you can change the scanning interval. By addin for example scan_interval: 5 and using a rest sensor as explained in one of my previous posts you can query the value every 5 seconds (i use 5 because i send a new value to emoncms every 5 seconds). The default was 30 seconds and couldn't be changed.

I'm still using mqtt for it though but i thought i should mention it here as at least one person mention that method 2 (rest sensor) worked for them

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.