Z wave thermostat (heatit/mutireg) status feedback / energy

Hi,

I’m using several z wave “heatit”/“multireg” thermostats for my floor heting. Unfortunately they do not report back power consumption, neither do they report if the relay is on or off. I’ve successfully associated them with the zwave controller in my PI, and I get this information using “zwave.node_event”. My end goal is to trend the energy consumption based on the fixed load that the floor heating represent. So far I’ve been able to make a template sensor together with some automation strings to see if the heating is on or off. But due to lack of skills I belive I’ve integrated this in a way that should be improved.

The following has been added to “automation” where “Varme Stue” is just a dummy which never triggers, and are set by the two first functions:

automation:
  - alias: Ovens on stue
    trigger:
       platform: event
       event_type: zwave.node_event
       event_data:
         entity_id: zwave.thermostat_stue
         basic_level: 255
    action:
      service: homeassistant.turn_on
      entity_id: automation.varme_stue


  - alias: Ovens off stue
    trigger:
       platform: event
       event_type: zwave.node_event
       event_data:
         entity_id: zwave.thermostat_stue
         basic_level: 0
    action:
      service: homeassistant.turn_off
      entity_id: automation.varme_stue


  - alias: Varme stue
    trigger:
      platform: event
      event_type: zwave.node_event
      event_data:
        entity_id: zwave.thermostat_stue
        basic_level: 25
    action:

I’ve then used a “template sensor” which I’ve added to the GUI

      heating_stue:
        friendly_name: "Stue"
        icon_template:  "{% if is_state('automation.varme_stue', 'on') %}mdi:flash{% else %}mdi:close-circle-outline{% endif %}"
        value_template: "{% if is_state('automation.varme_stue', 'on') %}Heating{% else %}Idle{% endif %}"

This works, but I believe there must be a better way without using the “dummy automation” entity?

1 Like

Hi!
I use 6 Heatit thermostat.
Is that work with 0.60 HA version? I try, but no status change :frowning:

Hi,

Have you associated the thermostat on group 2 with the gateway?
If you have and run i,e: cat OZW_Log.txt | grep 255 in home assistant folder, you should see something like this: 2018-01-02 09:45:36.001 Info, Node015, Received Basic report from node 15: level=255
Which means that node15 is reporting that it is heating ( relay active).

I’ve noticed that my posted example works fine with one thermostat, but when adding others they all triggered by one event. I think I know how to solve this, and will post it here if and when I do.

The problem was that I’ve used “object_id” where it should have been “entity_id:” it now works for me with several thermostats. I’ve edited the post above, however I still don’t like the way I’ve done this, it should be a simpler or more correct approach.

Hi!

Thanks for your help! The group2 associated missing. I configure the gateway and it’s works!
Only the energy monitor missing.
Does it support this feature at all?

Heatit thermostat does not report back energy, the new version will.
You can calculated the energy usage as long as your load is static. In my case it is floor heating, which makes it easy.

I’m using template sensors to do this:

Below will get you the the energy, change “2133” whith the wattage of your load.

  heating_stue:
    friendly_name: "Stue"
    icon_template:  "{% if is_state('automation.varme_stue', 'on') %}mdi:flash{% else %}mdi:close-circle-outline{% endif %}"
    value_template: "{% if is_state('automation.varme_stue', 'on') %}2133{% else %}0.0{% endif %}"

Then sensor to count when it is on

  - platform: history_stats
    name: Heat ON Stue Today
    entity_id: automation.varme_stue
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

This will get you the cost (current day so far, in NOK) and count KWh

  nok_vr_today:
    friendly_name: 'NOK Vaskerom Today'
    value_template: '{{ ((states.sensor.kwh_vr_today.state | round (2) ) * (0.925 | round(2) )) | round(2) }}'
    unit_of_measurement: "NOK"



  kwh_vr_today:
    friendly_name: 'Kwh Vaskerom Today'
    value_template: '{{ ((((states.sensor.heat_on_vaskerom_today.state | round (2) ) * ( 1230 | round(2) )) / (1000))) | round(2) }}'
    unit_of_measurement: "kWh"

I’ve mixed two rooms in the examples above but you would need to change that anyway.
There is most likely a more efficant way of doing this, but this works for me.
I’m using 8 thermostats in my house, and also included templete sensors to sum the energy and cost to get a total measurement of heating, and cost of heating. Which gives me a good overview in HA but also in grafana:

Thanks the informations. My load is static too. (infrared heating)
I figure it out 2 days ago too. I made the energy monitor similar way as yours.

This is my statistic (day 0-24h) / thermostat:

  • Running time
  • energy usage
  • cost

    Total cost

Hi @kjetilsn!

This looks interesting! I started testing with my single multireg thermostat in my bathroom - but can’t get it working…

This should actually trigger something, right?

    - alias: Floorheat Bathroom ON
      trigger:
        platform: event
        event_type: zwave.node_event
        event_data:
          entity_id: zwave.bad_termostat
          basic_level: 255
      action:
      - service: homeassistant.turn_on
        entity_id: automation.floorheat_bathroom

I’m getting this in my z-wave log:
2018-01-21 16:34:55.298 Info, Node008, Received Basic report from node 8: level=255

Debugging the HA log, it doesn’t look like the automation triggers, when the level=255 is received.

Any idea? :slight_smile:

Hi dico,

When I tried to get this working, I assumed adding a single automation entry would do the trick, however after many failed attempts, I ended up using two for trigger, and one dummy which does not trigger on anything, but set by the two first. Any input on how to do this better would be appreciated!.

First I made the dummy entry, and restarted “automation” in order get the correct ID from <>
Then I added the two entries that triggers the dummy entry based on 255 an 0.
If you follow the above example in that order, and enable group 2 association with the controller, it should work.

Hi,

When you say the new version, do you mean there’s a new firmware coming or a whole new device?

There will be a new device:
http://www.heatit.com/heating-control/floor-heating-thermostats/heatit-z-therm2/

Nice job! How do I fint the wattage of the load?

Olloe,

It depends on the load. In my case it is floor heating, if you dont know your floor heating cable rating, you can measure the resistance with a multi meter when disconnected and calculate the rating:
U=R*I turn around and use I=U/R and then P=UI.

1 Like

Why don’t you want to use an input boolean instead of an automation to hold the status for on/off, and then make a template sensor based on the input boolean?

Simply due to my lack of skills / understanding of how to approach this. At the time I did not know about the “input boolean” I now use that for other functions. Thank you for the tip, I will give it try.

did you make a better solution for this? I would love the config if so

Hi,

I did change the logic to use input bolean instead of the dummy automation, which is in principle more correct. No changes to functionality though.

configuration:

input_boolean:
    name: Heating Stue
    icon: mdi:power-cycle

automation:

  - alias: Ovens on stue
    trigger:
       platform: event
       event_type: zwave.node_event
       event_data:
         entity_id: zwave.termostat__stue
         basic_level: 255
    action:
      service: homeassistant.turn_on
      entity_id: input_boolean.heating_stue


  - alias: Ovens off stue
    trigger:
       platform: event
       event_type: zwave.node_event
       event_data:
         entity_id: zwave.termostat__stue
         basic_level: 0
    action:
      service: homeassistant.turn_off
      entity_id: input_boolean.heating_stue

sensor for count “today”

  - platform: history_stats
    name: Heat ON Stue Today
    entity_id: input_boolean.heating_stue
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

sensors for kw and cost “today”
Planing to improve the power calculation using voltage read from the AMS (house power meter) which will improve the accuracy as the voltage seems to be varying from ~220 to 240 VAC) In addition it would be nice to get the current KW cost from somewhere, especially when the power companies start to charge us different KW cost at different times during the day.

  kwh_stue_today:
    friendly_name: 'Kwh Stue Today'
    value_template: '{{ ((((states.sensor.heat_on_stue_today.state | round (2) ) * ( 2121 | round(2) )) / (1000))) | round(2) }}'
    unit_of_measurement: "kWh"

  nok_stue_today:
    friendly_name: 'NOK Stue Today'
    value_template: '{{ ((states.sensor.kwh_stue_today.state | round (2) ) * (0.925 | round(2) )) | round(2) }}'
    unit_of_measurement: "NOK"

Thanks!

Have you seen this?
https://www.hjemmeautomasjon.no/forums/topic/2940-nordpool-spot-integrasjon-i-home-assistant/?do=findComment&comment=33538

I haven’t made the ams-reader yet. I have the Aidon from Hafslund. Got the mbus and rpi ready though.

Thanks olloe,

Will install this and try it out. I’ve been speaking with BKK and Fjordkraft, they do not yet charge depending on when during the day I consume power, but I reckon they will start this next year. Good to be ready when it’s needed.

I cant find the basic_level? for the heatit thermostat. So the automation to show if on or off is not working based on if 0 or 255.

Using hass 0.68.1 and Aeotec Z-stick gen5