Controlling Toon via Domoticz

Everything about external control, apps, VNC, etc goes here.

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Re: Controlling Toon via Domoticz

Postby Ierlandfan » Wed Mar 06, 2019 8:11 am

Did you install ToonStore app "Boilerstatus"?

I am quite sure you're missing that part. That App creates the boilervalues.txt on Toon.
The error says that boilervalues.txt is not found. (404, Not found)
Posts: 145
Joined: October 2013

Re: Controlling Toon via Domoticz

Postby driesk » Wed Mar 06, 2019 11:24 pm

Would it be possible to show 'zon op toon' information in domoticz?
Starting Member
Starting Member
Posts: 8
Joined: October 2014

Re: Controlling Toon via Domoticz

Postby yjb » Thu Mar 07, 2019 7:43 am

Yes, that should be possible. It's actually one of the items on my to-do list.

The concept is simple as you have to do it in the same way as the other P1 readout's.

In my case (toon2) the device is dev_3.3 ("HAE_METER_v3_3")
Posts: 177
Joined: April 2009
Location: Venhuizen, Netherlands

Re: Controlling Toon via Domoticz

Postby madpatrick » Thu Mar 07, 2019 8:54 pm

driesk wrote:Would it be possible to show 'zon op toon' information in domoticz?

Check my
Revious post in this thread.
In this script you can find the part for energy return with dev_xx
Not quite Zon on Toon, but nice to have
User avatar
Posts: 73
Joined: December 2017
Location: Zuid-Holland

Re: Controlling Toon via Domoticz

Postby TerrorSource » Thu Mar 07, 2019 9:15 pm

mAiden wrote:
TerrorSource wrote:
madpatrick wrote:Hi,

I've the script working for a long period on my Toon 2
Maybe this can help.
Please be aware that i've changed the names of the variables etc... for easy reading ;-)

What Device id's should i use?
This is the output of getDevices.json:

Code: Select all
{"dev_settings_device": {"uuid": "fbd78ce3-44a3-4064-bf15-3dac7fa35a6f", "name": "settings_device", "internalAddress": "settings_device", "type": "settings_device"}, "dev_3": {"uuid": "a211f771-6e68-497a-8205-f56ebcf65793", "name": "HAE_METER_v3", "internalAddress": "3", "type": "HAE_METER_v3", "supportsCrc": "1", "ccList": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e", "supportedCC": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e", "nodeFlags": [], "IsConnected": "1", "HealthValue": "10", "DeviceName": "HAE_METER_v3"}, "dev_3.1": {"uuid": "2c152d56-d608-4d28-8c33-2ea0355e8948", "name": "HAE_METER_v3_1", "internalAddress": "3.1", "type": "gas", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentGasFlow": "52.00", "CurrentGasQuantity": "1028744.00", "DeviceName": "HAE_METER_v3_1"}, "dev_3.2": {"uuid": "8239e6a6-a7b6-400d-9de0-4d86ae281f4a", "name": "HAE_METER_v3_2", "internalAddress": "3.2", "type": "elec", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "NaN", "CurrentElectricityQuantity": "NaN", "DeviceName": "HAE_METER_v3_2"}, "dev_3.3": {"uuid": "7a1c0810-b9af-415d-bd3c-0979af6676e1", "name": "HAE_METER_v3_3", "internalAddress": "3.3", "type": "elec_solar", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "NaN", "CurrentElectricityQuantity": "NaN", "DeviceName": "HAE_METER_v3_3"}, "dev_3.4": {"uuid": "aa539bb2-0096-4627-b1a3-2504e5c0cd36", "name": "HAE_METER_v3_4", "internalAddress": "3.4", "type": "elec_delivered_nt", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "3973551.00", "DeviceName": "HAE_METER_v3_4"}, "dev_3.5": {"uuid": "1d138f8c-2da8-4618-ab52-bf6281e12c41", "name": "HAE_METER_v3_5", "internalAddress": "3.5", "type": "elec_received_nt", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "7854368.00", "DeviceName": "HAE_METER_v3_5"}, "dev_3.6": {"uuid": "c9f9be9b-8f4e-4055-b267-4ab93a01d25e", "name": "HAE_METER_v3_6", "internalAddress": "3.6", "type": "elec_delivered_lt", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "372.00", "CurrentElectricityQuantity": "5301825.00", "DeviceName": "HAE_METER_v3_6"}, "dev_3.7": {"uuid": "0951d682-cb2f-4074-a4de-ca6bafa244ac", "name": "HAE_METER_v3_7", "internalAddress": "3.7", "type": "elec_received_lt", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "3328551.00", "DeviceName": "HAE_METER_v3_7"}, "dev_3.8": {"uuid": "2f958e23-8475-48a4-bd26-ed9f539721ca", "name": "HAE_METER_v3_8", "internalAddress": "3.8", "type": "heat", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentHeatQuantity": "NaN", "DeviceName": "HAE_METER_v3_8"}}

dev3_1 is gas
dev3_6 is elec

In my json output is:

but in the script it is under "-- domoticz.log(jsonGasPower)":

What lay-out should i use?
Posts: 239
Joined: May 2017

Re: Controlling Toon via Domoticz

Postby MarcF » Fri Mar 08, 2019 8:00 pm

Hello mAiden, TerrorSource

In the output json output file replace ',' with a ', \n' in notepad++ (CTRL+H, make sure you use the extended option in the search method )

You will get:

Code: Select all
{"dev_settings_device": {"uuid": "fbd78ce3-44a3-4064-bf15-3dac7fa35a6f",
"name": "settings_device",
"internalAddress": "settings_device",
"type": "settings_device"},
"dev_3": {"uuid": "a211f771-6e68-497a-8205-f56ebcf65793",
"name": "HAE_METER_v3",
"internalAddress": "3",
"type": "HAE_METER_v3",
"supportsCrc": "1",
"ccList": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e",
"supportedCC": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e",
"nodeFlags": [],
"IsConnected": "1",
"HealthValue": "10",
"DeviceName": "HAE_METER_v3"},
"dev_3.1": {"uuid": "2c152d56-d608-4d28-8c33-2ea0355e8948",
"name": "HAE_METER_v3_1",
"internalAddress": "3.1",
"type": "gas",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentGasFlow": "52.00",
"CurrentGasQuantity": "1028744.00",
"DeviceName": "HAE_METER_v3_1"},
"dev_3.2": {"uuid": "8239e6a6-a7b6-400d-9de0-4d86ae281f4a",
"name": "HAE_METER_v3_2",
"internalAddress": "3.2",
"type": "elec",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "NaN",
"CurrentElectricityQuantity": "NaN",
"DeviceName": "HAE_METER_v3_2"},
"dev_3.3": {"uuid": "7a1c0810-b9af-415d-bd3c-0979af6676e1",
"name": "HAE_METER_v3_3",
"internalAddress": "3.3",
"type": "elec_solar",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "NaN",
"CurrentElectricityQuantity": "NaN",
"DeviceName": "HAE_METER_v3_3"},
"dev_3.4": {"uuid": "aa539bb2-0096-4627-b1a3-2504e5c0cd36",
"name": "HAE_METER_v3_4",
"internalAddress": "3.4",
"type": "elec_delivered_nt",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "0.00",
"CurrentElectricityQuantity": "3973551.00",
"DeviceName": "HAE_METER_v3_4"},
"dev_3.5": {"uuid": "1d138f8c-2da8-4618-ab52-bf6281e12c41",
"name": "HAE_METER_v3_5",
"internalAddress": "3.5",
"type": "elec_received_nt",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "0.00",
"CurrentElectricityQuantity": "7854368.00",
"DeviceName": "HAE_METER_v3_5"},
"dev_3.6": {"uuid": "c9f9be9b-8f4e-4055-b267-4ab93a01d25e",
"name": "HAE_METER_v3_6",
"internalAddress": "3.6",
"type": "elec_delivered_lt",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "372.00",
"CurrentElectricityQuantity": "5301825.00",
"DeviceName": "HAE_METER_v3_6"},
"dev_3.7": {"uuid": "0951d682-cb2f-4074-a4de-ca6bafa244ac",
"name": "HAE_METER_v3_7",
"internalAddress": "3.7",
"type": "elec_received_lt",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentElectricityFlow": "0.00",
"CurrentElectricityQuantity": "3328551.00",
"DeviceName": "HAE_METER_v3_7"},
"dev_3.8": {"uuid": "2f958e23-8475-48a4-bd26-ed9f539721ca",
"name": "HAE_METER_v3_8",
"internalAddress": "3.8",
"type": "heat",
"supportsCrc": "0",
"ccList": "5e 59 85 8e 3c 3d 3e",
"supportedCC": "5e 59 85 8e 3c 3d 3e",
"nodeFlags": [],
"CurrentHeatQuantity": "NaN",
"DeviceName": "HAE_METER_v3_8"}}

A more readable file.

Your device is:

Your GAS is:

Your Electra is:

Check the values in 'CurrentElectricityQuantity' which device you need for the 'laag' and 'hoog'. You need to use 'dev_31' without the '.' between the 3 and 1
Starting Member
Starting Member
Posts: 2
Joined: March 2019

Re: Controlling Toon via Domoticz

Postby MarcF » Fri Mar 08, 2019 8:27 pm

To All,

Based on the manual from TerrorSource ... mp;t=12097 and BOverdevest ... p;start=15 I created 2 files.

Download the manual from TerrorSource, base topic page 1. This Manual explains how you create virtual sensors and define User Variables
The Virtual sensors (Devices) and User Variables you create need to have the EXACT value that is used within the scripts. If this doesn't match, the scripts won't work

To help you out, here is some helpfull data for setting up the Toon <=> Domoticz connection with the proces described by TerrorSource and the script from BOverdevest

NOTE: Download notepad++ if you don;y have it allready. It's free and very usefull! You can use it to replace some parts in the files (personal config settings)

Code: Select all
// Refwerence to Base forum topics with manual and scripts

// User Variables
UV_ToonThermostat            ToonThermostat
UV_ToonTemperature            ToonTemperature
UV_ToonBoilerTempIn            ToonBoilerTempIn
UV_ToonBoilerTempOut         ToonBoilerTempOut
UV_ToonBoilerPressure         ToonBoilerPressure
UV_ToonBoilerModulation         ToonBoilerModulation
UV_ToonScenes               ToonScenes
UV_ToonAutoProgram            ToonAutoProgram
UV_ToonProgramInformation      ToonProgramInformation
UV_ToonIP                  ToonIP
UV_DomoticzIP               DomoticzIP
UV_ToonBurnerName            ToonBurnerName
UV_P1SmartMeterElectra         P1SmartMeterPower
UV_P1SmartMeterGasMeterStand   P1SmartMeterGas
UV_ToonBoilerTempSetpoint      ToonBoilerSetpoint
ToonThermostat               Thermostat         SetPoint
ToonTemperature               Temperature         LaCrosse TX3
ToonBoilerTempIn            Temperature         LaCrosse TX3
ToonBoilerTempOut            Temperature         LaCrosse TX3
ToonBoilerPressure            General            Pressure
ToonBoilerModulation         General            Percentage
ToonScenes                  Light/Switch      Selector Switch
ToonAutoProgram               Light/Switch      Selector Switch
ToonProgramInformation         General            Text
ToonIP                     General            Text
DomoticzIP                  General            Text
ToonBurnerName               Light/Switch      Selector Switch
P1SmartMeterPower            P1 Smart Meter      Energy
P1SmartMeterGas               P1 Smart Meter      Gas
ToonBoilerSetpoint            Temperature         LaCrosse TX3

// Make sure you enabled LUA/DzVents in
// Setup => Settings => choose tab 'Other' => EventSystem

// Change the following in this file:
// <ToonIP> with your Toon IP adress
// <DomoticzIP:Port> with your Domoticz IP adress and port used (e.g.
// <IDXnr> with the IDX number of your Toon Device (Setup => Devices, Idx column)

// Usefull links
// Test Toon SET communication if you need to check communication to the Toon

// Switch settings
Go to "Swithes" in the Domoticz menu

Select “ToonAutoProgram” => “Edit” .
Set “Hide Off Level” to“OFF”.
Change “Level Names”:
0 Off
10 No
20 Yes
30 Temporary

Change the “Level Action”
10 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=0
20 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=1
Press "Save" to save the changes

Select “ToonScenes” => “Edit” .
Set “Hide Off Level” to“OFF”.
Change “Level Names”:
0 Off
10 Away
20 Sleep
30 Home
40 Comfort
50 Manual

Change the “Level Action”
10 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=2&temperatureState=3
20 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=2&temperatureState=2
30 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=2&temperatureState=1
40 http://<IP_TOON>/happ_thermstat?action=changeSchemeState&state=2&temperatureState=0
50 http://<IP_TOON>/happ_thermstat?action=setSetpoint&Setpoint=60
Press "Save" to save the changes

Select “ToonBranderInfo” => “Edit”.
Set “Hide Off Level” to“OFF”.
Change “Level Names”:
0 Off
10 CV
20 WW
Press "Save" to save the changes

When all is set up, you can use this script. Please also note the remarks in the top part to update some parts of the script to make it match your situation

Code: Select all
return {
   on = {
      timer = {
      -- Run script every minute
         'every minute'
   execute = function(domoticz)
      -- Define local variables. UV_* needs to be creates within Domoticz with exact same name!
      -- Replace the following strings with a find and replace function to
      -- customize this script to your personal installation
      -- replace <IP_TOON> with your Toon IP adres
      -- Check dev_* numbers on your Toon with http://<IP_TOON>/hdrv_zwave?action=getDevices.json
      -- Copy paste the output from your browser in Notepad++ and replace the ',' with ', \n'. Make sure in search method the extended option is activeState
      -- Find the GAS and ELECTRICITY values. Check these with your actual meters to determine which dev_* is your low / high value
      -- Enter the dev values without extra '.' So 'dev_3.3' becomes 'dev_33' in this script
      -- Change the 'dev' numbers accordingly to your settings in the section marked: START UPDATE SECTION
      -- Save this script as a dzVents Device script in SETUP => MORE OPTIONS => EVENTS Press the '+' tab.
      -- Delete the code in the new file and replace with this entire code. Save the file
      -- Check the SETUP => LOG for events
        local ToonThermostat        = domoticz.variables('UV_ToonThermostat').value -- Sensor showing current setpoint
        local ToonTemperature       = domoticz.variables('UV_ToonTemperature').value -- Sensor showing current room temperature
        local ToonBoilerTempIn      = domoticz.variables('UV_ToonBoilerTempIn').value -- Sensor showing water temp return
        local ToonBoilerTempOut     = domoticz.variables('UV_ToonBoilerTempOut').value -- Sensor showing current water temp out
        local ToonBoilerPressure    = domoticz.variables('UV_ToonBoilerPressure').value -- Sensor showing current room temperature
        local ToonBoilerModulation  = domoticz.variables('UV_ToonBoilerModulation').value -- Sensor showing current Boiler Modulation
        local ToonScenes            = domoticz.variables('UV_ToonScenes').value -- Sensor showing current program
        local ToonAutoProgram       = domoticz.variables('UV_ToonAutoProgram').value -- Sensor showing current auto program status
        local ToonProgramInformation = domoticz.variables('UV_ToonProgramInformation').value -- Sensor showing displaying program information status
        local ToonIP                = domoticz.variables('UV_ToonIP').value
        local DomoticzIP            = domoticz.variables('UV_DomoticzIP').value
        local ToonBurnerName        = domoticz.variables('UV_ToonBurnerName').value
        local P1SmartMeterPower     = domoticz.variables('UV_P1SmartMeterElectra').value
        local P1SmartMeterGas       = domoticz.variables('UV_P1SmartMeterGasMeterStand').value
        local ToonBoilerSetpoint    = domoticz.variables('UV_ToonBoilerTempSetpoint').value  -- Sensor showing current boiler set point water temp out
        -- Handle json
      -- Adjust loadfile location to your personal installation.
      -- This setting is for the raspberry pi
        local json = assert(loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")()  -- For Raspberry
        local handle_ToonInfo = assert(io.popen(string.format('curl http://%s/happ_thermstat?action=getThermostatInfo', ToonIP)))
        local ThermostatInfo = handle_ToonInfo:read('*all')
        local jsonThermostatInfo = json:decode(ThermostatInfo)
        if jsonThermostatInfo == nil then
        local handle_BoilerInfo = assert(io.popen(string.format('curl http://%s/boilerstatus/boilervalues.txt', ToonIP)))
        local BoilerInfo = handle_BoilerInfo:read('*all')

        -- JSON data from Toon contains a extra "," which should not be there.
        BoilerInfo = string.gsub(BoilerInfo, ",}", "}")
        jsonBoilerInfo = json:decode(BoilerInfo)
         -- http://<IP_TOON>/hdrv_zwave?action=getDevices.json
        local handle_P1Connection = assert(io.popen(string.format('curl http://%s/hdrv_zwave?action=getDevices.json', ToonIP)))
        local GasPowerInfo = handle_P1Connection:read('*all')
        -- JSON data from Toon contains a extra "." which should not be there.
      -- Check dev_* numbers on your Toon with http://<IP_TOON>/hdrv_zwave?action=getDevices.json
        GasPowerInfo = string.gsub(GasPowerInfo, "dev_2.", "dev_2")
        GasPowerInfo = string.gsub(GasPowerInfo, "dev_2:", "dev_2\":")
        local jsonGasPower = json:decode(GasPowerInfo)
       -- domoticz.log(jsonGasPower)
      -- Check dev_* numbers on your Toon with http://<IP_TOON>/hdrv_zwave?action=getDevices.json
         local CurrentElectricityFlowHoog = tonumber(jsonGasPower.dev_23.CurrentElectricityFlow )
         local CurrentElectricityQuantityHoog = tonumber(jsonGasPower.dev_23.CurrentElectricityQuantity)
         local CurrentElectricityFlowLaag = tonumber(jsonGasPower.dev_25.CurrentElectricityFlow )
         local CurrentElectricityQuantityLaag = tonumber(jsonGasPower.dev_25.CurrentElectricityQuantity)
         local CurrentGasFlow = tonumber(jsonGasPower.dev_21.CurrentGasFlow)
         local CurrentGasQuantity = tonumber(jsonGasPower.dev_21.CurrentGasQuantity)
         local CurrentElectricityQuantity =   CurrentElectricityFlowHoog + CurrentElectricityFlowLaag
         local CurrentElectricityDeliveredLaag = 0
         local CurrentElectricityDeliveredHoog = 0
         local totalDeliveredPower = 0

        domoticz.devices(P1SmartMeterPower).updateP1(CurrentElectricityQuantityLaag, CurrentElectricityQuantityHoog, CurrentElectricityDeliveredLaag, CurrentElectricityDeliveredHoog, CurrentElectricityQuantity, totalDeliveredPower).silent()

-- Update the Boiler Water In to current value
         local currentboilerInTemp = tonumber(jsonBoilerInfo.boilerInTemp)
        if domoticz.utils.round(domoticz.devices(ToonBoilerTempIn).temperature,0) ~= domoticz.utils.round(currentboilerInTemp,0) then
            -- domoticz.log('Updating Boiler Water In to current value: ' ..currentboilerInTemp)
-- Update the Boiler water Out to current value
     local currentboilerOutTemp = tonumber(jsonBoilerInfo.boilerOutTemp)
        if domoticz.utils.round(domoticz.devices(ToonBoilerTempOut).temperature,0) ~= domoticz.utils.round(currentboilerOutTemp,0) then
            -- domoticz.log('Updating Boiler Water Out to current value: ' ..currentboilerOutTemp)
-- Update the Boiler water Pressure to current value
        local currentBoilerPressure = tonumber(jsonBoilerInfo.boilerPressure) * 10
        if domoticz.utils.round(domoticz.devices(ToonBoilerPressure)._nValue,0) ~= domoticz.utils.round(currentBoilerPressure,0) then
            -- domoticz.log('Updating Boiler Pressure to current value: ' ..currentBoilerPressure)

-- Update Program state to current value
        local currentSetpoint = tonumber(jsonThermostatInfo.currentSetpoint) / 100
        local currentTemperature = tonumber(jsonThermostatInfo.currentTemp) / 100
        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
-- Update Active state to current value
        local currentActiveState = tonumber(jsonThermostatInfo.activeState)
            if currentActiveState == -1 then currentActiveState = 50 -- Manual
                elseif currentActiveState == 0 then currentActiveState = 40 -- Comfort
                elseif currentActiveState == 1 then currentActiveState = 30 -- Home
                elseif currentActiveState == 2 then currentActiveState = 20 -- Sleep
                elseif currentActiveState == 3 then currentActiveState = 10 -- Away
-- Update the toon burner selector to current program state
        local currentBurnerInfo = tonumber(jsonThermostatInfo.burnerInfo)   
        local CurrentToonBurnerValue = domoticz.devices(ToonBurnerName).level
        if currentBurnerInfo == 0 then currentBurnerInfo = 0 -- uit
            elseif currentBurnerInfo == 1 then currentBurnerInfo = 10 -- cv aan
            elseif currentBurnerInfo == 2 then currentBurnerInfo = 20 -- warmwater aan
        if CurrentToonBurnerValue ~= currentBurnerInfo then  -- Update toon burner selector if it has changed
            -- domoticz.log('Updating Toon burner info:')
-- Update the modulation level of the burner
        local currentModulationLevel = tonumber(jsonThermostatInfo.currentModulationLevel)
        if domoticz.devices(ToonBoilerModulation).percentage + 1 ~= currentModulationLevel + 1 then
            -- domoticz.log('Updating the Modulation sensor to new value: ' ..currentModulationLevel)
-- Update the temperature Boiler setpoint to current boiler set point
        local currentInternalBoilerSetpoint = jsonThermostatInfo.currentInternalBoilerSetpoint+1
        if domoticz.utils.round(domoticz.devices(ToonBoilerSetpoint).temperature, 1) ~= domoticz.utils.round(currentInternalBoilerSetpoint, 1) then
            -- domoticz.log('Updating the Boiler internal temperature setpoint to new value: ' ..currentInternalBoilerSetpoint)
-- Update the thermostat sensor to current setpoint
        if domoticz.devices(ToonThermostat).setPoint*100 ~= currentSetpoint*100 then
            -- domoticz.log('Updating thermostat sensor to new set point: ' ..currentSetpoint)
-- Update the temperature sensor to current room temperature
        if domoticz.utils.round(domoticz.devices(ToonTemperature).temperature, 1) ~= domoticz.utils.round(currentTemperature, 1) then
            -- domoticz.log('Updating the temperature sensor to new value: ' ..currentTemperature)
-- Update the toon scene selector sensor to current program state
        if domoticz.devices(ToonScenes).level ~= currentActiveState then  -- Update toon selector if it has changed
            -- domoticz.log('Updating Toon Scenes selector to: '..currentActiveState)
-- 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)
-- Updates the toon program information text box
        local currentNextTime = jsonThermostatInfo.nextTime
        local currentNextSetPoint = tonumber(jsonThermostatInfo.nextSetpoint) / 100
        if currentNextTime == 0 or currentNextSetPoint == 0 then
            ToonProgramInformationSensorValue = 'Op ' ..currentSetpoint.. '°'
            ToonProgramInformationSensorValue = 'Om ''%H:%M', currentNextTime).. ' op ' ..currentNextSetPoint.. '°'
        if domoticz.devices(ToonProgramInformation).text ~= ToonProgramInformationSensorValue then
            -- domoticz.log('Updating Toon Program Information to: '..ToonProgramInformationSensorValue)
-- Updates the Device Domoticz IP adres to given adres in UV_DomoticzIP
        if domoticz.devices('DomoticzIP').text ~= DomoticzIP then
            -- domoticz.log('Updating Domoticz IP to: '..DomoticzIP)

When all is done correctly, it will work with a rooted Toon, fw 5.04. Maybe you need to install the boilerstatus module from the toonstore if you get boiler issues.
Starting Member
Starting Member
Posts: 2
Joined: March 2019

Re: Controlling Toon via Domoticz

Postby hansgrave » Sat Mar 09, 2019 3:25 pm

Finaly it works... The problem was the permission in windows for the directory where the DZ script should written :roll:

@MarcF thanx for your summary of settings and script, little correction in the switch part: the proper switch name is ToonBurnerName in stead of ToonBranderInfo
Homey, rooted Toon 1 and Domoticz.
Starting Member
Starting Member
Posts: 24
Joined: December 2017

Re: Controlling Toon via Domoticz

Postby Edwin66 » Thu Mar 21, 2019 11:20 am

I don't know why, but every time I do the following:

Code: Select all<IDXnr>&nvalue=0&svalue=

Of course with my settings, I get an unresponsive system. Can't even connect with terminal. All I can do is to reinstall domoticz and then restore a backup.
Toon® (rooted) | Hue bulbs | TRÅDFRI bulbs | Smart Plug | Domoticz latest BETA |

I'm not a programmer, just wish things work MY way
Starting Member
Starting Member
Posts: 48
Joined: August 2018


Return to Toon external control

Who is online

Users browsing this forum: No registered users and 0 guests