Hi GUys,
hope that you can help me.
i added Toon to domoticz. but i cannot get the scenes working. when i select comfort it keeps flipping back to weg (away). But when i perform the json call bij hand in the browser it just works...does anybody know how to slove this?
i configured the following:
Setpoint:

- toon2.png (2.46 KiB) Viewed 3397 times
Toon Scens:
see attachement and picture bellow:

- toon4.jpg (131.37 KiB) Viewed 3397 times
error:
2018-02-27 13:40:40.147 Error: Error opening url:
http://xx.xx.xx.xx:8080/json.htm?type=c ... =5&state=0
(i replaces the ip bi xx.xx.xx.xx)
lua script
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 will not be executed.
commandArray = {}
-- Settings: Configure as desired
-- Name of the switch with the temperature setpoint.
ThermostatSetPointName = 'Thermostaatinstelling' --Must match the name of you SetPoint device
-- Temperature SetPoints.
OffSetPoint = '6.00' --optional
AwaySetPoint = '16.50'
SleepSetPoint = '17.00'
HomeSetPoint = '19.00'
ComfortSetPoint = '20.00'
-- Name of the selector for Toon
ToonSelector = 'Thermostaat' --Must match (including case) the name of your Selector Switch
-- Name of the levels in the selector
OffLevel = 'Off' --optional
AwayLevel = 'Weg'
SleepLevel = 'Slapen'
HomeLevel = 'Thuis'
ComfortLevel = 'Comfort'
-- Values from each level name
OffLevelValue = '0' --optional
AwayLevelValue = '10'
SleepLevelValue = '20'
HomeLevelValue = '30'
ComfortLevelValue = '40'
-- 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] ~= SleepLevel) 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] ~= AwayLevel) 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] ~= OffLevel) then
print("Updating '" .. ToonSelector .. "' selector to '" .. OffLevel .. "'")
commandArray['UpdateDevice'] = otherdevices_idx[ToonSelector]..'|1|'..OffLevelValue
end
end
return commandArray
Domoticz 3.8153 on linux laptop ubuntu 17.10 | Toon Thermostat | RFlink usb gateway