Page 20 of 22
Re: Controlling Toon [HACKED] from Domoticz
Posted: Friday 16 October 2020 18:53
by Jasper79
These settings?

- Screenshot_20201016-185232_Chrome.png (285.39 KiB) Viewed 1777 times
Re: Controlling Toon [HACKED] from Domoticz
Posted: Friday 16 October 2020 19:00
by madpatrick
Yes. It is for me unclear why it is not working
The trigger “ Tijdelijk” looks valid.
If you breakdown the blocky script with the IF function and at DO only a log function. Do you see the message in your log ?
And then step by step add functions
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 17 October 2020 8:18
by Jasper79
Hi,
Well I'm getting somewhere, When I use the button "Tijdelijk" in Domoticz my script runs.
Now I still can't figure out why it doesn't when changing the setpoint, Changing the setpoint changes the state through the feedback by Toon.
Same when I just use the first DO to write to the log and don't let Domoticz make changes to Toon.
Code: Select all
2020-10-17 08:22:13.524 Status: User: Admin initiated a switch command (128/ToonAutoProgram/Set Level)
2020-10-17 08:22:13.774 Status: Toon Auto Test trigger
2020-10-17 08:22:43.809 (Dummy) Light/Switch (Toon Scenes)
2020-10-17 08:22:43.854 (Dummy) Light/Switch (ToonAutoProgram)
I set the delay to change back to 30 seconds so I can change tabs and wait for it to appea
Below I changed the setpoint from 10 to 11 and you can see it does not say eventsystem triggered
Code: Select all
2020-10-17 08:25:23.434 (Dummy) Thermostat (ToonThermostat)
2020-10-17 08:25:23.723 Status: dzVents: Info: Handling events for: "ToonThermostat", value: "11.00"
2020-10-17 08:25:23.723 Status: dzVents: Info: ------ Start internal script: Toon Setpoint: Device: "ToonThermostat (Dummy)", Index: 127
2020-10-17 08:25:23.724 Status: dzVents: Info: Setting Toon setpoint to 11.0
2020-10-17 08:25:23.724 Status: dzVents: Info: ------ Finished Toon Setpoint
2020-10-17 08:26:00.704 (Dummy) Light/Switch (Toon Scenes)
2020-10-17 08:26:00.740 (Dummy) Light/Switch (ToonAutoProgram)
2020-10-17 08:26:00.281 Status: dzVents: Info: ------ Start internal script: Toon:, trigger: "every minute"
2020-10-17 08:26:00.608 Status: dzVents: Info: ------ Finished Toon
2020-10-17 08:27:00.329 Status: dzVents: Info: ------ Start internal script: Toon:, trigger: "every minute"
2020-10-17 08:27:00.664 Status: dzVents: Info: ------ Finished Toon
2020-10-17 08:28:00.328 Status: dzVents: Info: ------ Start internal script: Toon:, trigger: "every minute"
2020-10-17 08:28:00.648 Status: dzVents: Info: ------ Finished Toon
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 17 October 2020 13:24
by madpatrick
Jasper,
Maybe an other suggetion.
if you use the toon script, maybe it is possible (with help) to adjust the script.
I think that dzvent is more powerfull then blocky.
In the script both function (autoprogram and setpoint) are available.
Code: Select all
-- Update the current temperature setpoint
local currentSetpoint = tonumber(jsonThermostatInfo.currentSetpoint) / 100
local currentTemperature = tonumber(jsonThermostatInfo.currentTemp) / 100
currentTemperature = tonumber(string.format("%.1f", currentTemperature))
-- Update the current auto program
local currentProgramState = tonumber(jsonThermostatInfo.programState)
if currentProgramState == 0 then currentProgramState = 10 -- No
elseif currentProgramState == 1 then currentProgramState = 20 -- Yes
elseif currentProgramState == 2 then currentProgramState = 30 -- Temporary
end
Maybe you can change this with an "AND"function and ".afterMin()"
Re: Controlling Toon [HACKED] from Domoticz
Posted: Sunday 18 October 2020 9:28
by Jasper79
Thanks, That's way beyond my skills.
I do wonder if the silent part could cause the blockly doesn't trigger?
Code: Select all
-- Updates the toon auto program switch
if domoticz.devices(ToonAutoProgram).level ~= currentProgramState then -- Update toon auto program selector if it has changed
-- domoticz.log('Updating Toon Auto Program selector to: '..currentProgramState)
domoticz.devices(ToonAutoProgram).switchSelector(currentProgramState).silent()
end
Re: Controlling Toon [HACKED] from Domoticz
Posted: Sunday 18 October 2020 9:36
by Jasper79
Thanks for pointing me to the toon script and making me try to understand something about it.
I deleted the .silent() and now it does what I wanted.
Code: Select all
-- domoticz.devices(ToonAutoProgram).switchSelector(currentProgramState).silent()
domoticz.devices(ToonAutoProgram).switchSelector(currentProgramState)
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 15:58
by hansaplast31
Hello, I rooted my Toon a couple of days ago and started to follow this thread. Nice scripts, but why oh why use scripts when you can make a native domoticz plugin?
Currently I only cover the basic functionality and only tested it with my Toon (v1). Use at your own risk.
You can clone it from github:
https://github.com/hansaplast26/domoticz-rooted-toon
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 16:27
by madpatrick
hansaplast31 wrote: Saturday 26 December 2020 15:58
Hello, I rooted my Toon a couple of days ago and started to follow this thread. Nice scripts, but why oh why use scripts when you can make a native domoticz plugin?
Currently I only cover the basic functionality and only tested it with my Toon (v1). Use at your own risk.
You can clone it from github:
https://github.com/hansaplast26/domoticz-rooted-toon
Nice addon !
Maybe start sepearate topic for this feature
Has this plugin a backwards communication with the Toon. In other words, if you change a setting on your Toon, does Domoticz get updated ?
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 16:41
by hansaplast31
madpatrick wrote: Saturday 26 December 2020 16:27
Has this plugin a backwards communication with the Toon. In other words, if you change a setting on your Toon, does Domoticz get updated ?
Yes it is bi-directional
There are a couple of advantages to plugins:
- the connection (i.e. http) is handled natively by domoticz itself, which means you will get no script that gets stuck due to some external url calls that get stuck
- in this plugin the heartbeat is set to 5 seconds, which means that domoticz will connect to the Toon every 5 seconds and reads several things, such as:
"/happ_thermstat?action=getThermostatInfo"
"/boilerstatus/boilervalues.txt"
I have not yet implemented the readout of "/hdrv_zwave?action=getDevices.json" as I believe this might be the wrong call to read out electricity and gas readings. "/happ_pwrusage?action=GetCurrentUsage" is probably better, but I am also looking for the readings of todays usage.
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 17:02
by madpatrick
I'll try the script and let you know for any feedback.
The Powerconsumption and Boilerinfo would be great add-ons.
As on the Toon it self, these are also add-ons
-------- Update ----------
Some feedback.
When you change a temparature to a Progam temperature, the program status is not set to this status
For example if you Home temparature is 20°C and you change the Setpoint to 20°C, the Program remains Manual and not Home
With "/boilerstatus/boilervalues.txt" I'm missing :
- boilerSetpoint
- boilerOutTemp
- boilerInTemp
- boilerPressure
- boilerModulationLevel
Is it possible to add those also ?
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 17:34
by hansaplast31
madpatrick wrote: Saturday 26 December 2020 17:02
Some feedback.
When you change a temparature to a Progam temperature, the program status is not set to this status
For example if you Home temparature is 20°C and you change the Setpoint to 20°C, the Program remains Manual and not Home
Thanks for testing!
The plugin does not have intelligence, it just reads back what the Toon has to tell (and interprets that).
I did this test at my home just now, where home is 20.5 C and comfort is 21.0 C
1) Toon is in home mode
2) On domoticz I increase the setpoint from 20.5 to 21.0
3) Result: Auto program goes to Temporary and Program goes to manual
4) On domoticz I set the setpoint back to 20.5
5) Result: Auto program goes to Yes and Program goes back to Home
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 19:44
by hansaplast31
the boilerinfo is in the plugin now.
(if you had the earlier version of the plugin you will need to remove and add the hardware in domoticz for the new device to appear. domoticz is not very good at this).
Re: Controlling Toon [HACKED] from Domoticz
Posted: Saturday 26 December 2020 20:08
by madpatrick
hansaplast31 wrote: Saturday 26 December 2020 19:44
the boilerinfo is in the plugin now.
(if you had the earlier version of the plugin you will need to remove and add the hardware in domoticz for the new device to appear. domoticz is not very good at this).
Thanks
Maybe place plugin.py in the main directory and not in the sub folder RootedToonPlug.
If you install the plugin by git the plugin is not working because of the subfolder.
Re: Controlling Toon [HACKED] from Domoticz
Posted: Sunday 27 December 2020 11:11
by madpatrick
hansaplast31 wrote: Saturday 26 December 2020 17:34
madpatrick wrote: Saturday 26 December 2020 17:02
Some feedback.
When you change a temparature to a Progam temperature, the program status is not set to this status
For example if you Home temparature is 20°C and you change the Setpoint to 20°C, the Program remains Manual and not Home
Thanks for testing!
The plugin does not have intelligence, it just reads back what the Toon has to tell (and interprets that).
I did this test at my home just now, where home is 20.5 C and comfort is 21.0 C
1) Toon is in home mode
2) On domoticz I increase the setpoint from 20.5 to 21.0
3) Result: Auto program goes to Temporary and Program goes to manual
4) On domoticz I set the setpoint back to 20.5
5) Result: Auto program goes to Yes and Program goes back to Home
Probably the Toon has no intelligence to regonize the temperature with a scene.
It should indeed come from the Toon.
In the script there is a work around to read the temperature and set the Toon to the correct scene.
Looks like to Program has a link with the temperature setting and also sets the scene correct.
Re: Controlling Toon [HACKED] from Domoticz
Posted: Sunday 27 December 2020 12:52
by waaren
hansaplast31 wrote: Saturday 26 December 2020 16:41
- the connection (i.e. http) is handled natively by domoticz itself, which means you will get no script that gets stuck due to some external url calls that get stuck
The dzVents openURL command is also handled natively by domoticz.
Re: Controlling Toon [HACKED] from Domoticz
Posted: Sunday 27 December 2020 14:06
by Jasper79
Plugin looks nice, If you start a new thread for this please post the link in this one. New thread will probably make it easier to follow for both developers.
Re: Controlling Toon [HACKED] from Domoticz
Posted: Thursday 18 February 2021 20:22
by Alxxx
Hello,
I am just a beginner in Domoticz and i try to connect my rooted Toon to Domoticz .
The switches are working well, but the temperatures are not shown.
when i use de URL
http://192.168.178.x/happ_thermstat?act ... mostatInfo
the result seems OK
{"result":"ok", "currentTemp":"2112", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"6", "programState":"0", "activeState":"0", "nextProgram":"-1", "nextState":"-1", "nextTime":"0","nextSetpoint":"0","randomConfigId":"1804289383","errorFound":"255","connection":"0","burnerInfo":"0","otCommError":"0","currentModulationLevel":"0"}
What can be wrong
Re: Controlling Toon [HACKED] from Domoticz
Posted: Thursday 18 February 2021 20:28
by madpatrick
If you want have a easy setup you better can you this plugin
viewtopic.php?f=34&t=34986
Otherwise if you to use this script, you need to give more information.
Check all names and uservariables in detail. A misspell is easy made
Re: Controlling Toon [HACKED] from Domoticz
Posted: Thursday 18 February 2021 21:20
by Plantje
I use the Toon api on a non rooted Toon.
https://github.com/JohnvandeVrugt/toona ... TALL_PI.md
Got this in my manual:
Installatie op basis van
https://github.com/JohnvandeVrugt/toona ... TALL_PI.md
• Bestanden van
https://github.com/costastf/toonapilib gedownload
• toonapilib-master geplakt in C:\Program Files\Domoticz\plugins
• Start een command prompt als administrator en voer daar in: pip3 install toonapilib -U (Hier kwam waarschijnlijk door de eerste poging telkens op terug “Requirements already satisfied”)
• Bestanden van
https://github.com/JohnvandeVrugt/toonapilib4domoticz gedownload
• toonapilib4domoticz-master geplakt in C:\Program Files\Domoticz\plugins
• Domoticz service herstart
• In hardware “ToonApiLib als nieuwe hardware toevoegen
Voor de API key (informatie van (
http://www.digitaldomo.nl/homebridge/to ... n-homekit/):
• Ga naar
https://developer.toon.eu/
• Maak een nieuwe app en vul als “App Name” in “Domoticz” en als “Callback URL” een “/”
• Nadat de app is goedgekeurd is er een ‘Consumer Key‘ gegenereerd en hiermee kan een apiToken aangevraagd worden.
•
• Ga naar
https://api.toon.eu/toonapi-accesstoken ... nsumer_key> Waarbij <consumer_key> uiteraard de Consumer_Key van de zojuist gemaakte app is. De apiToken zie je op het scherm nadat je inlogt met je Eneco-gebruikers-account.
• Log in met je Eneco gegevens en er komt een access token terug.
• Deze dient ingevuld te worden bij de nieuwe hardware
Re: Controlling Toon [HACKED] from Domoticz
Posted: Friday 19 February 2021 14:15
by Alxxx
madpatrick wrote: Thursday 18 February 2021 20:28
If you want have a easy setup you better can you this plugin
viewtopic.php?f=34&t=34986
Otherwise if you to use this script, you need to give more information.
Check all names and uservariables in detail. A misspell is easy made
u am trying to use the script i checked the uservariables for at least 10 times made 2 times form scratch new settings.
but the temperature will not show the signal to the toon like home,comfort,away, manual are working OK
So i tryed your plugin but i get error see below.
2021-02-19 14:10:50.529 (TOON@) onMessage aborted, response format not JSON
2021-02-19 14:10:50.529 (TOON@) <?xml version="1.0" encoding="iso-8859-1"?>
2021-02-19 14:10:50.529 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2021-02-19 14:10:50.529 "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2021-02-19 14:10:50.529 <html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
2021-02-19 14:10:50.529 <head>
2021-02-19 14:10:50.529 <title>404 - Not Found</title>
2021-02-19 14:10:50.529 </head>
2021-02-19 14:10:50.529 <body>
2021-02-19 14:10:50.529 <h1>404 - Not Found</h1>
2021-02-19 14:10:50.529 </body>
2021-02-19 14:10:50.529 </html>
2021-02-19 14:10:50.529