Zooz 4-in-1 Sensor

I’m having problems with this and hoping it’s just me messing up on the template or something.

I have this

 - platform: template
   sensors:
     front_door_motion:
       value_template: "{{ states(sensor.front_door_motion_sensor_alarm_level) > 0 }}"
       friendly_name: "Front Door Motion"
       device_class: motion
       entity_id: sensor.front_door_motion_sensor_alarm_level

sensor.front_door_motion_sensor_alarm_level is the name of the sensor. That sensor does go from 0 to 255 immediately when motion is detected, but the template never changes to on.

      front_door_motion_battery:
        value_template: "{{ states.zwave.front_door_motion_sensor.attributes.battery }}"
        friendly_name: "Front Door Motion Sensor Battery Level"
        entity_id: zwave.front_door_motion_sensor
        unit_of_measurement: '%'

I also have a battery template that is not reporting anything either.

I know this post was from more than a year ago, so maybe the syntax has changed?

Edit:

Posting for others.

 - platform: template
   sensors:
     front_door_motion:
       value_template: "{{ states('sensor.front_door_motion_sensor_alarm_level')|float > 0 }}"
       friendly_name: "Front Door Motion"
       device_class: motion
       entity_id: sensor.front_door_motion_sensor_alarm_level

This works for me, found on another post in the community

1 Like

@ptdalen I found your comment about 5 minutes after I had come to the same solution!

I was able to get my battery level working also!

- platform: template
  sensors:
    mudroom_battery:
      value_template: "{{ states.zwave.unknown_id027a_unknown_type2021_id2101_3.attributes.battery_level }}"
      friendly_name: "Mudroom Battery"
      entity_id:  zwave.unknown_id027a_unknown_type2021_id2101_3
      unit_of_measurement: '%'

The key was to use the actual zwave device node, which has the battery level attribute (and others).

If you’re interested in custom/dynamic icon based on the battery level, here is what I use:


  sensor:
    - platform: template
      sensors:
        basement_hall_multisensor_battery:
          friendly_name: "Basement Hall Multisensor Battery"
          value_template: "{% if states.zwave.basement_hall_multisensor %}
              {{ states.zwave.basement_hall_multisensor.attributes.battery_level }}
            {% else %}
              unknown
            {% endif %}"
          unit_of_measurement: '%'
          # entity_id: zwave.basement_hall_multisensor
          icon_template: >-
            {% set battery_level = states('sensor.basement_hall_multisensor_battery')|int('unknown') %}
            {% set battery_round = (battery_level|int / 10)|int * 10 %}
            {% if battery_level == 'unknown' %}
              mdi:battery-unknown
            {% else %}
              {% if battery_round >= 100 %}
                mdi:battery
              {% elif battery_round > 0 %}
                mdi:battery-{{ battery_round }}
              {% else %}
                mdi:battery-alert
              {% endif %}
            {% endif %}

The value_template also catches the zwave startup timeframe and scenarios where the device may be disconnected or unavailable.

I use the following for Motion and Tamper which works well for me:


  binary_sensor:
    - platform: template
      sensors:
        basement_hall_multisensor_motion:
          value_template: "{{ is_state('sensor.basement_hall_multisensor_burglar', '8') }}"
          friendly_name: "Basement Hall Multisensor Motion"
          device_class: motion
          # entity_id: sensor.basement_hall_multisensor_burglar

        basement_hall_multisensor_tamper:
          value_template: "{{ is_state('sensor.basement_hall_multisensor_burglar', '3') }}"
          friendly_name: "Basement Hall Multisensor Tamper"
          device_class: safety
          # entity_id: sensor.basement_hall_multisensor_burglar

One final reply - I use packages for my multisensors to make setup easy and contain all bits in a single spot. Here is an example:


basement_hall_multisensor_package:

  sensor:
    - platform: template
      sensors:
        basement_hall_multisensor_battery:
          friendly_name: "Basement Hall Multisensor Battery"
          value_template: "{% if states.zwave.basement_hall_multisensor %}
              {{ states.zwave.basement_hall_multisensor.attributes.battery_level }}
            {% else %}
              unknown
            {% endif %}"
          unit_of_measurement: '%'
          # entity_id: zwave.basement_hall_multisensor
          icon_template: >-
            {% set battery_level = states('sensor.basement_hall_multisensor_battery')|int('unknown') %}
            {% set battery_round = (battery_level|int / 10)|int * 10 %}
            {% if battery_level == 'unknown' %}
              mdi:battery-unknown
            {% else %}
              {% if battery_round >= 100 %}
                mdi:battery
              {% elif battery_round > 0 %}
                mdi:battery-{{ battery_round }}
              {% else %}
                mdi:battery-alert
              {% endif %}
            {% endif %}


  binary_sensor:
    - platform: template
      sensors:
        basement_hall_multisensor_motion:
          value_template: "{{ is_state('sensor.basement_hall_multisensor_burglar', '8') }}"
          friendly_name: "Basement Hall Multisensor Motion"
          device_class: motion
          # entity_id: sensor.basement_hall_multisensor_burglar

        basement_hall_multisensor_tamper:
          value_template: "{{ is_state('sensor.basement_hall_multisensor_burglar', '3') }}"
          friendly_name: "Basement Hall Multisensor Tamper"
          device_class: safety
          # entity_id: sensor.basement_hall_multisensor_burglar
   

  homeassistant:
    customize:

      sensor.basement_hall_multisensor_alarm_level:
        hidden: true
      sensor.basement_hall_multisensor_alarm_type:
        hidden: true
      sensor.basement_hall_multisensor_burglar:
        hidden: true
      sensor.basement_hall_multisensor_clock:
        hidden: true
      sensor.basement_hall_multisensor_sourcenodeid:
        hidden: true
      binary_sensor.basement_hall_multisensor_sensor:
        hidden: true
      sensor.basement_hall_multisensor_system:
        hidden: true
      sensor.basement__hall_multisensor_emergency:
        hidden: true
      sensor.basement_hall_multisensor_power_management:
        hidden: true
      sensor.basement_hall_multisensor_homehealth:
        hidden: true        



      sensor.basement_hall_multisensor_luminance:
        friendly_name: Luminance
        icon: mdi:brightness-5
      sensor.basement_hall_multisensor_relative_humidity:
        friendly_name: Humidity
        icon: mdi:water-percent
      sensor.basement_hall_multisensor_temperature:
        friendly_name: Temperature
        icon: mdi:temperature-fahrenheit
      sensor.basement_hall_multisensor_battery:
        custom_ui_state_card: state-card-custom-ui
        friendly_name: Basement Hall Multisensor Battery
        group:
          group.basement_hall_multisensor:  
            friendly_name: Battery
          group.battery_group:  
            friendly_name: Basement Hall Multi

      binary_sensor.basement_hall_multisensor_tamper:
        friendly_name: Tamper
      binary_sensor.basement_hall_multisensor_motion:
        custom_ui_state_card: state-card-custom-ui
        friendly_name: Basement Hall Motion
        group:
          group.basement_hall_multisensor:  
            friendly_name: Motion
          group.motionsensors:  
            friendly_name: Basement Hall


      group.basement_hall_multisensor:
        custom_ui_state_card: state-card-custom-ui
        group:
          group.motion_sensors:
            friendly_name: Basement Hall Alarm



  group:
    basement_hall_multisensor:
      name: Basement Hall MultiSensor
      control: hidden
      entities:
        - binary_sensor.basement_hall_MultiSensor_motion
        - binary_sensor.basement_hall_MultiSensor_tamper
        - sensor.basement_hall_MultiSensor_luminance
        - sensor.basement_hall_MultiSensor_relative_humidity
        - sensor.basement_hall_MultiSensor_temperature
        - sensor.basement_hall_MultiSensor_battery


Which gives me something like this:

image

NOTE: I’ve found that the reported battery is not very accurate or reliable - lol. You’ll notice the battery shows 0% but it’s still working… been this way for a few months.

10 Likes

Quick question about that. Does it require custom UI components?

It shouldn’t. I’m using custom ui for some stuff but the what I showed does not. You can remove any of it and it should still function the same.

I will say that for me alarm level for motion is 255 not 8, but is 0 for no motion,

thats why used this, figure its a catch all

value_template: “{{ states(‘sensor.motion_sensor_front_door_alarm_level’)|float > 0 }}”

I believe Tamper alerts show up under Alarm Level as well. If you take the back off the sensor, does it trigger your motion?

I’m using the _burglar entity which is why 8/3 work.

Got it You’re right I was looking at alarm level. I only see 255 and 0 for alarm level, but burgler has 254, 8, and 0, and probably 3 like you said if I get a tamper alert. Good deal, thanks

One super minor typo (probably), I was doing a find/replace and this one got missed. Noticed an extra underscore. I mean I dont even know what that sensor does anyway, so its not a big deal.haha Just letting you know. Thanks for this, its awesome

I could not get the customize to work in the package. Not sure if it was because I already had a customize.yaml file? I moved the items from the customize part of the package into my customize.yaml, and it worked fine.

Thanks again

Edit: A few more minor typos. There was a space for motion and tamper in the is_state. and a few of the customize items had an extra space., but It’s all working great now (except for having to seperate out the customize. which is not a big deal at all.

Thanks for the example code! Packages are cool too! I learned something new while trying to figure out how to configure multisensor! Cheers

1 Like

How are you able to use numbers for the states? My states are represented as strings: ‘Not Active’ and ’ Burglar - Unknown’. I am using the Dev branch of open-zwave. Maybe that’s why.

I think it depends on the sensor. I would look at your entity list and see what the states and attributes look like there. If you don’t like the default, you can use templates to have it display however you’d like (numbers or different text). The device class can also affect how sensor states are displayed as well (open/close, safe/unsafe, etc.). In kylerrw’s code, he creates two new binary sensors (based on non-binary states from the motion and tamper sensors). The ‘8’ and ‘3’ he is using could easily be replaced with ‘Burglar’ if that is what your sensor state is. The device class motion will display clear/detected and the safety will display safe/unsafe. I hope that makes some sense! I’m sure Kylerrw could explain better as I just pirated his code!

binary_sensor:
- platform: template
sensors:
basement_hall_multisensor_motion:
value_template: “{{ is_state(‘sensor.basement_hall_multisensor_burglar’, ‘8’) }}”
friendly_name: “Basement Hall Multisensor Motion”
device_class: motion
# entity_id: sensor.basement_hall_multisensor_burglar

    basement_hall_multisensor_tamper:
      value_template: "{{ is_state('sensor.basement_hall_multisensor_burglar', '3') }}"
      friendly_name: "Basement Hall Multisensor Tamper"
      device_class: safety
      # entity_id: sensor.basement_hall_multisensor_burglar

any ideas on how to change teh zwave config parameters? when i try to turn off the led (parameter 7) the change doesnt stick. I try waking up the device with the button before issuing the command, but when i read it back it still doesnt change

I’ve got two Zooz 4-in-1s hooked up to HA without much fuss, but am having some inconsistent issues related to the attributes found within the node and simplifying the display. This post seems to be the best resource for this particular sensor.

First off, the battery_level attribute is nowhere to be found on either of my sensors. Also, when I added the sensors (which are identical) they didn’t add with the same attributes. The living room has sensor.living_room_multisensor_emergency and sensor.living_room_multisensor_homehealth and the basement sensor doesn’t have those values. The basement sensor also has sensor.basement_multisensor_appliance which the living room doesn’t have. What’s going on here? Both nodes report “query_stage: Complete” and seemingly are reporting good data.

I really like what @kylerw has done with his script and would love to recreate it. Problem is I’m brandy new to this and I’m clueless by a lot so far. I haven’t really wrapped my head around templates yet, nevermind packages. I tried to recreate his code to match my environment, but I honestly have no idea where I should be putting that. Not to mention, I don’t even have the battery level attributes showing anywhere.

Any help with those two points would be really appreciated!

Hey @borsaid, check out the packages documentation where you can see where/how to configure. I’m using the include option in my configuration.yaml so I can have each package in it’s own file.

@borsaid

I’m guessing you mean Sensors, try leaving the cover off for a while longer and all sensors should populate, as this will force the sensor to stay awake and report more often, The sensor’s wake-up interval is set to 12 hours by default to save battery life.

You have to wake it up a couple of times so it can read the complete configuration. If you only add it and then restart HA it may not have finished reporting it’s sensors.

CP from manual:

MANUAL WAKE-UP

Press and release the Z-Wave button once to wake the device up.
The LED indicator will flash once (blue or orange).
You may need to wake the sensor up manually IF:
1. It doesn’t fully configure during set-up (values are not displayed or errors pop up in your hub’s interface).
2. You change advanced settings for the sensor and want them to update.