Send OTGW command from bash script

For OpenTherm-gateway related questions in Domoticz
Post Reply
mrblond18
Posts: 8
Joined: Monday 21 December 2015 12:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Send OTGW command from bash script

Post by mrblond18 » Monday 15 February 2016 11:10

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!

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Send OTGW command from bash script

Post by ThinkPad » Monday 15 February 2016 11:33

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.
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

mrblond18
Posts: 8
Joined: Monday 21 December 2015 12:40
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Send OTGW command from bash script

Post by mrblond18 » Monday 15 February 2016 14:14

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?

mvzut
Posts: 271
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Re: Send OTGW command from bash script

Post by mvzut » Tuesday 23 February 2016 16:44

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?
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

manjh
Posts: 166
Joined: Saturday 27 February 2016 13:49
Target OS: Windows
Domoticz version:
Contact:

Re: Send OTGW command from bash script

Post by manjh » Thursday 04 August 2016 17:03

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!
Hans

ernorv
Posts: 17
Joined: Sunday 13 November 2016 11:42
Target OS: -
Domoticz version:
Contact:

Re: Send OTGW command from bash script

Post by ernorv » Sunday 20 November 2016 9:43

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.

User avatar
Derik
Posts: 1778
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Send OTGW command from bash script

Post by Derik » Sunday 20 November 2016 11:54

perhaps use the new setpoint in Blockley...
Works great.
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Send OTGW command from bash script

Post by stlaha2007 » Friday 25 November 2016 22:14

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests