Toon van Eneco custom component

Any idea ?

I’m running a hass.io Docker instance on ubuntu 18.04

installed the custom component as described at github page,
placed al python scripts in /config/custom_components/toon/,
added the following config to my configuration.yaml:
toon: username: YOUR_USERNAME password: YOUR_PASSWORD consumer_key: API_CONSUMER_KEY consumer_secret: API_CONSUMER_SECRET tenant: eneco
when I try to validate the config, it says:
Invalid config for [toon]: [username] is an invalid option for [toon]. Check: toon->toon->username. (See /config/configuration.yaml, line 31). Please check the docs at https://home-assistant.io/components/toon/
its a non-rooted device.

I have the same, but running home assistent in a python venv.

Did you solved it already?

1 Like

Hello guys,

I integrated Toon successfully, but can’t get an automatic card view on my ‘overview’ page that shows Toon information. I think because I modified UI using Lovelace, I guess.
Can anyone provide me a snippet configuration I can add in Configuration.yaml to show Toon specific information?
Thanks!

I’m a noob, so sorry for the simple questions.

What do you mean? Just create a new thermostat card from the three dot menu on the upper right and choose a thermostat card

1 Like

I did a lot of testing but dont get it to work…

- id: '1575627130623'
  alias: Verwarming aan bij beweging
  description: ''
  trigger:
  - device_id: 0915b01014d5483a9f8b9b092bbcd16f
    domain: binary_sensor
    entity_id: binary_sensor.hue_motion_sensor_1_motion
    platform: device
    type: motion
  condition:
  - condition: state
    entity_id: climate.toon_thermostat
    state: away
  action:
  - data:
      entity_id: climate.toon_thermostat
      preset_mode: comfort
    service: climate.set_preset_mode

when I remove the condition it works. But I cannot get the condition right.
I tried state: away, Away, ‘away’, ‘Away’, weg, Weg, ‘weg’, ‘Weg’,

I’m only using Node Red so i can’t help you but do you really need a condition like this?

You want to set the thermostat when there is movement. State of the thermostat is not necessary as a condition. Time is i think!

conditions:
  - condition: template
    value_template: "{{ state_attr('climate.toon_thermostat', 'away') }}"

The thing is that I use the normal scedule from the toon thermostat. At day time it is set to “away”. But when someone is at home (motion detected) the thermostat should be set to home.

Unfortunately not working. Where can I find this template files?
(just started whith HA and I have not worked with templates yet)

I definately need help. Still can’t manage to get the state from Toon.

I also tried with NodeRed. I can get the state, but only if the programm is on or of, and the heat or cool mode. But still not the current preset mode (home, away, comfort, sleep)

Which ‘attributes’ do you see when looking in ‘Developer tools > States’ and filter with “climate.”.

image

It is important that you use one of the ‘preset_modes’ under ‘attributes’ instead of the ‘state’ of the ‘entity’.
Therefore you have to filter out the ‘state_attr’ by using ‘template’ as ‘condition type’ in your Automations, assuming you are using the ui by the looks of your yaml code.

image

- id: '1577622829397'
  alias: test climate
  description: ''
  trigger:
  - device_id: 7ea782ea844848acb1f207bd5dd6dae8
    domain: binary_sensor
    entity_id: binary_sensor.living_motion
    platform: device
    type: motion
  condition:
  - condition: template
    value_template: '{{ state_attr("climate.toon_thermostat", "away") }}'
  action:
  - data:
      preset_mode: home
    entity_id: climate.toon_thermostat
    service: climate.set_preset_mode

Attributes are almost equal:

Conditions also:

And my automation:

- id: '1575627130623'
  alias: Verwarming aan bij beweging
  description: ''
  trigger:
  - device_id: 0915b01014d5483a9f8b9b092bbcd16f
    domain: binary_sensor
    entity_id: binary_sensor.hue_motion_sensor_1_motion
    platform: device
    type: motion
  condition:
  - condition: template
    value_template: '{{ state_attr("climate.toon_thermostat" , "away") }}'
  action:
  - data:
      entity_id: climate.toon_thermostat
      preset_mode: home
    service: climate.set_preset_mode

But still not working…

Silly question maybe… Did you reload Automations or reboot HA after saving?

Or have you checked if the ‘preset_mode’ changes in ‘Developer tools’?

Yes, good point, but I do reload automations or restart HA after any edit.

The preset_mode in developer tools don’t change if I trigger the automation.
But the preset mode does change if I change the preset on the thermostat itself.

Maybe a silly question from me about this code. '{{ state_attr("climate.toon_thermostat", "away") }}'
But how does it know that it has to look for “away” as a preset_mode, and not as one of the other attributes of climate.toon_thermostat?

Or is there any way that I can see a log when I trigger the automation? O

I may have made a mistake

Try {{ is_state_attr('climate.toon_thermostat','preset_mode','away') }} instead and test it in ‘Developers tools > template’. If this works then put this in the yaml:

 condition:
      - condition: template
        value_template: >
          {{ is_state_attr('climate.toon_thermostat','preset_mode','away') }}

Great!! That works :grinning:
Thanx a lot :+1:

1 Like

I have a rooted Toon1, with the latest update. But I get error with the install of TOON Climate via HACS. What am I doing wrong? Do I have to check something on TOON itself?

climate:
  - platform: toon_climate
    name: TOON Thermostat
    host: 192.168.123.9
    port: 10080
    scan_interval: 10
Logboekdetails ( ERROR )
Sat Jan 04 2020 16:43:40 GMT+0100 (Midden-Europese standaardtijd)
Error while setting up platform toon_climate
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 164, in _new_conn
    % (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7fb0d9906b10>, 'Connection to 192.168.123.9 timed out. (connect timeout=5)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.123.9', port=10080): Max retries exceeded with url: /happ_thermstat?action=getThermostatInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fb0d9906b10>, 'Connection to 192.168.123.9 timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/toon_climate/climate.py", line 68, in setup_platform
    config.get(CONF_PORT))])
  File "/config/custom_components/toon_climate/climate.py", line 90, in __init__
    self.update()
  File "/config/custom_components/toon_climate/climate.py", line 119, in update
    '/happ_thermstat?action=getThermostatInfo'))
  File "/config/custom_components/toon_climate/climate.py", line 95, in do_api_request
    req = requests.get(url, timeout=DEFAULT_TIMEOUT)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.123.9', port=10080): Max retries exceeded with url: /happ_thermstat?action=getThermostatInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fb0d9906b10>, 'Connection to 192.168.123.9 timed out. (connect timeout=5)'))

I have the automation running fine in NodeRed for some time now. But I would like to add an action to turn on and off the programm of the Toon thermostat itself. Here is the reason why.

The Thermostat is programmed with this scedule:
7.00 --> home
8.00 --> away
17.00 --> home
20.00 --> comfort

Sometimes someone is home between 8.00 and 17.00. Therefore I made my automation to check for motion and if the Toon is set to away. In that case the automation overrules the Toon program and set the preset mode to “home”. After half an our, the preset mode will be set back to away.

My problem: If someone is home close to 17.00, the thermostat will be set to home. But the automation will set this back to away half an our later (after 17.00). Therefor the thermostat misses the change of setpoint from its own programm (to “home” at 17.00) and stays at away.

I know I can solve this with making time scedule in NodeRed that equals the Toon thermostat programm. But than I have to adjust this scedule in two places every time.

Much easier will be to turn of the Toon programm for a minute, and than turn it back on. Then Toon will be set to the needed setpoint at that time. This works with the on/off switch screen on the Toon screen.

The problem is that I don’t know how to turn on and off the programm in home assistant.

Anybody knows how to do that?

is anyone else using the normal (built in HA) component and receiving this error on HA boot?

TargetHeatingCoolingState: value=0 is an invalid value

i have a new toon (v2?) would like to get it to work. But in integration i click Toon then username pasword tenant )eneco) en no go… I got a msg in red that this user/pass is incorect?
I know for sure i put the right info in there.

Anyone else got this problem?