2 zone system setup - firmware modification

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

Moderator: hvxl

Post Reply
bmellink
Starting Member
Starting Member
Posts: 6
Joined: Thu Oct 20, 2016 1:36 pm

2 zone system setup - firmware modification

Post by bmellink »

[ The right title is: "Multi zone system setup (with NEST + on/off thermostat" ]

My central heating system has 2 zones:
Zone 1: main part of house with thermostat in the living room - the thermostat can open/close a electric valve towards the floor heating
Zone 2: basement area - with traditional on/off thermostat - a second thermostat can open/close a second electric valve here
Until now I used traditional on/off thermostats and some relais to ensure either one or the other thermostats force the boiler to turn on when heating was required.

I want to switch over to OpenTherm and bought a NEST as thermostat in the living room and switch off the valve for the water towards the living room (permanent open). The NEST is now directly linked to the boiler using OpenTherm (all working fine for the living room). But this means the second thermostat (on the basement) can no longer tell the boiler it needs to be turned on. Key question is: how to fix this?

My idea is the following:
- Use the OpenTherm GW between the NEST and the boiler
- Connect the valve in the living room to the first GPIO connection of the gateway (configured as output - will need some electronics to boost the signals)
- Connect the on/off switch thermostat of the basement to the other GPIO signal (configured as input)
- Modify the firmware to do the following:
* when the NEST in the living room needs heating, the signals are passed on as normal to the boiler and the gateway ensures the valve signal is turned on (GPIO pin on), so we also have warm water flowing that way. The valve will be closed when the NEST no longer requires heating (GPIO pin off)
* when the on/off thermostat in the basement needs heating, it will turn on the value there (existing cabling + relais does this already) and signals the gateway (second GPIO pin) to increase the water temperature (overriding the NEST valves)

Anybody that has done something similar?
I guess this could be done with a Domoticz script, but I rather have the logic inside a single device that is always turned on.

I think the firware changes are limited. Would this be a nice change to the firmware?

regards

Bart
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: 2 zone system setup - firmware modification

Post by Bwired »

is the Nest opentherm updated? the last opentherm Nest i tested with the OTGW was not so good, only half opentherm
missed a lot of things
http://www.domoticaforum.eu/viewtopic.php?f=75&t=10897
bmellink
Starting Member
Starting Member
Posts: 6
Joined: Thu Oct 20, 2016 1:36 pm

Re: 2 zone system setup - firmware modification

Post by bmellink »

The NEST received firmware upgrades after installation. I will run a log and post, but I suggest I post any on that as reply in http://www.domoticaforum.eu/viewtopic.php?f=75&t=10897 as this topic is not about the NEST but about making a 2 zone system.

On this topic: The bottom line is I think I need is just 2 extra GA/GB commands:

Command 8: When GPIO is pulled low, force a execution as if the CS command is executed with a preconfigured EEPROM value. Maybe just use the value stored in SH (setpoint heating). When GPIO is pulled high force a CS=0
Command 9: GPIO will reflect if the thermostat requests heat from boiler (probably modulation level>0) = 1 or when no heat is required = 0. What would be a good indicator?

any other suggestions?
bmellink
Starting Member
Starting Member
Posts: 6
Joined: Thu Oct 20, 2016 1:36 pm

Re: 2 zone system setup - firmware modification

Post by bmellink »

Just for information. Here is the way I managed to get all of this to work (for those that are interested):

NEST heatlink (for zone 1):
- OpenTherm interface of the heatlink connects to Gateway (regular install)
- The NEST heatlink also has a relais contact (request heat from boiler). I connected this to a electric valve + 24 V AC transformer to open/close the warm water to the living room (zone 1) with the NEST boiler. This ensures the living room will not be heated when the 2nd zone kicks in

Second on/off thermostat in zone 2:
- This one is connected to a +24V AC transformer to open/close the warm water to the basement (zone 2) and also a relais
- The contacts of the relais are connected to the GPIO1 and GND pins of the gateway (with 1.5k pullup resister to the +5)

Gateway:
- Load modified firmware (see below) that changes the meaning of the GA/GB=5 command: Instead of changing the thermostat setpoint when the GPIO level changes, we change the controlsetpoint to the value stored in AwaySetpoint
- The modified firmware also forces MM=100 override with all commands from the NEST (normally the NEST uses the controlsetpoint to set the water temperature and sets the max modulation level either to 100 or 0 depending of the heat request status). We do not want the MM=0 to pass through to the boiler as we want to be able to warm zone 2 as well. The modified firmware sets MM=100 at reboot, so there is no need to issue that command on each reboot
- Use SB=50 to set the SetBack temperature. The changed firmware will use this value to set the controlsetpoint (50 as temperature is fine for me, but it can be changed as needed)
- Use the GA=5 command to program GPIO1 to listen to the relais from the thermostat in zone 2

End result is that each time the GPIO1 pin is pulled low by the on/off thermostat in zone2, the value stored in SB is used as target boiler water termperature. However, the gateway will send this information only when the NEST thermostat issues a Write-Data Control Setpoint command (which happens every 2:30 minutes)

Details on firmware modification (kudos to Schelte: this is extremely compact and efficient code. Great design!!)
Download here:
GW.X.production20161025S.hex.zip
Firmware version 4.2.4b modified GA5 command
(8.75 KiB) Downloaded 458 times
Near line 4433 in function gpio_coomon. Change the meaning of the GA/GB=5 and GA/GB=6 commands for the GPIO pin

Code: Select all

gpio_security	andwf	gpio_mask,W	;Apply the GPIO port mask 
		andlw	b'11000000'	;Clear the irrelevant bits
		skpz
		goto	gpio_armed	;Security system is armed
		btfss	gpioaway	;Did the port change since last check?
		return			;Nothing to do
		bcf	gpioaway	;Security system is disarmed
; ==== changed BM 28-10-2016 ====
; 		clrf	float1		;Cancel the remote setpoint
;		clrf	float2
		clrf	controlsetpt1	;BM clear control setpoint 
		clrf	controlsetpt2	
; ==== end change BM
		goto	gpio_setpoint	;W is 0
gpio_armed	btfsc	gpioaway	;Did the port change since last check?
		return			;Nothing to do
		bsf	gpioaway	;Security system is armed
		movlw	AwaySetpoint1	;EEPROM address of the away setpoint
		lcall	ReadEpromData	;Get the setpoint from EEPROM
; ==== changed BM 28-10-2016 ====
;		movwf	float1		;Configure the remote setpoint
		movwf	controlsetpt1	;BM configure control setpoint
; ==== end change BM
		movlw	AwaySetpoint2	;EEPROM address of the away setpoint
		call	ReadEpromData	;Get the setpoint from EEPROM
; ==== changed BM 28-10-2016 ====
;		movwf	float2		;Configure the remote setpoint
		movwf	controlsetpt2	;BM configure control setpoint
;		movlw	b'01'		;Temperature override mode: Continue
gpio_setpoint	;pcall	SetSetPoint	;Set setpoint
; ==== end change BM
		return
Around line 1093 in main startup (near label InitLoop1)

Code: Select all

		movlw	100
		movwf	MaxModLevel	;Initialize Max Modulation Level at 100%
;======= BM added 26 Oct 2016
		bsf	UserMaxModLevel	; force a 100% level  (required for NEST)
;=======
		movlw	ONESEC
		movwf	SecCounter	;Initialize second counter
Two more things on the NEST:
  • 1. NEST does not support reading and setting the room temperature. Not a huge problem, but it would be nice if these OpenTherm commands would be supported by NEST
    2. the NEST has two parts: Thermostat (in the room) and Heatlink (device next to boiler with OpenTherm wires). The two talk wirelessly. If for some reason the wireless connection is broken, the heatlink will maintain the OpenTherm protocol. However the "Write-Data Control Setpoint" commands are no longer issued. This means that the boiler no longer receives any updated data regarding the control setpoint and may decide to shutdown after some time out. The bottom line is that also zone 2 will no longer be heated.
Regards

Bart M
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: 2 zone system setup - firmware modification

Post by Bwired »

nice!
Post Reply

Return to “Opentherm Gateway Forum”