@pli wrote:
I have an automation that saves the sensor values to a file.
I have 5 Xiaomi aqara temperature sensors.
For 2 of the sensors I can save temperature and battery level without any problems.
But for the remaining 3 sensors the automation will stop working if I add the battery level Entity ID.I will give an example.
This work:
Sensor 1:
Temperature Entity ID: sensor.aqara_1_3
Battery Level Entity ID: sensor.aqara_1_battery_level
I’m using the following code in my automation.
{{ states.sensor.aqara_1_3.state }};{{ states.sensor.aqara_1_battery_level.state }}This will stop the automation script from working:
Sensor 3:
Temperature Entity ID: sensor.temperature_8
Battery Level Entity ID: sensor.3_kok_battery_level
In this case I’m using:
{{ states.sensor.temperature_8.state }};{{ states.sensor.3_kok_battery_level.state }}
If I remove the last part: ;{{ states.sensor.3_kok_battery_level.state }} the automation works.In Lovelace UI it’s no problem to add the battery level for Sensor 3 (sensor.3_kok_battery_level) but if I use it in an automation like above it won’t work.
Can someone explain why I have this problem and how to solve it?
Posts: 3
Participants: 3