I have been trying for days now to get the iPhone lock screen gauge to work. A few people on Facebook have been extremely helpful but still it wont display the entity state properly. All I get is a gauge with questions marks.
Can anyone help?
Currently I have the following script . Value template (0-1)
{% set original = states(‘sensor.ioniq_5_ev_battery_level’) | float %}
{% set minimum = 0 %}
{% set maximum = 100 %}
{% set adjusted = min(maximum, max(minimum, original)) %}
{{ (adjusted - minimum) / (maximum - minimum) }}
Value Label template
{{states(‘sensor.ioniq_5_ev_battery_level’) }}
{% set original = states("sensor.batteries_state_of_capacity") | float %}
{% set minimum = 0.0 %}
{% set maximum = 100.0 %}
{% set adjusted = min(maximum, max(minimum, original)) %}
{{ (adjusted - minimum) / (maximum - minimum) }}
in the value template field, 0 for min label template, 100 for max label template and “Bat” for value lable template. Probably overkill for a percentage value, but it worked right away.
I have exactly that with my ev battery entity in but still it wont display anything other than a gauge with ? on.
Going to try another entity even thou it works fine in the developer tools test
After recent HA Companion app update, all of my lock screen HA widgets stopped to work (Unable to load). Perhaps there is some issue for you with that as weel. Can you try just action windet, or any other? BTW widgets load properly on home screen…
@mccltd Only other thing I can think of is for you to check if your home assistant components are at their latest level?
@mirekmal I have a similar issue, not sure how often these are supposed to update but it seems quite slow. Slow enough to be not terribly useful. Perhaps I’m using it wrong – I setup 3 widgets put my battery %age, house energy draw + solar production (both W). The last two values change very fast whereas the percentage does not.
I ended up with using it only for actions; that was convinient to have the readily available on the lock screen. Previously sooner or lated actions were available in the widget. Now, it is already copuple of days and still ‘unable to load’… I’d not call it delay… it just does not work at all
There is also a way easier way to display this gauge when you have a battery sensor (or al kind of sensor that goes from 0 to 100):
Gauge Type: Normal (Single label)
I set Single to avoid having useless numbers (Iknow that the minimum is 0, and the max is 100, no need to show them)
Server: Home
Value Template (0-1): {{ states("sensor.your_sensor")|round(0) / 100 }}
Value Label Template: {{ states("sensor.your_sensor")|round(0)}}%
Last field: kia
This is what I’m using for my Kia EV3 for example. As I set a charge limit to 90, this gauge shows last 10% empty, behavior that I like because it can happen that I’ll ask for a 100% charge.