Page 1 of 1
Send OTGW command from bash script
Posted: Monday 15 February 2016 10:10
by mrblond18
Guys,
I recently installed an OTGW in my domoticz system. I specifically bought a Remeha iSense thermostat since the original designer of the OTGW used one as well.
I can temporary override the setpoint from the domoticz interface, nice! This is done with the TT command (e.g. TT=19)
I want to be able to send a constant setpoint override to the thermostat as well (e.g. TC=19). I read somewhere that this is not implemented in the domoticz gui. So I am trying to do this from a script (e.g. bash or python). But I can not get it to send such a command. Can somebody tell me how to do this?
Thanks in advance!
Re: Send OTGW command from bash script
Posted: Monday 15 February 2016 10:33
by ThinkPad
What is the reason you have the OTGW in Domoticz?
You could also run the otmonitor-daemon on your system, this daemon also has a onboard webserver with a page that accepts serial commands.
Then setting the TC would be something like
http://ip/command?TC=19
You could put that URL in the OnCommand of a virtual switch, or create a virtual thermostat and combine it with a Lua-script that sends the value of the virtual thermostat to that URL.
Re: Send OTGW command from bash script
Posted: Monday 15 February 2016 13:14
by mrblond18
Hi ThinkPad,
I used domoticz because I only had to add the OTGW to get all the functionality without writing scripts, etc. If your solution works I can use that as well, no biggie.
I tried the otgwmonitor. It works without a problem on my Win7 notebook. However on my headless RPi I can not get it to connect with the gateway. I can start it up, connect to the webinterface, but do not know how to let it connect to my gateway (/dev/ttyUSB1).
This is my config file:
web {
enable true
port 8081
nopass true
}
connection {
device /dev/ttyUSB1
type serial
enable true
}
server {
enable true
port 7686
relay true
}
I start the otgwmonitor as:
./otmonitor-ahf -f otmonitor.config --daemon
Message log stays empty (if domoticz is running or not)
Can you tell me what I am doing wrong?
Re: Send OTGW command from bash script
Posted: Tuesday 23 February 2016 15:44
by mvzut
I noticed that since one of the recent Domoticz (beta) updates, you can send commands to the OTGW from the hardware configuration panel (Setup > Hardware > OpenTherm Gateway > Setup). Does anybody know if this can also be used in a (LUA) script or via the JSON interface?
Re: Send OTGW command from bash script
Posted: Thursday 04 August 2016 17:03
by manjh
mvzut wrote:I noticed that since one of the recent Domoticz (beta) updates, you can send commands to the OTGW from the hardware configuration panel (Setup > Hardware > OpenTherm Gateway > Setup). Does anybody know if this can also be used in a (LUA) script or via the JSON interface?
Anyone? I have already tried a dummy device with a command, but can't get it to work.
It would be great if I could define a button with a OTGW command behind it!
Re: Send OTGW command from bash script
Posted: Sunday 20 November 2016 8:43
by ernorv
1) create a dummy device in the hardware tab
2) create a virtual device of the type 'Switch'
3) find the switch (normally it is already at your switches tab) and click Edit
4) under 'On Action' you can now program e.g. a setpoint to be used by the OTGW: e.g.
http://raspberrypi:8081/command?TC=19 and under the off action a command to revert back to the thermostat setpoint like
http://raspberrypi:8081/command?TC=0 (replace the raspberrypi part with your ip address where the OTGW daemon is running, assuming you already have that sorted off course)
works like a charm, in the messages tab I do see the command being issued.
Re: Send OTGW command from bash script
Posted: Sunday 20 November 2016 10:54
by Derik
perhaps use the new setpoint in Blockley...
Works great.
Re: RE: Re: Send OTGW command from bash script
Posted: Friday 25 November 2016 21:14
by stlaha2007
ernorv wrote:1) create a dummy device in the hardware tab
2) create a virtual device of the type 'Switch'
3) find the switch (normally it is already at your switches tab) and click Edit
4) under 'On Action' you can now program e.g. a setpoint to be used by the OTGW: e.g.
http://raspberrypi:8081/command?TC=19 and under the off action a command to revert back to the thermostat setpoint like
http://raspberrypi:8081/command?TC=0 (replace the raspberrypi part with your ip address where the OTGW daemon is running, assuming you already have that sorted off course)
works like a charm, in the messages tab I do see the command being issued.
Big Thanks.
Looked at several sites and probebly overlooked it completely.
Where did you spotted them?
Those url controlled commands are handy to create a selector switch with holiday/work-at-home/comfort etcetera.