Help needed with group involving several Aeotec ZW100 Multisensor burglar alarms/motion sensors

Hi

I haven’t been using HA for a long time and still not understanding syntax very well.

I’m trying to write an automation that triggers n minutes after all of my ZW100 motion sensors have been in the same state (i.e. 0 or 8 - I’ll ignore tampering for now). I’ve made a new group for this that includes my motion sensors. In my automation I want to use the state of the group to evaluate its state using numeric_state:

platform: numeric_state
    below: '1'
    entity_id: group.my_motion_sensors
    for: 00:30:00
action:
  - alias: log_test
    data_template:
      message: away for 30 mins at {{states.sensor.time.state }}
    service: system_log.write

My group looks like this:

my_motion_sensors:
  name: test
  entities:
    - sensor.aeotec_zw100_multisensor_6_burglar
    - sensor.aeotec_zw100_multisensor_6_burglar_2
    - sensor.aeotec_zw100_multisensor_6_burglar_3`

However, I always get state unknown for the burglar status of my devices while each individual device shows me the correct state as an int (0, 3, 8). When I click on the group in the dev tools I can see each sensor with the correct number but the overall state is “unknown”. This is how it looks like in the tools:

Any help would be appreciated. I’m pretty stuck with this. I’ve tried doing this directly in a value template in my automation before and even though check out in the template editor, they never trigger in the automation. I’ve also tried creating my own sensors based on time difference using
"{{(now().minute - device.last_updated.minute % 60)}}"

and they never even show up in the states. Again, I test everything in the template editor beforehand making sure it works - and it does.

A group of sensors does not ‘average’ the sensor output.

you should use the min_max sensor to combine these devices to average the result.

Also, with a numerical state trigger, you don’t need quotes around your number

    platform: numeric_state
    below: 1
    entity_id: group.my_motion_sensors
    for: 00:30:00

Thanks, I guess I’m still doing something wrong because the min_max sensor, as opposed to all of the other custom sensors I have defined, doesn’t even show up in my entity list.

Any ideas?

This is my min_max sensor.

- platform: min_max
    name: motion_sensors_avg
    type: mean
    entity_ids:
      - sensor.aeotec_zw100_multisensor_6_burglar
      - sensor.aeotec_zw100_multisensor_6_burglar_2  
      - sensor.aeotec_zw100_multisensor_6_burglar_3

Spacing looks off. Also are you putting in the sensor section? You have to restart after adding it too.

  - platform: min_max
    name: motion_sensors_avg
    type: mean
    entity_ids:
      - sensor.aeotec_zw100_multisensor_6_burglar
      - sensor.aeotec_zw100_multisensor_6_burglar_2  
      - sensor.aeotec_zw100_multisensor_6_burglar_3

I’m afraid that’s not it. The spacing is corrected and I always restart after making changes. I have also removed all of my other sensors and only left this one in so the whole sensor section looks like this (still no sign of a min_max sensor anywhere):

sensor:
  - platform: min_max
    name: motion_sensors_avg
    type: mean
    entity_ids:
      - sensor.aeotec_zw100_multisensor_6_burglar
      - sensor.aeotec_zw100_multisensor_6_burglar_2  
      - sensor.aeotec_zw100_multisensor_6_burglar_3

Errors in the logs?

I keep getting this one:
Error rendering data template: UndefinedError: ‘input_boolean’ is undefined

In: helpers/service.py

I’m using hassbian and recently upgraded to 0.92.2. Everything is up to date. The only other permanent service I’m running on my pi is pi.hole and that has never caused any conflicts