Toon (eneco) integration with Home Assistant

Please check if the following file does exists:
/config/scripts/toonclient.py

@opdoffer, thanks, it is working now! Nice part of home assistant.
Sorry for my questions, python and home assistant is new for me, Every day i learn a lot of it :slight_smile:
Have a nice weekend!

For the dutch people that use the Eneco Toon:
Here the sensor for Gas Usage:

sensor.yaml:

- platform: command_line
  name: Toon_GasUsage
  command: "python /config/scripts/toonclient.py -g -U Username -P Password"
  unit_of_measurement: "M3" 

Groups.yaml:

Eneco Toon:
    - sensor.toon_temp
    - sensor.toon_PowerUsage
    - sensor.toon_GasUsage
    - sensor.toon_Program_State
    - scene.toon_comfort
    - scene.toon_slapen
    - scene.toon_weg
    - scene.toon_thuis

Customize.yaml:

sensor.toon_temp: 
 friendly_name: Temperatuur
 icon: mdi:temperature-celsius
sensor.toon_PowerUsage:
 friendly_name: Watt
 icon: mdi:power
sensor.toon_GasUsage:
 friendly_name: Gasverbruik
 icon: mdi:altimeter
sensor.toon_Program_State:
 friendly_name: Actieve Programma
 icon: mdi:arrow-expand-all 
scene.toon_comfort: 
 friendly_name: Programma Comfort
 icon: mdi:numeric-1-box-outline
scene.toon_slapen: 
 friendly_name: Programma Slapen
 icon: mdi:numeric-2-box-outline
scene.toon_weg: 
 friendly_name: Programma Weg
 icon: mdi:numeric-3-box-outline 
scene.toon_thuis: 
 friendly_name: Programma Thuis
 icon: mdi:numeric-4-box-outline

Than, this is your Eneco Toon front. I know of the wrong value’s of electic and gas. I must sync my eneco adapter again when i am home :slight_smile:

1 Like

Glad that its working :wink:

Many thnx for this. I did not figure this out yet. I will use this and update git. Cheers!

Since the eneco webservice is not accepting more requests than 1 per 3 minutes and hass can only be configured to an update frequency 60 sec max, I use an external script to get updates from eneco toon every 10 minutes and read the output of a file as a sensor. Example can be found here Sensor data from file

This prevents your log from displaying anoying toon sensor errors.

They seem to have released an api now.

https://www.toonapi.com/

2 Likes

oh wow that’s great!

can anyone write something so it can be included in HASS?

1 Like

This Python module is using that api

I Think its not, its based on rvdm’s version which uses the toonopafstand webpage.

The api is released only a few days back.

Aha, than that is really good news! Sorry for the misunderstanding.

1 Like

Will you do an attempt in creating a component for Toon using the api?
Would be great! :slight_smile:
BTW Dutch forum and topic about HASS here: https://gathering.tweakers.net/forum/list_messages/1652294

1 Like

Actually i was already reading the docs about how to make a component. But i’m not a programmer so it might take some Time. But i think i’ll give it a try.

Thnx for the Tweakers link

1 Like

@opdoffer Are you still working on this? I’ve integrated this in my HASS configuration but my gass usage is always “Unknown” and for some strange reason my temperature is not accurate anymore… Do you encounter the same? does this has something to do with the API?

I was checking iT yesterday. I was noticing some problems as well. IT looks like they change some urls. Will work on it, later this week

1 Like

I corrected the gasusage option. IT was a typo in toonclient.py. New version is on github: https://github.com/opdoffer/toon-homeassistant

1 Like

Thnx for all the work you put in this! I really appreciate it…

1 Like

Thx, It is working again!(Y)

Hi all,

Made some optimalizations. I created one sensor and extract the values with a value_template and split it. So you don’t need mupltiple sensors and this prevent to much errors in your log of timeing out to the eneco webserver (since it doesn’t allow to may requests)

See example below (also updated on github).

sensor:

  • platform: command_line
    name: toon
    command: “python /home/pi/.homeassistant/scripts/toonclient.py -t -p -g -c -U -P ”
  • platform: template
    sensors:
    toontemp:
    value_template: ‘{{ states.sensor.toon.state.split(“\n”)[0] }}’
    toonpowerusage:
    value_template: ‘{{ states.sensor.toon.state.split(“\n”)[1] }}’
    toongasusage:
    value_template: ‘{{ states.sensor.toon.state.split(“\n”)[2] }}’
    toonprogramm:
    value_template: ‘{{% if states.sensor.toon.state.split(“\n”)[3] == “0” %}Comfort{% elif states.sensor.toon.state.split(“\n”)[3] == “1” %}Home{% elif states.sensor.toon.state.split(“\n”)[3] == “2” %}Sleep{% elif states.sensor.toon.state.split(“\n”)[3] == “3” %}Away{% endif %} }’
2 Likes

@opdoffer thnx for the update!