Toon van Eneco custom component

Thanks for your reply, hopefully you can assist me a bit more in the good direction.

:slight_smile:

Yeah, sorry for my short reply. I was starting to type a bit more explanation but realized that I didn’t have time to finish it :sweat_smile: Anyway, what a sensor template does is taking a state attribute of an entity in HA and turn it into a sensor. If you add code similar to the example on the component page and replace the state.whatever part between the {{ }} with the state attribute of the Toon component you’re good to go. But can you tell a bit more about where you need assistance specifically?

This is what i currently have for my Eneco Toon:

See below for the configuration. I’m am still looking for a way to increase/decrease the temperature manually so if anyone knows how to get that done please post a reply !

configuration.yaml:

toon:
    username: mytoonusername
    password: mytoonpassword

Customize:

  climate.toon_van_eneco:
    friendly_name: Temperatuur Toon
    icon: mdi:temperature-celsius
  sensor.power_current:
    friendly_name: Huidige Stroom
    icon: mdi:power
  sensor.power_today:
    friendly_name: Totaal Stroom Vandaag
    icon: mdi:power
  sensor.gas_current:
    friendly_name: Huidig Gas
    icon: mdi:gas-cylinder
  sensor.gas_today:
    friendly_name: Totaal Gas Vandaag
    icon: mdi:gas-cylinder

Scenes:

  - name: Toon Comfort
    entities:
      climate.toon_van_eneco:
          operation_mode: Comfort

  - name: Toon Slapen
    entities:
      climate.toon_van_eneco:
          operation_mode: Sleep

  - name: Toon Thuis
    entities:
      climate.toon_van_eneco:
          operation_mode: Home

  - name: Toon Weg
    entities:
      climate.toon_van_eneco:
          operation_mode: Away 

Groups:

default_view:
  view: yes
  entities:
    - group.weer
    - group.toon

weer:
  name: 'Weer'
  entities:
    - sensor.eindhoven_temperature
    - sensor.eindhoven_pressure
    - sensor.eindhoven_humidity
    - sensor.eindhoven_precipitation_forecast_total
    - sensor.eindhoven_symbol
    - sensor.eindhoven_visibility
    - sensor.eindhoven_wind_force
    - sensor.eindhoven_wind_direction
    - sensor.eindhoven_wind_gust

toon:
  name: 'Eneco Toon'
  entities:
    - climate.toon_van_eneco
    - sensor.power_current
    - sensor.power_today
    - sensor.gas_current
    - sensor.gas_today
    - scene.Toon_Thuis
    - scene.Toon_Slapen
    - scene.Toon_Weg
    - scene.Toon_Comfort  

Thanks again for your reply. No worries!

I think the problem is that I just started and not really now how create a sensor from my Toon temperature.
I can follow the “Template Sensor” but to make to make like a temperature sensor from the Toon there it goes wrong.

Something like this. but not sure about that value template :slight_smile:

  - platform: template
    sensors:
      sensor.toon_temp:
      value_template: '{{ current_temperature }}'
      friendly_name: 'Woonkamer Temperatuur"
      unit_of_measurement: 'graden'

Couple of things:

  1. Where you say “sensor.toon_temp:” is where you set a name for your sensor. You can leave the “sensor.” out, since HA knows that you’re using “platform: template” and one line below “sensors:”. So just say “toon_temp” there or anything else that you like and isn’t already used elsewhere. Once everything works, HA automatically turns this code into “sensor.toon_temp” to use in automations and other stuff.
  2. The lines following the “toon_temp:” line should be indented two spaces. If you later want to add another sensor using a sensor template, you declare it’s name on the same indent as “toon_temp” so HA knows how to distinguish.
  3. What to put in between the value_template brackets can be found on the states tab in HA. If you go to HA in the browser, there are 5 or 6 six icons below on the left menu bar. Look for the “< >”, click there. Here you see all the entities that are known by your HA instance. Find the toon component that has the temp attribute you’re looking for. There you have the info you need. The value template needs something like states.[toon].attributes.[temperature] where [toon] is replaced by the name of the entity in the left column and [temperature] by the name of the temp attribute in the right column. I currently am in the proces of redoing my entire HA setup so I can’t look for myself what the values are. If you have difficulties figuring out what to put in the value template, post a screenshot of the toon entity in the states tab.

Good luck!

1 Like

Never made a template before but with the information allready put together by Imperial-Guard and Michiel this works for me. It creates 2 sensors:

  • sensor.toon_target_temperature
  • sensor.toon_current_temperature
- platform: template
  sensors:
    toon_target_temperature:
      value_template: '{{ states.climate.toon_van_eneco.attributes.temperature }}'
      friendly_name: 'Doel Temperatuur'
      unit_of_measurement: '°C'
    toon_current_temperature:
      value_template: '{{ states.climate.toon_van_eneco.attributes.current_temperature }}'
      friendly_name: 'Huidige Temperatuur'
      unit_of_measurement: '°C'
2 Likes

Great thanks!

Really appreciate all the support here! :slight_smile:

Got more understanding now how to create sensors!

1 Like

Anyone?

Now that Eneco is raising the monthly costs to use Toon externally I’m very interested in knowing if anyone could get the Toon component working with Hass without needing the Eneco Toon subscription.
I only have this subscription of 4,50 euro’s per month to be able to interact with Toon externally. So if in any way we can get it working without that subscription I can save 54,- euro per year.

Hey @PuckStar, I think Eneco is raising the costs accross the board, supposedly so that they can add these great new features, but I think more to add to their bottom line. Very annoying. Check this out though, cyberjunky created a way to add a rooted Toon to Home Assistant. Not sure if you want to go that far, but I think it’s the only way to get around the subscription fee:

https://github.com/cyberjunky/home-assistant-custom-components/blob/master/climate/toon.py

just installed hass.io and playing around.

I can’t find the custom_component folder in hass.io’s config folder. Do i have to create this folder?

Yes I had the same with the hassbian image install.
Just create the folder manually.

1 Like

Thanks, will do

Done… but now hass will not boot… this is because i have this in my configuration.yaml:

toon:
    username: mytoonusername
    password: *mytoonpassword

my password starts with a * and somehow yaml doesn’t except this.
yaml validator: (): did not find expected alphabetic or numeric character while scanning an alias at line 73 column 15

try to put ’ around your password, or "

so ‘*mytoonpassword’
or “*mytoonpassword”

otherwise change the password at Eneco to be without a * :slight_smile:

I now quoted my password like this: “*mytoonpassword” and hass.io boots but i get an invalid config on the Home screen.

image

in the log:

2017-09-03 22:53:10 ERROR (MainThread) [homeassistant.setup] Error during setup of component toon
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/toon.py", line 39, in setup
    from toonlib import InvalidCredentials
ModuleNotFoundError: No module named 'toonlib'

try to restart Hass a few times. maybe then the install will work. if not post again though I don’t think I can help you then and we’ll need to ask krocat.

1 Like

Thanks for your help PuckStar! I guess it needs to be fixed in the script. But i will try few times… but first get some sleep, first day at work tommorow after the vacation :sweat_smile:

Well, i have changed my passsword and now i get some new errors:

2017-09-04 12:28:11 ERROR (MainThread) [homeassistant.setup] Error during setup of component toon
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/toon.py", line 47, in setup
    solar)
  File "/config/custom_components/toon.py", line 82, in __init__
    self.update()
  File "/config/custom_components/toon.py", line 106, in update
    float(plug.daily_usage) / 1000, 2),
TypeError: float() argument must be a string or a number, not 'NoneType'
2017-09-04 12:28:15 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds.
2017-09-04 12:28:16 WARNING (MainThread) [homeassistant.setup] Setup of light is taking over 10 seconds.
2017-09-04 12:28:17 WARNING (MainThread) [homeassistant.setup] Setup of tts is taking over 10 seconds.

@krocat and @costas
i have opened an issue on github.

@PuckStar are you on hassbian? Is it still working? Or am I missing something? Can you share me your files for toon? I thought maybe there were changes in the script.

Great work guys! Not sure how stable this is but love it so far.