Skip to content

remaining fuel sensor in HA #249

Answered by gerard33
jackshaw20 asked this question in Q&A
Nov 14, 2020 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

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.

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.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jackshaw20
Comment options

@gerard33
Comment options

@jackshaw20
Comment options

Answer selected by gerard33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants