Guru needed please:- multi-zone , multi-temp heating automation

1 more thing, this ‘central heating’, is this going to just be an input boolean? Or is this an existing device?

at the moment
it is just a binary switch mapped to a z-wave channel
and is provided as the heater parameter value on the thermostats

but if there’s a better way then by all means educate me.

where you gone?

Sorry, busy night. What do you mean binary switch mapped to a z-wave channel? Can you use home assistant lingo and provide entity id’s?

Central Heating is the friendly name for switch.danfoss_rxz3_rf_relay_switch_2 that was auto discovered.

switch.danfoss_rxz3_rf_relay_switch_2 is the entity name assigned to all the heater variables on the climate.generic_thermostat* entity which is on the cards.

Ok, all you need is 2 automations… I don’t know your other climate devices so i’ll just give them fake names. You can replace the entity id’s for climate.room1 and climate.room2. Just replace the portion after the last period only. Do not touch the states.climate.

automation 1

This turns off the switch if all the thermostats are above the target temperature.

- alias: Turn off heater if all climates are equal or above target.
  trigger:
  - platform: template
    value_template: >
      {% set therms = [
        states.climate.lounge,
        states.climate.room1,
        states.climate.room2,
        ] %}
      {% set climates = namespace(at_target=[]) %}
      {% for therm in therms %}
      {% if therm.attributes.current_temperature >= therm.attributes.temperature %}
      {% set climates.at_target = climates.at_target + [ therm.entity_id ] %}
      {% endif %}
      {% endfor %}
      {{ climates.at_target | length == therms | length }}
  condition:
  - condition: state
    entity_id: switch.danfoss_rxz3_rf_relay_switch_2
    state: 'on'
  action:
    service: switch.turn_off
    entity_id: switch.danfoss_rxz3_rf_relay_switch_2

automation 2

This turns on the switch if one or more are below temperature.

- alias: Turn on heaters that are under temp
  trigger:
  - platform: template
    value_template: >
      {% set therms = [
        states.climate.lounge,
        states.climate.room1,
        states.climate.room2,
        ] %}
      {% set climates = namespace(under=[]) %}
      {% for therm in therms %}
      {% if therm.attributes.current_temperature < therm.attributes.temperature %}
      {% set climates.under = climates.under + [ therm.entity_id ] %}
      {% endif %}
      {% endfor %}
      {{ climates.under | length > 0 }}
  condition:
  - condition: state
    entity_id: switch.danfoss_rxz3_rf_relay_switch_2
    state: 'off'
  action:
    service: switch.turn_on
    entity_id: switch.danfoss_rxz3_rf_relay_switch_2
2 Likes

…and what about the heater mandatory variable on the generic thermostat (GT) which I mentioned twice but was assured not to worry. The GTs cards require this variable and use it to mode switch.danfoss_rxz3_rf_relay_switch_2

Just make an input boolean for them. It can be the same one used in all places. I was under the impression that you needed one of these for

Not the individual thermostats.

Either way. Just make a fake input_boolean and use that as the heater.

Right
I will set about this later when I’m home.
thank you in advance.
I also looked at your GitHub to get a few ideas . I’m a Software Developer for a bluechip UK company here , 35yrs, Python is in my CV and I note I can use it here. Cool. I see you’re quite a guru on HA architecture and system modelling.
Will feedback in due course with screenshots

Many thanks
Daz

There’s about 100 ways to skin this cat, so this solution is not 100% full proof. If you know python, I recommend moving to appdaemon for this.

Python - I wrote a lot of code for Enigma2 if you know what that is?
AppDaemon; that’s a new one. Another area to explore. I’ve just searched in HA and bookmarked a page. Now that looks more my kind of thing than yaml based modelling, granted some will still be required to configure the apps. Is this a suitable learning base? https://appdaemon.readthedocs.io/en/stable/

Yep, that’s the docs. It suits me better too. While I know the automation system very well, I’m still more comfortable with appdaemon. You can do all sorts of logic and it’s easier to manage 1 app than it is to manage 10 separate yaml automations.

@petro All sorted. Cool! Many thanks. !!!

1 Like

Almost worked. However, what happens is that the thermostats continue to function irrespective of their state (idle, heating, off).

Issue

  1. If lounge temp is set to 20c and the ambient is 18c then the heating comes on - correct. But if the thermostat is turned off by touching the power icon on the thermostat card, the heating continues fire. This behavious is further compounded by the fact there is only one “dummy” heater entity for all three thermostats thus the heating is moded on the single thermostat that was the most recent to send its state.

  2. The generic_thermostat entity state attribute is always one of :-

  • heating =user wants heating system to mode on the thermostat values, and the thermostat is demanding heat,

  • idle =user wants heating system to mode on the thermostat values, but thermostat is reporting ambient temp >= target temp,

  • off = user does not want heating system to mode on the thermostat values

Thus the user has a way to disabe part or all of the heating system in a multi zoned thermostat controlled building - just what is needed. However, the automation modes on the “at_target” temp. It needs to mode on the thermostat’s heater state which - according to the docs - has to be a binary entity (switch, input_boolean, etc).

Fix

  1. Each thermostat requires its own “dummy” heater entity to resolve the “on/heating/idle” and “off” states.

  2. The automation needs to mode on each of the “dummy” heater entities to check if all 3 are “off”

So the following is appropriate:

# These need to be used as the entity_id for the **heater** attribute in each **generic_thermostat**
input_boolean:
  thermostat_dummy_heater_room1: 
input_boolean:
  thermostat_dummy_heater_room2: 
input_boolean:
  thermostat_dummy_heater_room3: 

- alias: Turn OFF heater
  trigger:
    platform: template
      value_template: >
        {% set therms = [
          states.input_boolean.thermostat_dummy_heater_room1
          states.input_boolean.thermostat_dummy_heater_room2
          states.input_boolean.thermostat_dummy_heater_room3
          ] %}
        {% set climates = namespace(heat_demand=[]) %}
        {% for therm in therms %}
        {% if therm.state != "heating" %}  #-- Test if a thermostat state is NOT heating ( IDLE or OFF )
        {% set climates.heat_demand = climates.heat_demand + [ therm.entity_id ] %} #-- Add thermostat to list of thermostats NOT demanding heat
        {% endif %}
        {% endfor %}
        {{ climates.heat_demand  | length == therms | length }} #-- Return TRUE if list contains all thermostats (all thermostats are NOT demanding heat
  condition:
    condition: state
      entity_id: switch.danfoss_rxz3_rf_relay_switch_2
      state: 'on'
    action:
      service: switch.turn_off
      entity_id: switch.danfoss_rxz3_rf_relay_switch_2

- alias: Turn ON heater
  trigger:
    platform: template
      value_template: >
        {% set therms = [
          states.input_boolean.thermostat_dummy_heater_room1
          states.input_boolean.thermostat_dummy_heater_room2
          states.input_boolean.thermostat_dummy_heater_room3
          ] %}
        {% set climates = namespace(heat_demand=[]) %}
        {% for therm in therms %}
        {% if therm.state == "heating" %}  #-- Test if heating demand from thermostat
        {% set climates.heat_demand = climates.heat_demand + [ therm.entity_id ] %} #-- Add thermostat to list of thermostats demanding heat
        {% endif %}
        {% endfor %}
        {{ climates.heat_demand | length > 0 }} #-- Return TRUE if list is not empty (at least one thermostat is demanding heat)
  condition:
    condition: state
      entity_id: switch.danfoss_rxz3_rf_relay_switch_2
      state: 'off'
    action:
      service: switch.turn_on
      entity_id: switch.danfoss_rxz3_rf_relay_switch_2

Now it works perfectly, in that any number of thermostats can control the overall heating:-
a) Turn heating ON if ANY thermostat IS demanding heat (target temp > ambient temp)
b) Turn heating OFF when ALL thermostats are NOT demanding heat.

I havent tested the code as I am not at home, but it looks reasonable.

1 Like

Hello ninjadog,

Sorry for interjecting. I’ve just picked up a couple of RXZ-2C dual channel Danfoss receivers, but am failing at the first hurdle of inclusion…The manufacturer “manual” that came with each of them is a 12 page A7 booklet with not a great deal of info.

Can you shed any light on how you included your RXZ-2C into your Z-Wave network? (what buttons did you press? What make/model of Z-Wave controller you have? do you have any Danfoss wall thermostats paired with wither of the two channels on the RXZ-2C?)

Any help you could give me would be much appreciated :slight_smile:

ATB,
bikefright.

there’s so many variables at play

have you debugged using log file entries?

If you don’t understand, then you need to read up on z-wave, home assistant, devices, logging, and etc

the topic is to lengthy , albeit not complex , to spoon food you

Thanks ninjadog - I don’t consider myself a n00b when it comes to HA, Z-Wave, ZHA etc. (others may disagree). I should have been more specific in my request :wink: I don’t need spoon feeding :wink: Just been scratching round in the dirt for info on how to actually get the things into inclusion mode in the first place.

This is all part of the planned removal of my Hive receivers (see here:my long winded thread)

In the meantime I’ve figured out how to factory reset the bloody things.

This at least gets me to a point where I can attempt an inclusion. However, it fails the node add. I’ll start looking at logs now.

I pulled open-zwave 1.6 into /config some time ago to take advantage of the manufacturer specific multi-level sensor support for my Eurotronic spirit Z-waves (of which I have 16 working perfectly for over a year now) which may be a difference between your setup and mine perhaps?

I’ve tried them both on a separate SystronicsRF RPi based system I’m beta testing at the moment (https://www.systronicsrf.com/) with the same model Everspring SA413 USB stick (I’ve got three of theses USB sticks, so one spare for testing), but that platform is “hands-off” log wise, so I’m none the wiser other than it didn’t work there either. Pretty sure therefore that I don’t have two broken receivers.

I’m running HA in Docker under ubuntu - which again could be a difference.

There must be something fundamental I’m missing - If I get nowhere tomorrow, I’ll make a fresh post for help and provide a bunch of logs.

Obvious question: is your Z-Wave network exclusively secure, exclusively insecure or a combination?
I ask because on the face of it, these RXZ-2C receivers are Z-Wave 4.28, so are not Z-Wave Plus. All my other devices are both Z-Wave Plus and secure.

Cheers,
bikefright.

I have no idea what your problem is. State it , clearly.
Neither am I going to read all those links.
And you still have not provided any logs.
And don’t confude openhab with HA. Two completely different architectures and models.
You’re not helping yourself - so why should I ?

My Danfoss RX2 works perfectly.

I hijacked your thread. For that I Apologise (again). Not to worry. I am figuring things out for myself.

Read them, dont’ read them. Either way, the measure of the man is not down to two posts on a single thread (yours) on one forum - specific to one home automation platform. If I ask what seems a simple question you assume I need to be spoon fed.

Pointelss providing logs in my first post that show nothing but me clicking and the z-wave controller timing out/not finding anything to add. 'cos the RXZ-2C is not in inclusion mode. No nodes to find/add…

I am well aware of the differences between automation platforms. z-wave is z-wave regardless of platform.

When hunting for things like supported command classes, feature set and inclusion mode (secure/insecure) for a new device I check all home automation forums - home-assistant, openHAB, smarththings etc. The same device is likely to present similar issues on other automation platforms. This was the case here.

My aim is always to help myself and to try and help others if I can. I reach out if I hit a problem I can’t resolve myself - as I did here.

In my first post for help, I specifically asked what buttons you pressed for inclusion. Perhaps I though it was obvious that I was:

  1. talking about the RXZ-2C.
  2. asking which specific button sequence you used to get the RXZ-2C into inclusion mode.

I’ve re-read my first post and you could be forgiven for thinking I was also asking which in HA you pressed to include a node. That was not the case.

I worked out for myself (actually by reading an openHAB thread!) what the button sequence was to factory reset the RXZ-2C which is a pre-cursor to inculsion mode - which I then documented here on your post to help others who might have the same problem with lack of useful instructions like me. The links out are therefore also for others who may read this forum who have the same problem.

To be specific, the “instructions” that came with my units state:

  • If the RXZ is to be installed into a pre-existing network, the user should carry out the following steps:
    • Ensure the RXZ is in its factory reset state (programme LED flashing green).
    • if the RXZ is not factory reset, the user should follow the method given in the factory reset procedure in this leaflet.

There are no instructions in the two leaflets I received on how to factory reset the RXZ-2C (so it is not a misprint or page missing in one of them).

My problem has moved on now as I stated in my second post. I also stated I was going to look at logs and make a fresh post (rather than continue here). Feel free to chime in and help out there too.

Glad yours works perfectly.

don’t like your attitude at second to last para. You were doing ok upto then.

BYE!