Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - alias: Notify when a plant needs attention
- trigger:
- platform: state
- entity_id: binary_sensor.peter_in_bedroom
- from: 'off'
- to: 'on'
- condition:
- condition: and
- conditions:
- - condition: time
- after: '08:30:00'
- before: '22:00:00'
- - condition: or
- conditions:
- - condition: state
- entity_id: plant.zamiculcas
- state: 'problem'
- - condition: state
- entity_id: plant.dracaena
- state: 'problem'
- action:
- - service: tts.google_say
- data_template:
- entity_id: "media_player.peter_ghome"
- message: >
- {% if not is_state_attr('plant.zamiculcas', 'problem', 'none') and not is_state_attr('plant.zamiculcas', 'problem', 'brightness low') and is_state_attr('plant.dracaena', 'problem', 'none') and is_state_attr('plant.dracaena', 'problem', 'brightness low')%}
- "The Zamiculcas plant needs attention. The problem is {{ state_attr('plant.zamiculcas', 'problem') }}"
- {% elif not is_state_attr('plant.dracaena', 'problem', 'none') and not is_state_attr('plant.dracaena', 'problem', 'brightness low') and is_state_attr('plant.zamiculcas', 'problem', 'none') and is_state_attr('plant.zamiculcas', 'problem', 'brightness low') %}
- "The Dracaena plant needs attention. The problem is {{ state_attr('plant.dracaena', 'problem') }}"
- {% elif not is_state_attr('plant.dracaena', 'problem', 'none') and not is_state_attr('plant.dracaena', 'problem', 'brightness low') and not is_state_attr('plant.zamiculcas', 'problem', 'none') and not is_state_attr('plant.zamiculcas', 'problem', 'brightness low') %}
- "Both of your plants needs attention. The problem with the Dracaena is {{ state_attr('plant.dracaena', 'problem') }} and the Zamiculcas is {{ state_attr('plant.zamiculcas', 'problem') }}"
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement