I have virtual thermometer and need in LUA script set temperature value.
How to do it ?
Virtual Thermometer
Moderator: leecollings
- cyberclwn
- Posts: 103
- Joined: Thursday 20 August 2015 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Virtual Thermometer
- http://lmgtfy.com/?q=domoticz+lua+temperature+set+level
- click first hit
- search for "updatedevice" on that page
- click first hit
- search for "updatedevice" on that page
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
-
- Posts: 4
- Joined: Thursday 29 September 2016 14:55
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Virtual Thermometer
This site I have visited before but it did not help me:
script: /usr/share/domoticz/scripts/lua/script_device_topeni.lua
------------------------
pn = tonumber(otherdevices_svalues['Termostat_loznice_nastaveni'])
pt = tonumber(otherdevices_svalues['Termostat_loznice_teplota'])
if (pn < pt) then
os.execute('curl "http://192.168.1.180/setting?set_heat=0"')
end
if (pn > pt) then
os.execute('curl "http://192.168.1.180/setting?set_heat=1"')
end
commandArray = {}
commandArray['Termostat_loznice_teplota']='60|33.33|44.44'
return commandArray
-----------------------
Log:
2016-09-29 20:21:06.329 EventSystem: Script event triggered: /usr/share/domoticz/scripts/lua/script_device_topeni.lua
First block run OK.
Termostat_podlaha_teplota still shows the temperature 0.....
Probably doing something wrong, my English skills are quite small ...sorry.
script: /usr/share/domoticz/scripts/lua/script_device_topeni.lua
------------------------
pn = tonumber(otherdevices_svalues['Termostat_loznice_nastaveni'])
pt = tonumber(otherdevices_svalues['Termostat_loznice_teplota'])
if (pn < pt) then
os.execute('curl "http://192.168.1.180/setting?set_heat=0"')
end
if (pn > pt) then
os.execute('curl "http://192.168.1.180/setting?set_heat=1"')
end
commandArray = {}
commandArray['Termostat_loznice_teplota']='60|33.33|44.44'
return commandArray
-----------------------
Log:
2016-09-29 20:21:06.329 EventSystem: Script event triggered: /usr/share/domoticz/scripts/lua/script_device_topeni.lua
First block run OK.
Termostat_podlaha_teplota still shows the temperature 0.....
Probably doing something wrong, my English skills are quite small ...sorry.
-
- Posts: 4
- Joined: Thursday 29 September 2016 14:55
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Virtual Thermometer
OK : commandArray['UpdateDevice']='60|33.33|44.44'
Thanks
Thanks
Who is online
Users browsing this forum: No registered users and 1 guest