remaining fuel sensor in HA #249
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Looks like a Default value, I cannot imagine your car ever having 0mi remaining fuel. |
Beta Was this translation helpful? Give feedback.
-
I have looked into this a bit more and the data coming from BMW is fine, its a problem with a template sensor I have configured to change from KM to MI, but not sure why it keeps getting random 0 miles as this has worked fine previously and also works fine on the other vehicle; see below sensors, the X3 template is the one giving random 0s. |
Beta Was this translation helpful? Give feedback.
-
Strange indeed that it works correct for the X2 template and not for the X3 template. Nice cars btw 😎 I have checked your template and if the sensor is not available it will get the value 0. Does your sensor You can try to use this in value_template as that checks if the value > 0 and otherwise does nothing. value_template: >
{% if states('sensor.x3_m40i_mileage')|float > 0 %}
{{ (states('sensor.x3_m40i_mileage')|float/1.60934)|round(0) }}
{% endif %} And just to be sure; if you set HA to imperial it will use miles for this integration. |
Beta Was this translation helpful? Give feedback.
Strange indeed that it works correct for the X2 template and not for the X3 template. Nice cars btw 😎
I have checked your template and if the sensor is not available it will get the value 0. Does your sensor
sensor.x3_m40i_mileage
gets unavailable sometimes?You can try to use this in value_template as that checks if the value > 0 and otherwise does nothing.
And just to be sure; if you set HA to imperial it will use miles for this integration.