Page 1 of 3

using ds18b20 for return water temp

Posted: Thu Sep 24, 2015 11:33 pm
by jap
Hi,

I have a OTGW sitting between my boiler and thermostat which is working great. (It's sending the data to my NAS so I have pretty graphs, and there's a tiny python script on the NAS fetching the outside temperature from my neighbour's weather station through Weather Underground and sending it to the OTGW, and the thermostat shows it in its display -- really liking this internet of things thing :) )

I would like to add one thing though: my boiler does not provide the return water temperature. As the OTGW is in the same closet as the boiler, I was thinking of mounting a ds18b20 to the return water pipe and connecting that to one of the GPIOs, and having the OTGW send the return water temperature to the thermostat. I haven't looked at the firmware sources yet, but would it be doable to add that functionality?

Jasper

Re: using ds18b20 for return water temp

Posted: Tue Oct 13, 2015 6:38 pm
by hvxl
The gateway already has the code necessary to do a temperature measurement. Changing that so the value is interpreted as the return water temperature rather than the outside temperature shouldn't be too hard if you're not totally hopeless at programming.

I can't help but wonder why you want this. You indicated you want to send the information to the thermostat. But thermostats generally don't need it to be able to control the room temperature. Some thermostats may have a menu option to report the temperature, but I doubt that you'll use that more than a few times.

Also before you start the work: Are you sure your boiler is unable to produce the value (it returns unknown dataID)? It could also be that your thermostat just doesn't request the data.

Re: using ds18b20 for return water temp

Posted: Sat Feb 06, 2016 9:02 am
by leander
I would also like to use a DS18B20 as a sensor attached to the GPIO port to measure the return water temperature.
My Boiler is either not measuring it at all or simply doesn't report it via opentherm. I've already tried sending the AA=28 command to the gateway.

It does not indeed make a whole lot of sense to only show the return temperature on the display of the thermostat.
What I would like to do, is to have the temperature reading sent via mqtt to my broker and from there I can put it in a graph that shows me the delta T.

Unfortunately, my assembler skills are very minimal, so changing the source code of the gateway myself is a bridge to far.

@hvxl, maybe you can consider putting in this functionality as a feature request :roll:

Re: using ds18b20 for return water temp

Posted: Mon Mar 06, 2017 12:41 am
by blb
I just started a new topic about exactly the same, so I deleted it. I would like this feature as well. The reason is My Heater/boiler doesn't provide Return water temperature via Opentherm. I have connected the gateway to my home automation system and I would like to monitor the return water to evaluate the efficiency of my CV installation. The difference between CV water temperature and return water temperature is an indication for the efficiency of the CV installation.

Re: using ds18b20 for return water temp

Posted: Mon Mar 13, 2017 3:43 pm
by rjblake
Or look at adding a cheap ESP8266 to do this - plenty of already created projects to do just that (e.g. instructables.com/id/Simple-Example-Ard ... 66DS18B20/ or http://robertoostenveld.nl/arduino-ds18b20/)

Re: using ds18b20 for return water temp

Posted: Mon Mar 13, 2017 3:45 pm
by butyl
If you are still interested in replacing "Outside temperature" to "Return water temperature" there are easy and complex way to do it. As hvxl mentioned, there is need to do some changes in the gateway code.
Easiest way to do this is to replace this three parts of source code:

Code: Select all

		goto	MessageID27	;Data ID 27
		goto	WordResponse	;Data ID 28

Code: Select all

MessageID27	btfsc	MsgResponse	;Do not modify a request
		btfss	OutsideTemp	;Do nothing if no outside temp available
		return
		btfsc	OutsideInvalid
		goto	messageinv
		call	messageack	;Turn request into acknowledgement
		movfw	outside1
		call	setbyte3
		movfw	outside2
		goto	setbyte4

Code: Select all

#define		outsideval1	valuestorage + 22
#define		outsideval2	valuestorage + 23
by this three parts:

Code: Select all

		goto	WordResponse	;Data ID 27
		goto	MessageID28	;Data ID 28

Code: Select all

MessageID28	btfsc	MsgResponse	;Do not modify a request
		btfss	OutsideTemp	;Do nothing if no outside temp available
		return
		btfsc	OutsideInvalid
		goto	messageinv
		call	messageack	;Turn request into acknowledgement
		movfw	outside1
		call	setbyte3
		movfw	outside2
		goto	setbyte4

Code: Select all

#define		outsideval1	valuestorage + 24
#define		outsideval2	valuestorage + 25
Finaly you need just compile it to hex file and upload to the otgw PIC. :D

Re: using ds18b20 for return water temp

Posted: Mon Mar 13, 2017 9:14 pm
by blb
rjblake, butyl, thanks for both options, I'll have a look at both.

Re: using ds18b20 for return water temp

Posted: Sun Jan 14, 2018 11:02 pm
by oipmok
Anyone has a compiler 4.2.5 gateway.hex code with this mod ?

Re: using ds18b20 for return water temp

Posted: Thu Apr 04, 2019 10:27 am
by WimN
According to Intergas my HRE30/36a boiler has no return water temperature sensor. They have a sensor 'S2' inside the heat exchanger, so that is not the same.
So I support the feature request to be able to connect a DS18B20 to the board and have that value reported to the otmonitor program.
My setup is running on a Rapsberry Pi3B+ and using Influx and Grafana to process the output. So if the measured temperature could be reported as the return water temperature that would be great!!!

Re: using ds18b20 for return water temp

Posted: Fri Dec 18, 2020 12:09 pm
by WimN
Any News about including this option to use the outside temperature sensor for measuring the return water temperature into the standard firmware of the OTGW? Doing the suggested firmware modification as shown looks somewhat complex and tricky....
Thanks

Re: using ds18b20 for return water temp

Posted: Fri Dec 18, 2020 4:52 pm
by hvxl
The status hasn't changed. I still have no intention to add this to the standard firmware.

Re: using ds18b20 for return water temp

Posted: Fri Dec 18, 2020 5:56 pm
by WimN
It would be a great option for boilers that do not report the return water temperature.

Re: using ds18b20 for return water temp

Posted: Fri Dec 18, 2020 7:41 pm
by hvxl
"Great option" is a massive exaggeration. It might be somewhere between pretty useless and marginally informative. As I mentioned before, thermostats generally have no need for this information. And only very few provide the possibility to show it to the user somewhere deep down in their menus.

This feature has way too little added value to include it in the standard firmware. Because that would also require a new command to select whether the sensor measures the outside temperature or return water temperature, plus a variable to keep track of that. And you'd probably want that setting to survive a reset, so it needs to be stored in eeprom. People who want this feature badly enough can implement the code change explained by butyl a few posts back.

The best I can possibly do is to add a pre-processor macro which, when defined, will produce firmware with the butyl changes. But if the instructions on how to do that manually are already too complicated for you, you probably also won't know what to do with a pre-processor macro.

Re: using ds18b20 for return water temp

Posted: Mon Dec 21, 2020 1:57 pm
by WimN
Ok, I understand there is more to it. I'm interested in this value to check if the generated heat by the boiler is dissipated by the system in a proper way. Now with a lot working at home I've installed a 'zone system' to be able to heat separate rooms. That all works fine but if the boiler only has to heat a single room even at the lowest modulation level it might provide too much heat. To keep an eye on this the return water temperature is also of interest.
Making changes in assembly can be very tricky and you break thing easily... But I can install the compiler download the source and try it....
But maybe you can have the alternative version on your website too so users might download it an use the OTmonitor program to load the new firmware into the controller.
Thanks!

Re: using ds18b20 for return water temp

Posted: Tue Dec 22, 2020 6:47 pm
by WimN
Downloaded MPLab, edited the code and compiled it. Then flashing the new firmware took some time. The otmonitor reported that it could not switch into programming mode and you had to reset the OTGW. After many attempts it started programming for about 15 minutes and then it worked!! I used the 2 pins on the board to reset the OTGW and not also the NodeMCU WiFi bridge. After mounting the temperature sensor I can see the temperature being reported!!
Thanks!