0 0

Notification for low Moisture level

Using: https://github.com/Olen/homeassistant-plant/
alias: Notify - Het is tijd om de planten water te geven.
description: Stuurt een notificatie wanneer de vochtigheid van een plant onder de 25% komt
triggers:
  - value_template: |-
      {{ states 
       | selectattr('entity_id', 'search', '^sensor\..+_soil_moisture$') 
       | map(attribute='state') 
       | map('float') 
       | select('lt', 25) 
       | list 
       | count > 0 }}
    trigger: template
conditions: []
actions:
  - data:
      title: Het is tijd om de planten water te geven.
      message: >
        {%- for sensor in states | selectattr('entity_id', 'search',
        '^sensor\..+_soil_moisture$') -%}
          {%- set moisture = sensor.state | float | int -%}
          {%- if moisture < 25 %}
        {{ state_attr(sensor.entity_id, 'friendly_name') | replace(' soil
        moisture', '') | replace(' Soil Moisture', '') }}: {{ moisture }}%
          {%- endif -%}
        {%- endfor -%}
      data:
        ttl: 0
        priority: high
    action: notify.mobile_app_pixel
mode: single