Page 2 of 3

Re: OTGW with MQTT and Node Red.

Posted: Wed Jan 11, 2023 9:52 am
by mike7
According to timestamp returnwatertemperature is very old (retained ?). I suggest to install MQTT Explorer.
Remove from MQTT Explorer all topics related to otmonitor and restart it. Then check with MQTT Explorer structure of topics.

Re: OTGW with MQTT and Node Red.

Posted: Wed Jan 11, 2023 2:52 pm
by mwtheplumber
On the MQTT explorer I can see that boilerwatertemperature is being transmitted but doesn't change. If I use the Windows version of OTGW it all works fine so I assume it is a bug in the Raspberry Pi version.

Re: OTGW with MQTT and Node Red.

Posted: Wed Jan 11, 2023 7:13 pm
by mike7
There are no such bug in armf or aarch64 version of otmotitor, all versions use the same tcl code. Only runtime is different.
Please compare you configuration for windows and raspi.

boilerwatertemperature shouldn't be retained, please check. Try to remove the whole tree of event/# topic from MQTT Explorer.

Re: OTGW with MQTT and Node Red.

Posted: Wed Jan 11, 2023 8:58 pm
by mwtheplumber
Thanks Mike, I will have a look.

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 1:37 pm
by mwtheplumber
On further investigation of this I can see that with the windows desktop version everything works fine. On the RaspberryPi version, the boiler water temperature is transmitted once via MQTT, then never transmitted again. I have double checked the MQTT settings in both instances and they are identical.

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 2:25 pm
by mike7
I think the value of boilerwatertemperature is retained in your case, I have no idea why. Which mqtt broker are in use?

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 2:49 pm
by mwtheplumber
I have tried two different MQTT brokers, Mosquitto and HiveMQ. The results are the same.

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 2:49 pm
by mike7
Please describe how do you run otmonitor on rpi, command line, content of configuration file.

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 4:24 pm
by mwtheplumber
I followed the instructions at https://otgw.tclcode.com/raspi.html to run headless set up. OTmonitor starts automatically on reboot.

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 4:48 pm
by mike7
OK, lets continue without details of configuration...
Assume you are using mosquitto ...

please run mosquitto_sub on the same rpi on which you are running otmonitor:

mosquitto_sub -h <broker ip> -p <broker port> -u <username> --pw <password> -t events/#

<broker ip> <broker port> must be the same as for otmonitor (that is the reason why I asked for a content of config file)

Log from the broker also will be usefull..

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 5:12 pm
by mwtheplumber
Does this help?
Sorry I wasn't sure what config file you were referring to

{"name":"on","type":"boolean","value":true,"timestamp":1674313021303}
{"name":"on","type":"boolean","value":true,"timestamp":1674158019990}
{"name":"on","type":"boolean","value":false,"timestamp":1674158020042}
{"name":"on","type":"boolean","value":true,"timestamp":1674311170378}
{"name":"on","type":"boolean","value":false,"timestamp":1674311170382}
{"name":"on","type":"boolean","value":false,"timestamp":1674313111518}
{"name":"on","type":"boolean","value":false,"timestamp":1674158020046}
{"name":"on","type":"boolean","value":false,"timestamp":1674158020047}
{"name":"on","type":"boolean","value":false,"timestamp":1674158020048}
{"name":"on","type":"boolean","value":false,"timestamp":1674158020048}
{"name":"temp","type":"float","value":63.00,"timestamp":1674313018008}
{"name":"temp","type":"float","value":48.00,"timestamp":1674168123454}
{"name":"temp","type":"float","value":63.00,"timestamp":1674168123919}
{"name":"level","type":"float","value":0.00,"timestamp":1674312952639}
{"name":"temp","type":"float","value":20.00,"timestamp":1674168127071}
{"name":"temp","type":"float","value":20.00,"timestamp":1674232052067}
{"name":"level","type":"float","value":0.00,"timestamp":1674310480454}
{"name":"temp","type":"float","value":0.00,"timestamp":1674168130949}
{"name":"temp","type":"float","value":40.44,"timestamp":1674313502576}
{"name":"temp","type":"float","value":5.03,"timestamp":1674313201802}
{"name":"rate","type":"float","value":0.00,"timestamp":1674310482648}
{"name":"bar","type":"float","value":1.03,"timestamp":1674313443735}
{"name":"count","type":"unsigned","value":18096,"timestamp":1674313132561}
{"name":"count","type":"unsigned","value":6511,"timestamp":1674308480854}
{"name":"count","type":"unsigned","value":287,"timestamp":1674232592147}
{"name":"mode","type":"string","value":"low","timestamp":1674214576168}
{"name":"temp","type":"float","value":0.00,"timestamp":1673634130333}
{"name":"temp","type":"float","value":64.83,"timestamp":1674168128851}
{"name":"temp","type":"float","value":40.45,"timestamp":1674313564118}
{"name":"level","type":"float","value":100.00,"timestamp":1674313596976}
{"name":"temp","type":"float","value":40.44,"timestamp":1674313623634}
{"name":"bar","type":"float","value":1.02,"timestamp":1674313625232}
{"name":"temp","type":"float","value":40.48,"timestamp":1674313684067}
{"name":"bar","type":"float","value":1.03,"timestamp":1674313685663}
{"name":"on","type":"boolean","value":true,"timestamp":1674313712634}
{"name":"count","type":"unsigned","value":18097,"timestamp":1674313740679}
{"name":"temp","type":"float","value":40.51,"timestamp":1674313743996}
{"name":"temp","type":"float","value":5.12,"timestamp":1674313744500}
{"name":"bar","type":"float","value":1.02,"timestamp":1674313745596}
{"name":"temp","type":"float","value":40.53,"timestamp":1674313804431}
{"name":"temp","type":"float","value":5.15,"timestamp":1674313805031}
{"name":"bar","type":"float","value":1.03,"timestamp":1674313806032}
{"name":"on","type":"boolean","value":false,"timestamp":1674313808735}
{"name":"level","type":"float","value":0.00,"timestamp":1674313817283}
{"name":"on","type":"boolean","value":false,"timestamp":1674313817867}
{"name":"temp","type":"float","value":10.00,"timestamp":1674313819440}

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 6:14 pm
by mike7
Lets format the output from mosquitto_sub with "-F '%r %t : %p'"

So, run the following command:
mosquitto_sub -h <broker ip> -p <broker port> -u <username> --pw <password> -t events/# -F '%r %t : %p'

Output should look like this one:

Code: Select all

1 events/central_heating/otmonitor/chenable : {"name":"on","type":"boolean","value":true,"timestamp":1674213459326}
1 events/central_heating/otmonitor/dhwenable : {"name":"on","type":"boolean","value":false,"timestamp":1674172643644}
1 events/central_heating/otmonitor/fault : {"name":"on","type":"boolean","value":false,"timestamp":1674172659869}
1 events/central_heating/otmonitor/centralheating : {"name":"on","type":"boolean","value":true,"timestamp":1674314321069}
1 events/central_heating/otmonitor/hotwater : {"name":"on","type":"boolean","value":false,"timestamp":1674172645527}
1 events/central_heating/otmonitor/flame : {"name":"on","type":"boolean","value":true,"timestamp":1674314419495}
1 events/central_heating/otmonitor/cooling : {"name":"on","type":"boolean","value":false,"timestamp":1673208884737}
1 events/central_heating/otmonitor/centralheating2 : {"name":"on","type":"boolean","value":false,"timestamp":1673208884738}
1 events/central_heating/otmonitor/diagnostic : {"name":"on","type":"boolean","value":false,"timestamp":1673208884739}
1 events/central_heating/otmonitor/electricity : {"name":"on","type":"boolean","value":false,"timestamp":1674172645528}
1 events/central_heating/otmonitor/controlsetpoint : {"name":"temp","type":"float","value":36.00,"timestamp":1674316897886}
1 events/central_heating/otmonitor/modulation : {"name":"level","type":"float","value":19.00,"timestamp":1674316900224}
1 events/central_heating/otmonitor/returnwatertemperature : {"name":"temp","type":"float","value":30.40,"timestamp":1674316888101}
1 events/central_heating/otmonitor/setpoint : {"name":"temp","type":"float","value":16.00,"timestamp":1673208905652}
1 events/central_heating/otmonitor/roomtemperature : {"name":"temp","type":"float","value":15.70,"timestamp":1674316846807}
1 events/central_heating/otmonitor/chwaterdeltat : {"name":"temp","type":"float","value":6.49,"timestamp":1674316897076}
1 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.89,"timestamp":1674316897078}
1 events/central_heating/otmonitor/dhwtemperature : {"name":"temp","type":"float","value":21.00,"timestamp":1674316108812}
1 events/central_heating/otmonitor/outsidetemperature : {"name":"temp","type":"float","value":-3.00,"timestamp":1674314111441}
1 events/central_heating/otmonitor/exhausttemperature : {"name":"temp","type":"float","value":35.00,"timestamp":1674316895278}
1 events/central_heating/otmonitor/dhwsetpoint : {"name":"temp","type":"float","value":35.00,"timestamp":1674213464269}
1 events/central_heating/otmonitor/chsetpoint : {"name":"temp","type":"float","value":80.00,"timestamp":1673208887792}
1 events/central_heating/otmonitor/chwaterpresure : {"name":"bar","type":"float","value":1.30,"timestamp":1674315250977}
1 events/central_heating/otmonitor/remoteoverrideroomsetpoint : {"name":"temp","type":"float","value":0.00,"timestamp":1673208893221}
1 events/central_heating/otmonitor/maxmodulation : {"name":"level","type":"float","value":100.00,"timestamp":1673208894912}
1 events/central_heating/otmonitor/dhwflowrate : {"name":"rate","type":"float","value":0.00,"timestamp":1673252435865}
1 events/central_heating/otmonitor/chburnerstarts : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435869}
1 events/central_heating/otmonitor/chpumpstarts : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435871}
1 events/central_heating/otmonitor/dhwpumpstarts : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435872}
1 events/central_heating/otmonitor/dhwburnerstarts : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435874}
1 events/central_heating/otmonitor/chburnerhours : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435875}
1 events/central_heating/otmonitor/chpumphours : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435876}
1 events/central_heating/otmonitor/dhwpumphours : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435878}
1 events/central_heating/otmonitor/dhwburnerhours : {"name":"count","type":"unsigned","value":0,"timestamp":1673252435879}
1 events/central_heating/otmonitor/thermostat : {"name":"connected","type":"boolean","value":true,"timestamp":1673070408443}
0 events/central_heating/otmonitor/modulation : {"name":"level","type":"float","value":17.00,"timestamp":1674316903829}
0 events/central_heating/otmonitor/error : {"name":"code","type":"byte","value":3,"timestamp":1674316904665}
0 events/central_heating/otmonitor/chwaterdeltat : {"name":"temp","type":"float","value":6.39,"timestamp":1674316908961}
0 events/central_heating/otmonitor/returnwatertemperature : {"name":"temp","type":"float","value":30.50,"timestamp":1674316908962}
0 events/central_heating/otmonitor/roomtemperature : {"name":"temp","type":"float","value":15.80,"timestamp":1674316912462}
0 events/central_heating/otmonitor/chwaterdeltat : {"name":"temp","type":"float","value":6.20,"timestamp":1674316914383}
0 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.70,"timestamp":1674316914384}
0 events/central_heating/otmonitor/dhwtemperature : {"name":"temp","type":"float","value":20.89,"timestamp":1674316916171}
0 events/central_heating/otmonitor/chwaterdeltat : {"name":"temp","type":"float","value":6.10,"timestamp":1674316921560}
0 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.60,"timestamp":1674316921561}
0 events/central_heating/otmonitor/chwaterdeltat : {"name":"temp","type":"float","value":5.90,"timestamp":1674316930476}
0 events/central_heating/otmonitor/returnwatertemperature : {"name":"temp","type":"float","value":30.70,"timestamp":1674316930477}
Where first 1 or 0 indicates retain flag. As you can see in my log, first boilerwatertemperature is retained, but the second is not.
You can try with -t events/central_heating/otmonitor/boilerwatertemperature and should receive something like:

Code: Select all

1 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.70,"timestamp":1674317205461}
0 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.60,"timestamp":1674317309360}
0 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.50,"timestamp":1674317431090}
0 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":36.60,"timestamp":1674317495607}
PS I asked for the content of .otmonitorrc file which is default configuration file for otmonitor

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 7:44 pm
by mwtheplumber
1 events/central_heating/otmonitor/chenable : {"name":"on","type":"boolean","value":true,"timestamp":1674322108983}
1 events/central_heating/otmonitor/dhwenable : {"name":"on","type":"boolean","value":true,"timestamp":1674158019990}
1 events/central_heating/otmonitor/fault : {"name":"on","type":"boolean","value":false,"timestamp":1674158020042}
1 events/central_heating/otmonitor/centralheating : {"name":"on","type":"boolean","value":true,"timestamp":1674311170378}
1 events/central_heating/otmonitor/hotwater : {"name":"on","type":"boolean","value":false,"timestamp":1674311170382}
1 events/central_heating/otmonitor/flame : {"name":"on","type":"boolean","value":true,"timestamp":1674322818647}
1 events/central_heating/otmonitor/cooling : {"name":"on","type":"boolean","value":false,"timestamp":1674158020046}
1 events/central_heating/otmonitor/centralheating2 : {"name":"on","type":"boolean","value":false,"timestamp":1674158020047}
1 events/central_heating/otmonitor/diagnostic : {"name":"on","type":"boolean","value":false,"timestamp":1674158020048}
1 events/central_heating/otmonitor/electricity : {"name":"on","type":"boolean","value":false,"timestamp":1674158020048}
1 events/central_heating/otmonitor/controlsetpoint : {"name":"temp","type":"float","value":63.00,"timestamp":1674322110554}
1 events/central_heating/otmonitor/dhwsetpoint : {"name":"temp","type":"float","value":48.00,"timestamp":1674168123454}
1 events/central_heating/otmonitor/chsetpoint : {"name":"temp","type":"float","value":63.00,"timestamp":1674168123919}
1 events/central_heating/otmonitor/maxmodulation : {"name":"level","type":"float","value":100.00,"timestamp":1674322686648}
1 events/central_heating/otmonitor/roomtemperature : {"name":"temp","type":"float","value":20.00,"timestamp":1674168127071}
1 events/central_heating/otmonitor/setpoint : {"name":"temp","type":"float","value":20.00,"timestamp":1674232052067}
1 events/central_heating/otmonitor/modulation : {"name":"level","type":"float","value":0.00,"timestamp":1674310480454}
1 events/central_heating/otmonitor/remoteoverrideroomsetpoint : {"name":"temp","type":"float","value":0.00,"timestamp":1674168130949}
1 events/central_heating/otmonitor/dhwtemperature : {"name":"temp","type":"float","value":36.48,"timestamp":1674322867793}
1 events/central_heating/otmonitor/outsidetemperature : {"name":"temp","type":"float","value":1.31,"timestamp":1674322868393}
1 events/central_heating/otmonitor/dhwflowrate : {"name":"rate","type":"float","value":0.00,"timestamp":1674310482648}
1 events/central_heating/otmonitor/chwaterpresure : {"name":"bar","type":"float","value":1.02,"timestamp":1674322869396}
1 events/central_heating/otmonitor/chburnerstarts : {"name":"count","type":"unsigned","value":18108,"timestamp":1674322135475}
1 events/central_heating/otmonitor/chburnerhours : {"name":"count","type":"unsigned","value":6513,"timestamp":1674321893545}
1 events/central_heating/otmonitor/dhwburnerhours : {"name":"count","type":"unsigned","value":287,"timestamp":1674232592147}
1 events/central_heating/otmonitor/powermode : {"name":"mode","type":"string","value":"low","timestamp":1674214576168}
1 events/central_heating/otmonitor/controlsetpoint2 : {"name":"temp","type":"float","value":0.00,"timestamp":1673634130333}
1 events/central_heating/otmonitor/boilerwatertemperature : {"name":"temp","type":"float","value":64.83,"timestamp":1674168128851}
Where do I find the .otmonitorrc file ?

Re: OTGW with MQTT and Node Red.

Posted: Sat Jan 21, 2023 9:02 pm
by mike7
There are no any new messages from otmonitor, you should receive output with 0 at the beginning of the line.
From your log:
all values are very old (from yesterday) and all of them are retained.

I'm using another way to run otmonitor, may be in your case .otmonitorrc will be in /root or /home/pi (I'm not sure).
Lets try from GUI...
The dataflow is:
otmonitor -> MQTT -> mosquitto_sub

- Run otmonitor on rpi
- Connect from browser and check messages in "Messages" tab (you should see the continues stream of messages)
- Open "Configure" window and check MQTT settings
- Post a screenshot with settings
- run mosquitto_sub on rpi with the connection to the same broker
- Post executed command
- Wait for output started with 0

What we are checking? Otmonitor and mosquitto_sub should be connected to the same broker.
If you will receive no messages started with 0 - check broker log for client connection. You should find connections from both otmonitor and mosquitto_sub.

Re: OTGW with MQTT and Node Red.

Posted: Sun Jan 22, 2023 12:41 pm
by mwtheplumber
2023-01-22 3.jpg
2023-01-22 3.jpg (112.95 KiB) Viewed 5196 times
This screen shot shows the MQTT set up for Windows version of Otmonitor (right) and RPI (left). From the mosquitto_sub, I can see that boilerwatertemperature is transmitted to MQTT as expected when running windows version, but when running RPI version although I can see the boilerwatertemperature change on the messages in otmonitor, it never gets transmitted after the initial transmission to MQTT.

This is output on windows version.

0 events/central_heating/otmonitor/boilerwatertemperature :{"name":"temp","type":"float","value":48.85,"timestamp":1674383826916}
0 events/central_heating/otmonitor/boilerwatertemperature :{"name":"temp","type":"float","value":48.79,"timestamp":1674383830108}
0 events/central_heating/otmonitor/dhwtemperature :{"name":"temp","type":"float","value":40.42,"timestamp":1674383832293}
0 events/central_heating/otmonitor/outsidetemperature :{"name":"temp","type":"float","value":0.31,"timestamp":1674383832810}
0 events/central_heating/otmonitor/boilerwatertemperature :{"name":"temp","type":"float","value":48.78,"timestamp":1674383835596}
0 events/central_heating/otmonitor/boilerwatertemperature :{"name":"temp","type":"float","value":48.74,"timestamp":1674383839895}