using ds18b20 for return water temp

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

Moderator: hvxl

jap
Starting Member
Starting Member
Posts: 1
Joined: Thu Sep 24, 2015 11:23 pm

using ds18b20 for return water temp

Post 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
hvxl
Senior Member
Senior Member
Posts: 1987
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: using ds18b20 for return water temp

Post 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.
Schelte
leander
Starting Member
Starting Member
Posts: 1
Joined: Sat Feb 06, 2016 8:28 am
Location: Den Haag

Re: using ds18b20 for return water temp

Post 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:
blb
Member
Member
Posts: 145
Joined: Fri Nov 19, 2010 2:01 pm

Re: using ds18b20 for return water temp

Post 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.
Bernard
rjblake
Starting Member
Starting Member
Posts: 19
Joined: Fri Dec 09, 2016 12:37 am
Location: Den Haag

Re: using ds18b20 for return water temp

Post 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/)
butyl
Starting Member
Starting Member
Posts: 9
Joined: Wed Jan 11, 2017 2:39 pm

Re: using ds18b20 for return water temp

Post 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
Butyl
blb
Member
Member
Posts: 145
Joined: Fri Nov 19, 2010 2:01 pm

Re: using ds18b20 for return water temp

Post by blb »

rjblake, butyl, thanks for both options, I'll have a look at both.
Bernard
oipmok
Starting Member
Starting Member
Posts: 5
Joined: Sun Dec 03, 2017 7:27 pm

Re: using ds18b20 for return water temp

Post by oipmok »

Anyone has a compiler 4.2.5 gateway.hex code with this mod ?
WimN
Starting Member
Starting Member
Posts: 28
Joined: Wed Apr 03, 2019 10:37 am

Re: using ds18b20 for return water temp

Post 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!!!
WimN
Starting Member
Starting Member
Posts: 28
Joined: Wed Apr 03, 2019 10:37 am

Re: using ds18b20 for return water temp

Post 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
hvxl
Senior Member
Senior Member
Posts: 1987
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: using ds18b20 for return water temp

Post by hvxl »

The status hasn't changed. I still have no intention to add this to the standard firmware.
Schelte
WimN
Starting Member
Starting Member
Posts: 28
Joined: Wed Apr 03, 2019 10:37 am

Re: using ds18b20 for return water temp

Post by WimN »

It would be a great option for boilers that do not report the return water temperature.
hvxl
Senior Member
Senior Member
Posts: 1987
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: using ds18b20 for return water temp

Post 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.
Schelte
WimN
Starting Member
Starting Member
Posts: 28
Joined: Wed Apr 03, 2019 10:37 am

Re: using ds18b20 for return water temp

Post 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!
WimN
Starting Member
Starting Member
Posts: 28
Joined: Wed Apr 03, 2019 10:37 am

Re: using ds18b20 for return water temp

Post 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!
Post Reply

Return to “Opentherm Gateway Forum”