Send OTGW command from bash script

For OpenTherm-gateway related questions in Domoticz

Moderator: leecollings

Post Reply
mrblond18
Posts: 9
Joined: Monday 21 December 2015 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: netherlands
Contact:

Send OTGW command from bash script

Post 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!
ThinkPad
Posts: 890
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 »

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.
I am not active on this forum anymore.
mrblond18
Posts: 9
Joined: Monday 21 December 2015 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: netherlands
Contact:

Re: Send OTGW command from bash script

Post 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?
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Send OTGW command from bash script

Post 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?
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Send OTGW command from bash script

Post 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!
Hans
ernorv
Posts: 17
Joined: Sunday 13 November 2016 10:42
Target OS: -
Domoticz version:
Contact:

Re: Send OTGW command from bash script

Post 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.
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Send OTGW command from bash script

Post by Derik »

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: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest