Hello all, I’m a new user of Home Assistant. Great job!
I’m trying to generate a trigger that will be used at noon every day to check battery level for many devices. I first generated this code that is accepted by the “check config” button:
- alias: "Battery too low"
trigger:
platform: numeric_state
entity_id:
- sensor.Mailbox
- sensor.Freezer
- sensor.Toilette_1er_Spill
- sensor.Toilette_2eme_Spill
- sensor.Laveuse_Spill
- sensor.Fournaise_Spill
- sensor.Salon_Smoke
- sensor.Passage_1er_Smoke
- sensor.Passage_2eme_Smoke
- sensor.Fournaise_Smoke
value_template: '{{ state.attributes.vbat }}'
above: 0.0
below: 2.8
action:
- service: notify.mailer1
data_template:
message: "Battery too low: {{ trigger.state.name }}"
title: "[Home] Battery too low: {{ trigger.state.name }}"
As we can’t add an “at:” to numeric_state and that there is no way to have an “and” conditional in a trigger (or is it??), I then tried to modify it such that it is fired at noon using a condition:
- alias: "Battery too low"
trigger:
platform: time
at: '12:00:00'
condition:
condition: numeric_state
entity_id:
- sensor.Mailbox
- sensor.Freezer
- sensor.Toilette_1er_Spill
- sensor.Toilette_2eme_Spill
- sensor.Laveuse_Spill
- sensor.Fournaise_Spill
- sensor.Salon_Smoke
- sensor.Passage_1er_Smoke
- sensor.Passage_2eme_Smoke
- sensor.Fournaise_Smoke
value_template: '{{ state.attributes.vbat }}'
above: 0.0
below: 2.8
action:
- service: notify.mailer1
data_template:
message: "Battery too low: {{ trigger.state.name }}"
title: "[Home] Battery too low: {{ trigger.state.name }}"
But I get the following message from the “check config” button:
Invalid config for [automation]: value should be a string for dictionary value @ data['condition'][0]['entity_id']
Why is this not possible??
Thanks for your help!
Guy