get battery data All questions

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.

Asked by vinny on July 28, 2021, at 12:09pm

Hi Vinny, I've had a few other requests regarding device properties.  What I'd like to add is the ability to check:

  • the property equals a certain value (current functionality)
  • greater or less than a value
  • between two values

I think that would streamline your sequence.

This also ties in a bit with your other question here.  You had asked about webhooks to control devices but perhaps there could be something similar which would retrieve device properties.  

I don't have an immediate answer for you now, except that this is something I'm working on. I'll post back here once there are some changes which would help you.

hi Derek, thank you for your response and your continuous efforts to improve your service!

having the ability to check if a device's battery level is greater or lesser then a value, or between two values, would be perfect for me, then i could simply create 3 "states', similar to the motion sensor (low-middle-high), and i would only need 2 if clauses per device to do it!


Hi, same question for me, as I would like to check hygrometries (to control my mechanical ventilation).

What I want : "if Hygro1-Hygro2 > 10%, then activateFan"

So it would love to get properties values in variables. Is it possible to do something like :

"Set Variable to [TempHygroSDB.va_humidity]" ?

Thanks for all the work :)

Hi Jo, at the moment you can't move those values into variables, but this is also a good feature request. Unfortunately I've had a busy few months and haven't been able to add any new significant features, apart from minor enhancements. However, I've added this to the backlog to revisit.

Hope you to have plenty of time and luck in life ! :)

Post a reply

The SEQUEmatic bot is still new and learning. If you don't get the answer you need, just ask to speak with Derek and your chat will be transferred.