Battery temp in widget?

Post your questions and help other users.

Moderator: Martin

Post Reply
Posts: 20
Joined: 25 Feb 2016 15:47

Battery temp in widget?

Post by Bender64 » 15 Aug 2016 13:30

Hi it is possible to make this work? I try put text in widget "{battery_temperature}" / "{temp}" but not work.

User avatar
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Battery temp in widget?

Post by kintrupf » 16 Aug 2016 05:51

Yes, this is possible.
First, you need a trigger or condition that actually supplies the battery temperature variable! So create a new flow with a Battery Level trigger. The variable battery_temperature only exist within the flow (and not the widget) and only when trigger or the condition Battery Level is used. Otherwise the returned value will always be empty!
Second, add a Script action to copy the current temperature into a global variable: "global_battery_temperature = battery_temperature;"
Third, use the global variable {global_battery_temperature} in your widget instead of {battery_temperature}.

Now, every time the battery level changes, the temperature reading on your widget should be updated.

Post Reply