hello, i recently found an option to check a device's battery state and created this simple sequence;
- If the battery_percentage of backdoor is 50, then...
- Else
- End of condition
- If the battery_percentage of frontdoor is 50, then...
- Else
- End of condition
- If the battery_percentage of bathroom is 50, then...
- Else
- End of condition
- If the battery_state of Smart PIR sensor is low, then...
- Else
- End of condition
testing this macro by using the "run sequence now" button at the bottom results in this entry in the sequence log;
Triggered manually by user
The device backdoor battery_percentage was 99 not 50 (condition failed)
The device frontdoor battery_percentage was 75 not 50 (condition failed)
The device bathroom battery_percentage was 99 not 50 (condition failed)
The device Smart PIR sensor battery_state was middle not low (condition failed)
now my question is, is there any way to get my hands on this data in the sequence log?
there has to be an easier way then creating 100 if clauses for each device that check if the battery is at 1-100% and then 100 actions to write that number to a variable,
if i would create this and the first step is an if clause that checks if the battery is 1%, and the battery is really at 99%, then the sequence will run 98 more if clauses to check the battery level before it "finds" the correct one, even though the sequence log already said after checking the fist if clause that it was at 99%.
maybe it's an idea to have an option to "write device state to variable" for the "Property field" in the "Tuya Smart Life device status" step? so it would just write that device's info (on/off state, battery level, brightness, temp value, just everything that exists for that device) to a variable, and we can then acces that variable via webhook and extract whatever we want from it.
i hope this makes some sense? and i hope there is/will be another (smoother) way to get this data.
PS:
what i wanted to use the data for is just to keep track of it and alert me when a device's battery is low (using an android app), because i have enabled "low battery alerts" on all my devices, and it has never given a low battery notification for any of them, they just stop working.