Please see @opdoffer 's post above. Basically you need to place the files from @krocat ToonHA github inside the appropriate structure of your custom_components. toonlib should have nothing to do with it, it is handled transparently from HA as a dependency. So clone ToonHA and move the toon.py files to the appropriate location.
@krocat wouldnāt it be easier for people to deploy and try out the component if you renamed the directories to lower case and then people could just git clone the whole project in the custom_component directory?
Yes, that is a bit silly isnāt it. Not sure if I can work on it tonight, so feel freeto change it if you have time. Iāve created a new branch for the smoke detector code btw
haha. with your latest reply I thought of renaming to lowercase.
yesterday the uppercase seemed to work (at least, until the point of the error I provided earlier).
changed to lowercase andā¦tada itās working!
what would be nice (but maybe I can find a way myself) if if I can have buttons for each preset like Comfort, Home etc.
But thanks a lot guys! Great work!
Let me know what testing I can do. At least Iāll keep it running and report any issues.
Iāve been following your work with great interest and despite my little rant a couple of weeks ago, I havenāt yet traded my Toon for another thermostat. Since this is working quite well now, Iāve decided to implement the programming into HA instead of the Toon itself. One advantage is that Iām able to link the Toon setting to my āVacation Switchā, that triggers a whole set of away settings. I thought it might be interesting to share
Toon Scenes:
###############################################
## Toon Programma Standaard
###############################################
- name: Toon Programma Standaard
entities:
automation.toon_einde_avond_programma_slapen:
state: on
automation.toon_ochtend_programma_thuis:
state: on
###############################################
## Toon Programma Werkdag
###############################################
- name: Toon Programma Werkdag
entities:
automation.toon_thuisdag_ochtend_programma_comfort:
state: off
automation.toon_werkdag_programma_away:
state: on
automation.toon_werkdag_programma_thuis:
state: on
automation.toon_werkdag_avond_programma_comfort:
state: on
###############################################
## Toon Programma Thuisdag
###############################################
- name: Toon Programma Thuisdag
entities:
automation.toon_thuisdag_ochtend_programma_comfort:
state: on
automation.toon_werkdag_programma_away:
state: off
automation.toon_werkdag_programma_thuis:
state: off
automation.toon_werkdag_avond_programma_comfort:
state: off
###############################################
## Toon Programma Vakantie / Afwezig
###############################################
- name: Toon Programma Vakantie
entities:
automation.toon_thuisdag_ochtend_programma_comfort:
state: off
automation.toon_werkdag_programma_away:
state: off
automation.toon_werkdag_programma_thuis:
state: off
automation.toon_werkdag_avond_programma_comfort:
state: off
automation.toon_einde_avond_programma_slapen:
state: off
automation.toon_ochtend_programma_thuis:
state: off
Toon Automations:
#############################################
## Trigger programma werkdag
#############################################
- alias: 'Toon werkdag inschakelen'
trigger:
- platform: time
after: "00:01:00"
condition:
condition: time
weekday:
- mon
- tue
action:
- service: scene.turn_on
entity_id: scene.toon_programma_werkdag
#############################################
## Trigger programma thuisdag
#############################################
- alias: 'Toon thuisdag inschakelen'
trigger:
- platform: time
after: "00:01:00"
condition:
condition: time
weekday:
- wed
- thu
- fri
- sat
- sun
action:
- service: scene.turn_on
entity_id: scene.toon_programma_thuisdag
#############################################
## Standaard Ochtend, Programma Thuis
#############################################
- alias: 'Toon Ochtend Programma Thuis'
trigger:
- platform: time
after: "06:00:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Home
#############################################
## Standaard Einde avond, Programma Slapen
#############################################
- alias: 'Toon Einde Avond Programma Slapen'
trigger:
- platform: time
after: "23:00:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Sleep
#############################################
## Werkdag Programma Away
#############################################
- alias: 'Toon Werkdag Programma Away'
trigger:
- platform: time
after: "08:00:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Away
#############################################
## Werkdag Thuiskomen Programma Thuis
#############################################
- alias: 'Toon Werkdag Programma Thuis'
trigger:
- platform: time
after: "17:00:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Home
#############################################
## Werkdag Avond Programma Comfort
#############################################
- alias: 'Toon Werkdag Avond Programma Comfort'
trigger:
- platform: time
after: "18:30:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Comfort
#############################################
## Thuisdag Ochtend Programma Comfort
#############################################
- alias: 'Toon Thuisdag Ochtend Programma Comfort'
trigger:
- platform: time
after: "10:00:00"
action:
- service: climate.set_operation_mode
data:
entity_id: climate.toon_van_eneco
operation_mode: Comfort
Vacation setting (based on input_boolean called āvakantie_automation_inschakelenā):
Hi all and I hope everyone had a great time. Due to a probably faulty powerplug I use to connect my server to the internet I cannot get to the point where I am disconnected from eneco with a deauthentication so I can fix it. My powerline keeps disconnecting my server for a few seconds every day so I get a resolving exception and a crash. Anyone using the latest ToonHA that depends on toonlib 0.5.0 care to post the exception upon deauthentication so I can fix that and be done with it so we can try to push this to HA mainline? Thanks in advance to anyone willing to help.
@krocat i have pushed some changes to the smokedetector branch that fixes some things. I donāt thing that stuff worked before. Whenever you can give it a spin to try it out and if everything works for you merge on master. And have a great day!
I gathered some errors I saw in my log file last days. Is the error you are looking for in there?
17-04-26 20:53:58 ERROR (Thread-3) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: 85e6acbc-36e8-486f-b449-aef69f22131a", "errorCode": "500" }
17-04-26 20:53:58 ERROR (Thread-3) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-04-27 14:57:25 ERROR (Thread-5) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: 2c6d7cd5-2e78-4137-b397-7584a26ad2ad", "errorCode": "500" }
17-04-27 14:57:25 ERROR (Thread-5) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-04-27 22:08:58 ERROR (Thread-9) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: fd6be95f-72e9-47e4-a2ad-ad2c927714f8", "errorCode": "500" }
17-04-27 22:08:58 ERROR (Thread-9) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-04-29 23:11:24 ERROR (Thread-11) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: 385b4bc1-e9d7-46a4-888a-c78435921f6a", "errorCode": "500" }
17-04-29 23:11:24 ERROR (Thread-11) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-04-30 00:02:24 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.toon_van_eneco is taking over 10 seconds.
17-04-30 00:28:33 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.gas_current is taking over 10 seconds.
17-05-01 03:18:22 ERROR (Thread-8) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: f0ab7411-5f59-44d2-99f2-a7841a3e2419", "errorCode": "500" }
17-05-01 03:18:22 ERROR (Thread-8) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-05-01 05:31:06 ERROR (Thread-5) [toonlib.Toon]
Status Code :404
Text :<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
17-05-01 05:31:06 ERROR (Thread-5) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-05-01 07:03:13 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.toon_van_eneco is taking over 10 seconds.
17-05-01 08:05:04 ERROR (Thread-4) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: f0ab7411-5f59-44d2-99f2-a7841a3e2419", "errorCode": "500" }
17-05-01 08:05:04 ERROR (Thread-4) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
@PuckStar, yeap, that is it. Although I was hoping for something more explicit on their side that the session is closed or something. This is quite genericā¦ Anyway, I will see what I can do with itā¦ Hold on people this is going to be a busy week for me so not sure how much time I can put into this. I can definitely say that this is going to be fixed by the end of next week though. Till then just restart your instances. @PuckStar thanks a lot for your help!
Youāre welcome. Itās nice to see people picked up this Toon component again. I was afraid it would still take a long time before having Toon in HASS. So Iām happy to see itās going faster
Can I change any log level to generate more detailed logs?
This is how I currently have it:
logger:
default: info
logs:
homeassistant.components.automation: info
homeassistant.components.scripts: info
homeassistant.components.device_tracker: error
homeassistant.components.http: error
homeassistant.core: error
@costas, it is good to see you back. I was under the weather for a couple of days, so you didnāt miss much. I think I resolved the conflict and created a Pull request to merge everything back into master. Can you review the PR? Once we merge we should have full smoke detector support, although we are still waiting for @PuckStar to wave a burning paper under his detectors to see what happens in the api when an alarm is triggered