OTG with own application

Forum about Opentherm, Hvac, House heating, Boilers

Moderator: hvxl

Post Reply
Jeroen001
Starting Member
Starting Member
Posts: 11
Joined: Fri Nov 07, 2014 4:41 pm

OTG with own application

Post by Jeroen001 »

I use the OTG with the OT Monitor program running on a Raspberry.

Is it possible to get the current values (e.g. room temperature) and to send commands (e.g. room temparature up 1 degree) by (http) commands from an other application?
Does the OTG support an API?

Regards, Jeroen.
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: OTG with own application

Post by mike7 »

Check http://<your gw ip>:8080/userpages.html
ThinkPad
Member
Member
Posts: 75
Joined: Sat Nov 15, 2014 1:49 pm

Re: OTG with own application

Post by ThinkPad »

mike7 wrote:Check http://<your gw ip>:8080/userpages.html
That's cool! The command function is really great! I can now easily override the setpoint of my thermostat with a simple HTTP-request.

But..... what about the 'PS=1' command? That doesn't show any output in the browser, just the PS=1 command is shown. Would be great if the output of the PS=1 command would also return output in the browser. Retrieving the OTGW-data is much easier then, for example with a PHP-script running on a webserver on a different machine.
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: OTG with own application

Post by mike7 »

I don't use PS=1

Schelte provides support fot OTGW and monitor in another forum http://www.domoticaforum.eu/viewforum.php?f=75
ThinkPad
Member
Member
Posts: 75
Joined: Sat Nov 15, 2014 1:49 pm

Re: OTG with own application

Post by ThinkPad »

I have opened an own topic about the PS=1 webpage output: http://www.domoticaforum.eu/viewtopic.php?f=75&t=10862
Jeroen001
Starting Member
Starting Member
Posts: 11
Joined: Fri Nov 07, 2014 4:41 pm

Re: OTG with own application

Post by Jeroen001 »

Great. Thanks for the info.
Jeroen001
Starting Member
Starting Member
Posts: 11
Joined: Fri Nov 07, 2014 4:41 pm

Re: OTG with own application

Post by Jeroen001 »

Ok. I get the JSON information from OTG with the following LUA code:

local IP = "xxx.xxx.xxx.xx"
local Port = "8080"

OpenTherm = Net.FHttp(IP,Port)
response = OpenTherm:GET("/json")
fibaro:debug(response)

The response is: { "otgw": { "time": "2015-11-20 22:06:18 +0100", "firmware": { "name": "Opentherm Gateway", "version": "4.2.3" }, "software": { "name": "Opentherm Monitor", "version": "4.2" } }, "flame": { "value": "0", "description": "Flame status" }, "dhwmode": { "value": "0", "description": "Domestic hot water mode" }, "chmode": { "value": "1", "description": "Central heating mode" }, "dhwenable": { "value": "1", "description": "Domestic hot water enable" }, "diag": { "value": "0", "description": "Diagnostic indication" }, "fault": { "value": "0", "description": "Fault indication" }, "temperature": { "value": "20.38", "description": "Room temperature" }, "setpoint": { "value": "20.50", "description": "Room setpoint" }, "modulation": { "value": "0.00", "description": "Relative modulation level" }, "boilertemp": { "value": "62.59", "description": "Boiler water temperature" }, "controlsp": { "value": "36.40", "description": "Control setpoint" }, "maxmod": { "value": "100.00", "description": "Max relative modulation level" } }

How do I get the current room temperature value in a variable (20.38 degrees)?

I tried the following code:

jsonTable = json.decode(response)
kamerTemp = jsonTable.temperature
fibaro:debug(kamerTemp)

Then I get an error: [ERROR] 22:08:04: line :debug (arg 2), expected 'string const &' got 'nil'
Post Reply

Return to “Hvac, Heating Opentherm Forum”