(rooted) Toon thermostat combined Get and Set script

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

(rooted) Toon thermostat combined Get and Set script

Post by waaren »

Created for one of the Dutch forum members who experienced a problem with the two Lua scripts controlling the communication between a rooted Toon and domoticz after updating to a recent domoticz version. This script uses the same uservariables as the original Lua script. many thanks to @johan1974 for testing, patience and constructive feedback.
When switching from the Lua version to this one. Make sure you deactivate both Lua scripts and remove the actions from the selector switches.
  • uservariables used in this script
  • UV_ToonIP ............................................. -- Toon IP address
  • UV_ToonThermostatSensorName ................... -- virtual thermostat setpoint showing current setpoint
  • UV_ToonTemperatureSensorName .................. -- virtual temperature sensor showing current room temperature
  • UV_ToonScenesSensorName ......................... -- virtual selector switch showing current program
  • UV_ToonAutoProgramSensorName .................. -- virtual selector switch showing current auto program status
  • UV_ToonProgramInformationSensorName ......... -- virtual text sensor showing displaying program information status
Main advantage of this script is the use of the async communication between domoticz and Toon. No more blocking the eventsystem if Toon is busy Domoticz event system will just work on other fun stuff and gets signaled whenever Toon decides to answer :)

Code: Select all

--[[ 

    Sync Domoticz sensors / switches with rooted Toon in case the value is changed on the physical device.
    Updates
        Thermostat Sensor 
        Temperature Sensor 
        Scenes switch based on program set on Toon 
        (Auto)program switch to value set on Toon
        Program information text to value set on Toon

    ]] --    

local toonResponse  = "toonResponse"
local ResponseOK    = "OK_toon_Response"
local scriptVersion = "version 0.117"
return {
                on  =   { timer         = { "every minute"      },
                          devices       = { "Toon Thermostaat","Toon Scenes"  },  
                          httpResponses = { toonResponse , ResponseOK      }},
    
           logging  =   {  
                            level       =       domoticz.LOG_DEBUG,   
                            marker      =       scriptVersion .. " Toon" 
                        },
                        
               data =   { 
                            lastActive    = { initial = 0     },
                            isActive      = { initial = false },
                            blockSetPoint = { initial = false },   -- Bug in TimedCommands (silent() does not work in updateSetPoint 
                        },
    
    execute = function(dz, item)
        local now = os.time(os.date('*t'))                  -- seconds since 1/1/1970 00:00:01
        
        local function logWrite(str,level)
            dz.log(tostring(str),level or dz.LOG_DEBUG)
        end
    
        local function sendURL(url,callback)
            local toonIP = dz.variables("UV_ToonIP").value
            local url    = "http://" .. toonIP .. url 
            dz.openURL({ 
                            url = url,
                            method = "GET",
                            callback = callback
                      })                      
        end
        
        local function setSetPoint(device,setPoint) -- update setPoint
            if device.setPoint ~= setPoint then 
                logWrite("Updating thermostat sensor to new set point: " .. setPoint )
                device.updateSetPoint(setPoint)
            else
                dz.data.blockSetPoint = false
            end    
        end
        
        local function setSelector(device,state,str) -- update selector
            if device.level ~= state and device.lastUpdate.secondsAgo > 59 then 
                logWrite("Updating the " .. device.name .. " level to " .. str .. " (" .. state ..  ")")
                device.switchSelector(state).silent()
            end
        end        
        
        local function setTemperature(device,temperature) -- Update temperature sensor 
            if device.temperature ~= temperature then 
                logWrite("Updating the temperature sensor to: " .. temperature)
                device.updateTemperature(temperature).silent()
            end
        end

        local function setText(device,text)    -- Update text sensor
            if device.text ~= text then 
                logWrite("Updating " .. device.name .. " to: " .. text)
                device.updateText(text)
            end
        end

        local function setSetPointInfo(device,nextTime,setPoint)
            if nextTime == 0 or setPoint == 0 then
                newText = "Op " .. setPoint .. "°"
            else
                newText = "Om " ..os.date("%H:%M", nextTime).. " naar " .. setPoint .. "°"
            end
            setText(device,newText)
        end
        
        local function setSceneState(device,state)
            local states       = { 50,40,30,20,10}  -- Manual, Comfort, Home, Sleep , Away 
            local stateStrings = { "Manual", "Comfort", "Home", "Sleep" , "Away"}
            local newState     = states[state + 2]
            local stateString  = stateStrings[state + 2]
            setSelector(device,newState,stateString)
        end
     
        local function setProgramState(device,state)
            local states       = { 10,20,30 }  -- No, Yes, Temporary 
            local stateStrings = { "No", "Yes", "Temporary" }
            local newState     = states[state + 1]
            local stateString  = stateStrings[state + 1]
            setSelector(device,newState,stateString)
        end
        
        local function updateDevices(rt)
            local toonThermostat            = dz.devices(dz.variables("UV_ToonThermostatSensorName").value)           -- Sensor showing current setpoint
            local toonTemperature           = dz.devices(dz.variables("UV_ToonTemperatureSensorName").value)          -- Sensor showing current room temperature
            local toonScenes                = dz.devices(dz.variables("UV_ToonScenesSensorName").value)               -- Sensor showing current program
            local toonAutoProgram           = dz.devices(dz.variables("UV_ToonAutoProgramSensorName").value)          -- Sensor showing current auto program status
            local toonProgramInformation    = dz.devices(dz.variables("UV_ToonProgramInformationSensorName").value)   -- Sensor showing displaying program information status
            
            setSetPoint     (toonThermostat,          dz.utils.round(rt.currentSetpoint / 100,1          ))
            setTemperature  (toonTemperature,         dz.utils.round(rt.currentTemp / 100,1              ))
            setSceneState   (toonScenes,              rt.activeState                                      )  -- "activeState":"-1" ==> 50
            setProgramState (toonAutoProgram,         rt.programState                                     )  -- "programState":"0" ==> 10
            setText         (toonProgramInformation,  dz.utils.round(rt.nextTime,rt.nextSetpoint / 100,1 ))    
        end
        
        local function procesToonResponse()
            logWrite(tostring(item.data))
            return dz.utils.fromJSON(item.data)
        end
        
        local function sendSetPoint(newSetPoint)

            logWrite("In function sendSetPoint; " .. item.name .. " wants to set setPoint to " .. newSetPoint)
            local calculatedSetPoint = newSetPoint * 100 
            local urlString = "/happ_thermstat?action=setSetpoint&Setpoint=" .. calculatedSetPoint
            if not dz.data.blockSetPoint then
                sendURL(urlString, ResponseOK ) 
                logWrite("Toon setPoint send using " .. urlString) 
            else
                logWrite("Toon setPoint not send ; unblocking now ") 
                dz.data.blockSetPoint = false
            end
        end
        
        local function sendScene()
            local newstate
            logWrite("In function sendScene; " .. item.name .. "; level " .. item.level .. " ==>> " .. item.levelName)
            
            if item.level ==  0 then  -- Off
                sendSetPoint(60) 
                return
            end             
            
            if      item.level == 10 then newState = 3       -- Away
            elseif  item.level == 20 then newState = 2       -- Sleep
            elseif  item.level == 30 then newState = 1       -- Home
            elseif  item.level == 40 then newState = 0       -- Comfort
            else                          newState = -1      -- Invalid 
            end
            
            local urlString = "/happ_thermstat?action=changeSchemeState&state=2&temperatureState=" .. newState       
            sendURL(urlString, ResponseOK ) 
            logWrite("Toon SchemeState send using " .. urlString) 
        end
        
        local function getInfo()
            sendURL("/happ_thermstat?action=getThermostatInfo",toonResponse) 
        end

        -- Check for conflicts between timer and set Toon     
        local function setActive(state)    
            if state then 
                logWrite("Triggered by device. Setting active")  
                dz.data.isActive    = true
                dz.data.lastActive  = now
            else
                dz.data.isActive    = false
                logWrite("Answer from Toon. Unset active")  
            end
        end
        
        local function isFree()
            return (( dz.data.lastActive + 90 ) < now ) or ( not dz.data.isActive ) 
        end
        
        local function writeStatus(origin)
            logWrite(origin .. "isFree:               " .. tostring(isFree()))
            logWrite(origin .. "lastActive:           " .. os.date("%X",dz.data.lastActive))
            logWrite(origin .. "blockSetPoint:        " .. tostring(dz.data.blockSetPoint))
        end
        
        -- main program   
        writeStatus("-- start -- ")
        if item.isDevice then                               -- triggered by selector or setPoint
            if item.name == "Toon Scenes" then
                sendScene()
                setActive(true)
            else                    
                sendSetPoint(item.setPoint) 
                setActive(true)
            end
        elseif item.isTimer and isFree() then                    -- triggered by timer
                dz.data.blockSetPoint = true 
                getInfo() 
        elseif item.isHTTPResponse then                              -- Triggered by Toon response
            if item.trigger == toonResponse then                 -- return from getInfo()
                if item.ok and isFree() then                     -- statusCode == 2xx
                    updateDevices(procesToonResponse()) 
                elseif isFree() then
                    logWrite("Toon did not return valid data. Please check what went wrong. Error code: " .. item.statusCode or 999  ,dz.LOG_ERROR)
                    logWrite("Invalid data: " .. tostring(item.data))
                else
                    logWrite("Toon is busy dealing with sendScene or sendSetPoint")
                end
            else
                logWrite("returned from sendScene or sendSetPoint: " .. tostring(item.data))
                setActive(false)
            end
        else
            logWrite("This should never happen")
        end
        writeStatus("-- end -- ")
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

Thanks for this. I used to use another version for hacked Toon's, but somehow that doesn't want to work for me. Going to give this a change.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

Getting the below message.

Code: Select all

019-01-23 11:35:01.139 Status: dzVents: Info: version 0.117 Toon: ------ Finished TOON
2019-01-23 11:36:00.539 Status: dzVents: Info: version 0.117 Toon: ------ Start internal script: TOON:, trigger: every minute
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: -- start -- isFree: true
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: -- start -- lastActive: 01:00:00
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: -- start -- blockSetPoint: true
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: OpenURL: url = http://192.168.0.4/happ_thermstat?action=getThermostatInfo
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: OpenURL: method = GET
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: OpenURL: post data = nil
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: OpenURL: headers = nil
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: OpenURL: callback = toonResponse
2019-01-23 11:36:00.540 Status: dzVents: Debug: version 0.117 Toon: -- end -- isFree: true
2019-01-23 11:36:00.541 Status: dzVents: Debug: version 0.117 Toon: -- end -- lastActive: 01:00:00
2019-01-23 11:36:00.541 Status: dzVents: Debug: version 0.117 Toon: -- end -- blockSetPoint: true
2019-01-23 11:36:00.541 Status: dzVents: Info: version 0.117 Toon: ------ Finished TOON
2019-01-23 11:36:00.920 Status: dzVents: Info: Handling httpResponse-events for: "toonResponse
2019-01-23 11:36:00.920 Status: dzVents: Info: version 0.117 Toon: ------ Start internal script: TOON: HTTPResponse: "toonResponse"
2019-01-23 11:36:00.920 Status: dzVents: Debug: version 0.117 Toon: -- start -- isFree: true
2019-01-23 11:36:00.921 Status: dzVents: Debug: version 0.117 Toon: -- start -- lastActive: 01:00:00
2019-01-23 11:36:00.921 Status: dzVents: Debug: version 0.117 Toon: -- start -- blockSetPoint: true
2019-01-23 11:36:00.921 Status: dzVents: Debug: version 0.117 Toon: {"result":"ok", "currentTemp":"2043", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"6", "programState":"1", "activeState":"1", "nextProgram":"1", "nextState":"0", "nextTime":"1548262800","nextSetpoint":"2000","randomConfigId":"1714636915","errorFound":"255","connection":"0","burnerInfo":"0","otCommError":"0","currentModulationLevel":"0"}
2019-01-23 11:36:00.927 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
2019-01-23 11:36:00.927 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
2019-01-23 11:36:00.928 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
2019-01-23 11:36:00.928 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
2019-01-23 11:36:00.929 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
2019-01-23 11:36:00.929 Status: dzVents: Error (2.4.11): version 0.117 Toon: An error occured when calling event handler TOON
2019-01-23 11:36:00.929 Status: dzVents: Error (2.4.11): version 0.117 Toon: ...e/pi/domoticz/scripts/dzVents/generated_scripts/TOON.lua:50: attempt to index local 'device' (a nil value)
2019-01-23 11:36:00.929 Status: dzVents: Info: version 0.117 Toon: ------ Finished TOON
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by waaren »

EdwinK wrote: Wednesday 23 January 2019 11:35 Getting the below message.

Code: Select all

2019-01-23 11:36:00.927 Status: dzVents: Error (2.4.11): version 0.117 Toon: There is no device with that name or id:
Seems that the device names or numbers from the uservariables are not properly converted so that they can be used in the script.
Can you show the content of the uservariables ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

I now see I didn't enter any information in the 'Variable value:' part. 🤦

I see the following in the script

Code: Select all

    devices       = { "Toon Thermostaat","Toon Scenes"  },  
but a bit further:

Code: Select all

 toonThermostat
 toonScenes
 
So, what do I need to have? Lost.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

Error found, but can't seem to find it.

Code: Select all

2019-01-24 11:06:00.587 Status: dzVents: Debug: version 0.117 Toon: {"result":"ok", "currentTemp":"2088", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"6", "programState":"1", "activeState":"1", "nextProgram":"1", "nextState":"0", "nextTime":"1548349200","nextSetpoint":"2000","randomConfigId":"1804289383","errorFound":"255","connection":"0","burnerInfo":"0","otCommError":"0","currentModulationLevel":"0"}
Complete error-log (I hope):

Code: Select all

2019-01-24 11:09:00.611 Status: dzVents: Info: Handling httpResponse-events for: "toonResponse
2019-01-24 11:09:00.611 Status: dzVents: Info: version 0.117 Toon: ------ Start internal script: TOON: HTTPResponse: "toonResponse"
2019-01-24 11:09:00.612 Status: dzVents: Debug: version 0.117 Toon: -- start -- isFree: true
2019-01-24 11:09:00.612 Status: dzVents: Debug: version 0.117 Toon: -- start -- lastActive: 01:00:00
2019-01-24 11:09:00.612 Status: dzVents: Debug: version 0.117 Toon: -- start -- blockSetPoint: true
2019-01-24 11:09:00.612 Status: dzVents: Debug: version 0.117 Toon: {"result":"ok", "currentTemp":"2091", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"6", "programState":"1", "activeState":"1", "nextProgram":"1", "nextState":"0", "nextTime":"1548349200","nextSetpoint":"2000","randomConfigId":"1804289383","errorFound":"255","connection":"0","burnerInfo":"0","otCommError":"0","currentModulationLevel":"0"}
2019-01-24 11:09:00.636 Status: dzVents: Debug: version 0.117 Toon: Processing device-adapter for toonThermostat: Thermostat setpoint device adapter
2019-01-24 11:09:00.638 Status: dzVents: Debug: version 0.117 Toon: Processing device-adapter for toonTemperature: Temperature device adapter
2019-01-24 11:09:00.639 Status: dzVents: Debug: version 0.117 Toon: Processing device-adapter for toonScenes: Switch device adapter
2019-01-24 11:09:00.640 Status: dzVents: Debug: version 0.117 Toon: Processing device-adapter for toonAutoProgram: Switch device adapter
2019-01-24 11:09:00.641 Status: dzVents: Debug: version 0.117 Toon: Processing device-adapter for toonProgramInformation: Text device
2019-01-24 11:09:00.641 Status: dzVents: Debug: version 0.117 Toon: Updating the temperature sensor to: 20.9
2019-01-24 11:09:00.641 Status: dzVents: Debug: version 0.117 Toon: Updating the toonAutoProgram level to Yes (20)
2019-01-24 11:09:00.641 Status: dzVents: Debug: version 0.117 Toon: Constructed timed-command: Set Level 20
2019-01-24 11:09:00.641 Status: dzVents: Debug: version 0.117 Toon: Constructed timed-command: Set Level 20 NOTRIGGER
2019-01-24 11:09:00.642 Status: dzVents: Debug: version 0.117 Toon: Updating toonProgramInformation to: 1548349200
2019-01-24 11:09:00.642 Status: dzVents: Debug: version 0.117 Toon: -- end -- isFree: true
2019-01-24 11:09:00.642 Status: dzVents: Debug: version 0.117 Toon: -- end -- lastActive: 01:00:00
2019-01-24 11:09:00.642 Status: dzVents: Debug: version 0.117 Toon: -- end -- blockSetPoint: false
2019-01-24 11:09:00.642 Status: dzVents: Info: version 0.117 Toon: ------ Finished TOON
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

Devices:
Schermafbeelding 2019-01-24 om 11.13.27.png
Schermafbeelding 2019-01-24 om 11.13.27.png (116.9 KiB) Viewed 4672 times
UV:
Schermafbeelding 2019-01-24 om 11.14.44.png
Schermafbeelding 2019-01-24 om 11.14.44.png (59.22 KiB) Viewed 4672 times
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by waaren »

EdwinK wrote: Thursday 24 January 2019 11:15 Devices:

UV:
Please double check names / variables. Special attention for spaces and use of UPPERCASE lowercase
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

I don't see it.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by waaren »

EdwinK wrote: Thursday 24 January 2019 20:41 I don't see it.
My bad. Did not notice you had two devices for some of the Toon stuff. What is the error you found ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by madpatrick »

Line 184 and 185 are not correct. There is a space between by devics and not in UV
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
georon
Posts: 13
Joined: Friday 23 February 2018 14:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Bèta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by georon »

Waaren,

My complements on the way you have designed this LUA script.
Very nicely written and I really like that fact that you have created everything using functions.
This keeps your main program nice and small.

I really like it very much!
Currently not using it though, I had created my own version based on the original separated scripts.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

madpatrick wrote: Friday 25 January 2019 9:51 Line 184 and 185 are not correct. There is a space between by devics and not in UV

This are my lines 184 and 185

Code: Select all

       -- main program   
        writeStatus("-- start -- ")
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by madpatrick »

EdwinK wrote: Tuesday 12 February 2019 21:01
madpatrick wrote: Friday 25 January 2019 9:51 Line 184 and 185 are not correct. There is a space between by devics and not in UV

This are my lines 184 and 185

Code: Select all

       -- main program   
        writeStatus("-- start -- ")

In Devices
EdwinK wrote: Thursday 24 January 2019 11:15 Devices:
Schermafbeelding 2019-01-24 om 11.13.27.png
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Toon thermostat combined Get and Set script

Post by EdwinK »

Ah... Didn't notice..
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
jbr79
Posts: 20
Joined: Saturday 17 October 2015 22:23
Target OS: Linux
Domoticz version: 4.10659
Contact:

Re: Toon thermostat combined Get and Set script

Post by jbr79 »

What are the prerequisites for using this script? This script is returning an error just connecting to the thermostat when I am trying to apply it...
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by waaren »

jbr79 wrote: Monday 18 February 2019 7:53 What are the prerequisites for using this script? This script is returning an error just connecting to the thermostat when I am trying to apply it...
Probably @johan1974 is in the best position to answer this. Script was tested on his setup and I don't own a Toon myself.
What is the error you get ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
jbr79
Posts: 20
Joined: Saturday 17 October 2015 22:23
Target OS: Linux
Domoticz version: 4.10659
Contact:

Re: Toon thermostat combined Get and Set script

Post by jbr79 »

irrespective of setting local LAN access to true or not, the error message is:

Code: Select all

Error opening url: http://<IP>/happ_thermstat?action=getThermostatInfo
User avatar
madpatrick
Posts: 636
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by madpatrick »

jbr79 wrote: Monday 18 February 2019 19:46 irrespective of setting local LAN access to true or not, the error message is:

Code: Select all

Error opening url: http://<IP>/happ_thermstat?action=getThermostatInfo
Put your ip address at <IP>
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Toon thermostat combined Get and Set script

Post by waaren »

jbr79 wrote: Monday 18 February 2019 19:46 irrespective of setting local LAN access to true or not, the error message is:

Code: Select all

Error opening url: http://<IP>/happ_thermstat?action=getThermostatInfo
The IP number of your Toon need to be entered in the uservariable UV_ToonIP. Look at the first post of this topic.
It would help if you show the loglines produced by this script.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests