Start with the basics, how to read out Toon and create a switch.marktn wrote:Maybe a good wiki is an idea? I see a lot in this post. But don´t know where to start.
send from tapatalk app.
Toon Energy Readings on Domoticz Topic is solved
Moderator: leecollings
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: Toon Energy Readings on Domoticz
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
-
- Posts: 15
- Joined: Friday 01 May 2015 19:27
- Target OS: Linux
- Domoticz version: 3.5305
- Location: The Netherlands
- Contact:
Re: Toon Energy Readings on Domoticz
my script "script_variable_verwarming.lua" looks like this:gielie wrote: Could you post the complete code and the name of your switches so I can compare.
Code: Select all
local toonState = 'varToonState'
local toonScene = 'varToonScene'
local toonSwitch= 'toonScenes'
commandArray = {}
if uservariablechanged[toonState] then
if uservariables[toonState] == 0 then
commandArray['Variable:' .. toonScene] = tostring('Comfort')
commandArray[toonSwitch]='Set Level 40'
print('Toon ingesteld op scene Comfort')
elseif uservariables[toonState] == 1 then
commandArray['Variable:' .. toonScene] = tostring('Thuis')
commandArray[toonSwitch]='Set Level 30'
print('Toon ingesteld op scene Thuis')
elseif uservariables[toonState] == 2 then
commandArray['Variable:' .. toonScene] = tostring('Slapen')
commandArray[toonSwitch]='Set Level 20'
print('Toon ingesteld op scene Slapen')
elseif uservariables[toonState] == 3 then
commandArray['Variable:' .. toonScene] = tostring('Weg')
commandArray[toonSwitch]='Set Level 10'
print('Toon ingesteld op scene Weg')
elseif uservariables[toonState] == 4 then
commandArray['Variable:' .. toonScene] = tostring('Overig')
commandArray[toonSwitch]='Set Level 0'
print('Toon ingesteld op scene Overig')
end
end
return commandArray
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Toon Energy Readings on Domoticz
gielie wrote:
Its not working, what is wrong?
Could you post the complete code and the name of your switches so I can compare.
Sorry for my delay... I didn't post the full script in the previous post because i thought it was kinda easy to figure it out. I am just starting with lua and wanted the script to be cofigurable so anyone can use it...
so here it is:
Code: Select all
-- script_time_toonselector.lua
-- Reads the Toon Thermostat Setpoint Temperature and updates the
-- selector in Domoticz to represent the current Active State.
-- Off scene is an option, leave it out if not needed.
-- Action commands wil not be executed.
commandArray = {}
-- Settings: Configure as desired
-- Name of the switch with the temperature setpoint.
ThermostatSetPointName = 'Room Setpoint'
-- Temperature SetPoints.
HomeSetPoint = '20.50'
ComfortSetPoint = '21.00'
SleepSetPoint = '19.00'
AwaySetPoint = '17.50'
OffSetPoint = '6.00' --optional
-- Name of the selector for Toon
ToonSelector = 'Toon scenes'
-- Name of the levels in the selector
HomeLevel = 'Home'
ComfortLevel = 'Comfort'
SleepLevel = 'Sleep'
AwayLevel = 'Away'
OffLevel = 'Off' --optional
-- Values from each level name
HomeLevelValue = '30'
ComfortLevelValue = '40'
SleepLevelValue = '20'
AwayLevelValue = '10'
OffLevelValue = '0' --optional
-- End of settings
-- Toon Thermostat SetPoint:
ThermostatSetPoint = otherdevices_svalues[ThermostatSetPointName]
if (ThermostatSetPoint == HomeSetPoint) then
--print("SetPoint equals to Home");
if (otherdevices[ToonSelector] ~= HomeLevel) then
print("Updating '" .. ToonSelector .. "' selector to '" .. HomeLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..HomeLevelValue
end
elseif (ThermostatSetPoint == ComfortSetPoint) then
--print("SetPoint equals to Comfort");
if (otherdevices[ToonSelector] ~= ComfortLevel) then
print("Updating '" .. ToonSelector .. "' selector to '" .. ComfortLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..ComfortLevelValue
end
elseif (ThermostatSetPoint == SleepSetPoint) then
--print("SetPoint equals to Sleep");
if (otherdevices[ToonSelector] ~= 'Sleep') then
print("Updating '" .. ToonSelector .. "' selector to '" .. SleepLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..SleepLevelValue
end
elseif (ThermostatSetPoint == AwaySetPoint) then
--print("SetPoint equals to Away");
if (otherdevices[ToonSelector] ~= 'Away') then
print("Updating '" .. ToonSelector .. "' selector to '" .. AwayLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..AwayLevelValue
end
-- Optional
elseif (ThermostatSetPoint == OffSetPoint) then
--print("SetPoint equals to Off");
if (otherdevices[ToonSelector] ~= 'Off') then
print("Updating '" .. ToonSelector .. "' selector to '" .. OffLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..OffLevelValue
end
end
return commandArray
Screenshot:

-
- Posts: 4
- Joined: Sunday 30 August 2015 22:18
- Target OS: NAS (Synology & others)
- Domoticz version: 2.4031
- Location: Rotterdam, The Netherlands
- Contact:
Re: Toon Energy Readings on Domoticz
Still can't figure out what is wrong. If i check the line it looks likes i didn't get any response from Toon.marcoheijkoop wrote:I'm getting this error when following above steps
Code: Select all
Traceback (most recent call last): File "/usr/local/domoticz/var/scripts/toon2domoticz.py", line 33, in <module> state = toon.get_program_state() File "/usr/lib/python2.7/site-packages/Toon.py", line 108, in get_program_state self.retrieve_toon_state() File "/usr/lib/python2.7/site-packages/Toon.py", line 72, in retrieve_toon_state raise Exception('Incomplete response') Exception: Incomplete response
But i can't figure out why. If i login on Toon op Afstand everything looks fine
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Toon Energy Readings on Domoticz
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.
Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0
I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!
What is going wrong?
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: Toon Energy Readings on Domoticz
I get that error once in a while too. It's just eneco's crap server. They go down sometimes...marktn wrote:Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.
Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0
I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!
What is going wrong?
Just got one btw...

Re: RE: Re: Toon Energy Readings on Domoticz
Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switchkurniawan77 wrote:I get that error once in a while too. It's just eneco's crap server. They go down sometimes...marktn wrote:Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.
Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0
I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!
What is going wrong?
Just got one btw...
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.marktn wrote:Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switchkurniawan77 wrote:I get that error once in a while too. It's just eneco's crap server. They go down sometimes...marktn wrote:
Thanks for the wiki link! That helps a lot.
With http://192.168.1.9:7979/json.htm?type=c ... 01&state=0 i can switch my toon.
Only with the virtual switch under domoticz, it doesn't work,
https://www.dropbox.com/s/nfypq3dmyd3sl ... 5.png?dl=0
I do see a error:
2016-03-01 19:36:45.071 Error: ToonThermostat: Error getting current state!
What is going wrong?
Just got one btw...
Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
kurniawan77 wrote:That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.marktn wrote:Thanks! But it also doensn't switch. When i paste the link in my browsers it works, only not in domoticz with a virtual switchkurniawan77 wrote: I get that error once in a while too. It's just eneco's crap server. They go down sometimes...
Just got one btw...
I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
Why is your idx in the last post 3901 and in this one 4305?
[/quote]marktn wrote:kurniawan77 wrote: That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.
I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?
4305 is the virtual switch. The level set 30% is normal?
[/quote]kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?
marktn wrote:kurniawan77 wrote: That's strange, if it works in a browser then it should work in Domoticz, it does the same... Might try changing the IP to 127.0.0.1. Otherwise it's just a coincidence... You could check on eneco's forum for any info of the server being down or not.
I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
Yep, that level 30 homemarktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?
kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?
marktn wrote:
I have changed the ip adress but no succes. I can give you access to domoticz? Maybe a setting that is wrong.
Is this normal?
In the browser it works, then a problem at eneco is not possible.
https://www.dropbox.com/s/h37h3942zv6md ... 6.png?dl=0
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Toon Energy Readings on Domoticz
Is your selector protected?
Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
Any other ideas to get it work? I can give you access to domoticz!?kurniawan77 wrote:Yep, that level 30 homemarktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?
kurniawan77 wrote:Why is your idx in the last post 3901 and in this one 4305?
send from tapatalk app.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
I could give it a try... Beloof niksmarktn wrote:Any other ideas to get it work? I can give you access to domoticz!?kurniawan77 wrote:Yep, that level 30 homemarktn wrote:https://www.dropbox.com/s/6ks7yab3wj9ow ... 7.png?dl=0
4305 is the virtual switch. The level set 30% is normal?
send from tapatalk app.
Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
kurniawan77 wrote:I could give it a try... Beloof niksmarktn wrote:Any other ideas to get it work? I can give you access to domoticz!?kurniawan77 wrote: Yep, that level 30 home
send from tapatalk app.
See PM
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 46
- Joined: Wednesday 21 January 2015 20:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: RE: Re: Toon Energy Readings on Domoticz
Nailed it!!! Issue solved by configuring your local IP addresses in settings (no username and password)marktn wrote:kurniawan77 wrote:I could give it a try... Beloof niksmarktn wrote: Any other ideas to get it work? I can give you access to domoticz!?
send from tapatalk app.
See PM

Re: Toon Energy Readings on Domoticz
Thanks for helping!
send from tapatalk app.
send from tapatalk app.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: Toon Energy Readings on Domoticz
Great thanks, i finaly got it working.kurniawan77 wrote:gielie wrote:
Its not working, what is wrong?
Could you post the complete code and the name of your switches so I can compare.
Sorry for my delay... I didn't post the full script in the previous post because i thought it was kinda easy to figure it out. I am just starting with lua and wanted the script to be cofigurable so anyone can use it...
so here it is:
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
Who is online
Users browsing this forum: No registered users and 1 guest