Closed KlausJuhl closed 9 months ago
I do not really see a reason why the integration should handle this kind of "logical" decision. From my point of view the task of an integration is to make sure the data from your smart device is available in HomeAssistant with some context what this data is. Within Home Assistant you can then use this data to take logical decision (like charging -> yes / no).
What you are asking is easily achievable with a HA template sensor looking e.g. like this :
template:
- binary_sensor:
- name: CurrentlyChargingBinary
state: >-
{% set s = states('sensor.wattpilot_chargingreason') %}
{% if s | regex_match('^NotCharging.*',ignorecase=True) %}False
{% elif s | regex_match('^Charging.*',ignorecase=True) %}True
{% else %}Unknown{% endif %}
Alternatively an already available sensor (which btw is used for the visualization in the native app, too) with "less" options is the following:
If you preferer to use this as source and still want to use a binary_sensor (on/off), a template looks like this:
template:
- binary_sensor:
- name: CurrentlyChargingBinary
state: >-
{% set s = states('sensor.wattpilot_carstate') %}
{% if s in [ 'Idle', 'Wait Car', 'Complete', 'Error' ] %}False
{% elif s in [ 'Charging' ] %}True
{% else %}Unknown{% endif %}
Charging status is not shown directly in the integration
In the App you can see when the charging status is stopped:
In the integration the same information is sort of available in the [Wattpilot ChargingReason] = NotChargingBecauseForceStateOff
Requested feature It would be great to have a clear indication of the Charging state, fx. A new sensor fx. [WattpilotChangeState] with values 'On', 'Off'
To Reproduce Steps to reproduce the behavior:
Version of Home Assistant Core is installed 2023.12.3
Version of Wattpilot integration is installed v0.1.9
Version of Wattpilot 11KW V2 Firmware 40.7