Page 3 of 3

Re: OTGW with MQTT and Node Red.

Posted: Sun Jan 22, 2023 7:25 pm
by mike7
OK, so otmonitor can't connect to mqtt broker. "First" messages in your case are not messages from raspberry otmonitor they are last messages from windows one (otmonitor sends retained messages).

Re: OTGW with MQTT and Node Red.

Posted: Sun Jan 22, 2023 9:02 pm
by mike7
I want to ask my question again, do you see a stream (log) of messages in "Messages" tab of otmonitor?
Screenshot 2023-01-22 at 21.57.00.png
Screenshot 2023-01-22 at 21.57.00.png (216.82 KiB) Viewed 2859 times
If it is OK then check broker log for connection, looks like something wrong with your setup.

Re: OTGW with MQTT and Node Red.

Posted: Sun Jan 22, 2023 9:52 pm
by mwtheplumber
Yes, I see the messages in the Messages tab.
2023-01-22 (3).jpg
2023-01-22 (3).jpg (222.19 KiB) Viewed 2849 times

Re: OTGW with MQTT and Node Red.

Posted: Sun Jan 22, 2023 10:29 pm
by mike7
I think otmonitor is not connected to the broker. How did you run otmonitor, with cron on reboot?

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 12:13 am
by mwtheplumber
The otmonitor is connected to the broker as I get some of the other messages.
e,g chenable, hotwater, flame, controlsetpoint, maxmodulation, modulation, dhwtemperature, outsidetemperature, dhwflowrate, chwaterpressure, chburnerstarts, chburnerhours, error.

Other messages show as retained and do not get updated on MQTT, these include boilerwatertemperature, dhwenable, chsetpoint.

I have verified the above with MQTT explorer.

otmonitor is run with cron on reboot, as is mosquitto.

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 7:39 am
by mike7
Do you receive any messages started with 0 from mosquitto_sub when running otmonitor on rpi?

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 10:11 am
by mwtheplumber
Yes

Code: Select all

0 events/central_heating/otmonitor/dhwtemperature : {"name":"temp","type":"float","value":41.32,"timestamp":1674461350950}
0 events/central_heating/otmonitor/outsidetemperature : {"name":"temp","type":"float","value":-2.57,"timestamp":1674461351546}
0 events/central_heating/otmonitor/dhwtemperature : {"name":"temp","type":"float","value":41.28,"timestamp":1674461411482}
0 events/central_heating/otmonitor/outsidetemperature : {"name":"temp","type":"float","value":-2.55,"timestamp":1674461411981}
0 events/central_heating/otmonitor/chwaterpresure : {"name":"bar","type":"float","value":1.05,"timestamp":1674461413081}


Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 11:10 am
by mike7
It is very strange, may be you need to clean reinstall otmonitor.

I suggest the following way:
stop otmonitor
backup and delete your current version of otmonitor
backup and delete .otmonitorrc (I hope it located in /home/pi directory)
cd ~
git clone https://github.com/hvxl/otmonitor.git
wget http://otgw.tclcode.com/download/tclkit-ahf (or http://otgw.tclcode.com/download/tclkit-aarch64 if you use 64-bit version)
chmod a+x tclkit-ahf

and run:
./tclkit-ahf otmonitor/otmonitor.vfs/main.tcl --daemon -w 8880

then connect with browser and perform setup, configuration will be saved in .otmonitorrc file in /home/pi directory

I'm using otmonitor with mqtt on rpi for many years.

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 5:12 pm
by mwtheplumber
Mike,
Thank you, that looks to have worked. I will keep an eye on it.

I appreciate all your help with this.

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 7:11 pm
by mike7
Which version of PiOS are you using? I suggest to run mosquitto, Node-RED, otmonitor etc as systemd services. Also you can use docker with help of docker-compose or without.

PS couple of weeks ago I started Home Assistant and run otmonitor as add-on. Node-RED also can run as add-on for Home Assistant ...

Re: OTGW with MQTT and Node Red.

Posted: Mon Jan 23, 2023 11:12 pm
by hvxl
Nice to see users helping each other. Thanks Mike!

Seeing the discussion, I guess OTmonitor could do with a method to see if it successfully connected to the MQTT broker.