Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to documentation for charge speed guestimate. #278

Closed
tanathka opened this issue Apr 30, 2024 · 0 comments · Fixed by #281
Closed

Update to documentation for charge speed guestimate. #278

tanathka opened this issue Apr 30, 2024 · 0 comments · Fixed by #281
Assignees

Comments

@tanathka
Copy link

tanathka commented Apr 30, 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.


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
dvx76 added a commit to dvx76/homeassistant-skodaconnect that referenced this issue May 5, 2024
@dvx76 dvx76 self-assigned this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants