Extracting Setpoint from a Radiatorvalve

Moderator: leecollings

User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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... :cry:
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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-----
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post 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-----
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post by jvdz »

That looks like I would expect it to be :)

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Extracting Setpoint from a Radiatorvalve

Post by DutchHans »

I guess I can continue with the script now... thank you very much.

Regards, Hans
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest