Trigger state_numeric on group of sensors

Hi,

I’m trying to notify myself when a plant gets below a specific humidity, but the notification only got sent once, here’s my configuration, can you find out what I’m doing wrong?

configuration.yml

sensor
  - platform: rfxtrx
    devices:
      0axxxxxxxxxxxxxxxxx:
        name: Peace Lily
  - platform: template
    sensors:
      peace_lily_humidity:
        value_template: '{{ states.sensor.peace_lily_temperature.attributes.Humidity }}'
        friendly_name: 'Peace Lily - humidity'

automation.yml

- alias: Plant humidity alarm
  trigger:
    platform: numeric_state
    entity_id: group.plants_humidity
    below:50
    for:
      minutes: 1 #30
    action:
      - service: notify.pushover
        data_template:
          title: "Plant is thirsty"
          message: "{{ trigger.to_state.attributes.friendly_name }} below 50%"
          data:
            priority: 1

You’ll have to separate the entities out in your trigger to get the behavior you want. Groups do not average the results of a series of sensors. That’s why you have to break them out. Also, your spacing is off in your automation:

- alias: Plant humidity alarm
  trigger:
    platform: numeric_state
    entity_id: 
      - # list
      - # entity_ids
      - # here
    below: 50
    for:
      minutes: 1 
  action:
    - service: notify.pushover
      data_template:
        title: "Plant is thirsty"
        message: "{{ trigger.to_state.attributes.friendly_name }} below 50%"
        data:
          priority: 1

Hi @petro thanks for noticing the indentation, that’s because I indented manually in this community post. Unfortenately changing it into the list of entities didn’t work. This is my groups.yaml:

plants_humidity:
  name: Plants humidity
  view: no
  entities:
    - sensor.peace_lily_humidity
    - sensor.yucca_humidity

so this doesn’t work?

- alias: Plant humidity alarm
  trigger:
    platform: numeric_state
    entity_id: 
      - sensor.peace_lily_humidity
      - sensor.yucca_humidity
    below: 50
    for:
      minutes: 1 
  action:
    - service: notify.pushover
      data_template:
        title: "Plant is thirsty"
        message: "{{ trigger.to_state.attributes.friendly_name }} below 50%"
        data:
          priority: 1

Nope, and they’re both below 50… my first thought is that once one of them comes above 50 the trigger will be reset, I guess I’ll have to water them to find out :stuck_out_tongue:

They have to cross for it to trigger. I.E. start above, then cross below. Or they just have to update when below. If you are restarting, that’s probably not happening.

I don’t think that will work, needs to be…

- alias: Plant humidity alarm
  trigger:
    - platform: numeric_state
      entity_id: sensor.peace_lily_humidity
      below: 50
      for:
        minutes: 1
    - platform: numeric_state
      entity_id: sensor.yucca_humidity
      below: 50
      for:
        minutes: 1
  action:
    - service: notify.pushover
      data_template:
        title: "Plant is thirsty"
        message: "{{ trigger.to_state.attributes.friendly_name }} below 50%"
        data:
          priority: 1

I thought a list would work?

I think it would if you didn’t have the for: , but I think with it it goes pear-shaped if you use a list.

It’s a nagging memory.

Ah ok, I don’t use automations here so… I’m taking a stab in the dark.

Yeah, I don’t have any now, but as I say I have a nagging memory of trying to do something similar and I had to separate it out.

You can use an alert instead of an automation if you want repeated notifications.