room temperature not in $gui array via html folder script

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
gda01
Starting Member
Starting Member
Posts: 6
Joined: Sun Oct 02, 2016 10:38 am

room temperature not in $gui array via html folder script

Post by gda01 »

Januari 2024 I upgraded the software on my Raspberry2B - OTGW implementation from Jessie to Bookworm and OTmonitor from 4.3 to 6.5, on a new SD card. Everything is working as was, except for one data item, the room temperature.

For temperature logging I collect the room temperature and outside temperature with an http request from the OTmonitor webserver. I created a script file in the html folder which returns me a json structure, using the methodology from iphone.html.tmpl.

Code: Select all

% global gui ;# request room and outside temperature from otmonitor
% array set val {
%	temperature	0
%	outside	0
% }
% foreach n [array names val] {
%     if {[info exists gui($n)]} {set val($n) $gui($n)}
% }
{"tempsensors":\[{"ts_id":3,"temp":$val(temperature)},{"ts_id":4,"temp":$val(outside)}\]}
This delivers me the outside temperature, but not the room temperature.

When I put the iphone.html.tmpl file in the html directory and do the iphone.html request, this shows the default room temperature value, but not the actual room temperature. Same issue when I copy the status.html.tmpl to the html directory. iphone and status show the correct room temperature value when not copied into the html directory.

On my Rpi-Jessie/ Otmonitor 4.3 implementation the next line works:

Code: Select all

{"tempsensors":\[{"ts_id":3,"temp":$gui(temperature)},{"ts_id":4,"temp":$gui(outside)}\]}
But on the Rpi-Bookworm/ Otmonitor 6.5 I get the next error message:

Code: Select all

errorinfo: can't read "gui(temperature)": no such element in array
    while executing
"subst {{"tempsensors":\[{"ts_id":3,"temp":$gui(temperature)},{"ts_id":4,"temp":$gui(outside)}\]}
}"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 "set # {}; $script; set #""
    (procedure "template" line 17)
    invoked from within
"template $body"
    (procedure "::wibble::zone::templatefile" line 8)
    invoked from within
"{*}$command $state"
    (procedure "getresponse" line 38)
    invoked from within
"getresponse $request"
So it looks in requests from the html directory the gui array has not the room temperature entry.
Happens this only with my implementation, or are more people experiencing this issue?

Anybody an idea for an hint ?
hvxl
Senior Member
Senior Member
Posts: 1967
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: room temperature not in $gui array via html folder script

Post by hvxl »

The internal name was changed from "temperature" to "roomtemp" 6 years ago.
Schelte
gda01
Starting Member
Starting Member
Posts: 6
Joined: Sun Oct 02, 2016 10:38 am

Re: room temperature not in $gui array via html folder script

Post by gda01 »

Thanks, that solves the issue. (My previous OTmonitor implementation dates from 2016).
Post Reply

Return to “Opentherm Gateway Forum”