You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somewhere along the way the timeleft got changed to minutes and the entering the battery capacity in watts seems a little redundant.
I may have put too many '| int' in there as well. Not perfect code but it works as of April 2024.4.4 release.
template:
- sensor:
- name: "Charge speed guesstimate"
state: >
{% if is_state('switch.skoda_<name>_charging', 'on') %}
{% set battery_capacity = <battery-size-in-kwh> | int %}
{% set charge = { "remaining": states('sensor.skoda_<name>_minimum_charge_level') | int - states('sensor.skoda_<name>_battery_level') | int } %}
{% set timeleft = states('sensor.skoda_<name>_charging_time_left') | int %}
{% set chargeleft = battery_capacity * charge.remaining / 100 %}
{% set chargespeed = chargeleft / (timeleft / 60) %}
{{ chargespeed | round (1) }}
{% else %}
0
{% endif %}
unit_of_measurement: "kW"
state_class: measurement
The text was updated successfully, but these errors were encountered:
dvx76
added a commit
to dvx76/homeassistant-skodaconnect
that referenced
this issue
May 5, 2024
Please search issues in https://github.com/skodaconnect/skodaconnect and https://github.com/skodaconnect/homeassistant-skodaconnect for duplicates or fixes before reporting a new issue.
Somewhere along the way the timeleft got changed to minutes and the entering the battery capacity in watts seems a little redundant.
I may have put too many '| int' in there as well. Not perfect code but it works as of April 2024.4.4 release.
The text was updated successfully, but these errors were encountered: