Page 2 of 2
Re: Extracting Setpoint from a Radiatorvalve
Posted: Wednesday 11 May 2016 14:34
by jvdz
There are still 2 "Radiator Bedroom" devices in your list. One has the value 15.0 and the other On.
It is important to have unique names for your devices when you want to do scripting as that works with the names.
Jos
Re: Extracting Setpoint from a Radiatorvalve
Posted: Wednesday 11 May 2016 15:24
by DutchHans
Hi Jos,
True, The changing of the name (unique) didn't make any difference, so I changed it back to the original state, automatically created by Domoticz.
And.. as you can see, in Blockly it works.
Its true that Lua is more flexible but maybe Blockly is the way to go...

Re: Extracting Setpoint from a Radiatorvalve
Posted: Wednesday 11 May 2016 15:43
by jvdz
Blockly is using LUA so don't see where there could be any difference.
As stated, you really need to use unique device names for LUA/Blockly to work reliable.
I am still curious to see the same information (screen capture and script log info) when you have renamed the devices to a unique name .
Will write a little debug script later today in case it still doesn't work, showing some more debug info.
Jos
Re: Extracting Setpoint from a Radiatorvalve
Posted: Wednesday 11 May 2016 18:29
by jvdz
Put this code in a script called script_time_debug.lua :
Code: Select all
commandArray = {}
searchname="Radiator"
print("Show status for devices containing:" .. searchname)
for name, idx in pairs(otherdevices_idx) do
if string.find( name,searchname) then
print("IDX=" .. idx .. " Name=" .. name .. " otherdevices[]=" .. otherdevices[name] .. " otherdevices_svalues[]=" .. otherdevices_svalues[name])
end
end
print("--- done-----")
return commandArray
It will run each minute so as soon as it has ran you can rename it to script_time_debug_demo.lua so it stops running.
Curious what the output will be.
Jos
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 10:10
by DutchHans
Hi Jos,
this is the part of the log created by your debug script:
2016-05-12 10:09:10.317 LUA: Show status for devices containing:Radiator
2016-05-12 10:09:10.317 LUA: IDX=510 Name=Radiator Kitchen otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 10:09:10.317 LUA: IDX=508 Name=Radiator Livingroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 10:09:10.317 LUA: IDX=506 Name=Radiator Office otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 10:09:10.317 LUA: IDX=504 Name=Radiator Bedroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 10:09:10.317 LUA: --- done-----
In the GUI they are all 15.0 C
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 10:16
by jvdz
As you can see it is finding the switch, not the setpoint device at this moment.
So what did you rename your Setpoint device with IDX 503 to?
Jos
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 11:05
by DutchHans
Hi Jos,
I renamed the 503, 505, 507 and 509 by adding "_Setpoint" to the device name. IE "Radiator Bedroom_setpoint". Ran your script again but the output remains the same.
2016-05-12 11:03:03.751 LUA: Show status for devices containing:Radiator
2016-05-12 11:03:03.751 LUA: IDX=510 Name=Radiator Kitchen otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:03:03.751 LUA: IDX=508 Name=Radiator Livingroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:03:03.751 LUA: IDX=504 Name=Radiator Bedroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:03:03.751 LUA: IDX=506 Name=Radiator Office otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:03:03.752 LUA: --- done-----
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 11:09
by DutchHans
OOPS!, something did change:
2016-05-12 11:11:03.911 LUA: Show status for devices containing:Radiator
2016-05-12 11:11:03.912 LUA: IDX=505 Name=Radiator Office_Setpoint otherdevices[]=On otherdevices_svalues[]=15.0
2016-05-12 11:11:03.912 LUA: IDX=508 Name=Radiator Livingroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:11:03.912 LUA: IDX=510 Name=Radiator Kitchen otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:11:03.912 LUA: IDX=509 Name=Radiator Kitchen_Setpoint otherdevices[]=On otherdevices_svalues[]=15.0
2016-05-12 11:11:03.912 LUA: IDX=507 Name=Radiator Livingroom_Setpoint otherdevices[]=On otherdevices_svalues[]=15.0
2016-05-12 11:11:03.912 LUA: IDX=504 Name=Radiator Bedroom otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:11:03.912 LUA: IDX=503 Name=Radiator Bedroom_Setpoint otherdevices[]=On otherdevices_svalues[]=15.0
2016-05-12 11:11:03.912 LUA: IDX=506 Name=Radiator Office otherdevices[]=On otherdevices_svalues[]=0.0
2016-05-12 11:11:03.912 LUA: --- done-----
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 11:20
by jvdz
That looks like I would expect it to be
Jos
Re: Extracting Setpoint from a Radiatorvalve
Posted: Thursday 12 May 2016 11:25
by DutchHans
I guess I can continue with the script now... thank you very much.
Regards, Hans