Vevor EV charger: expose online_state as a switch rather than sensor"
Just as in commit a5ca25fa17f1 ("Tongou QCB2: expose online_state as a
switch rather than sensor"), online_state is used to trigger the updates of
dps 6 (power, current, voltage). Once set, updates are happening about
every 5 secondes. This needs to be renewed every 2 minutes.
The following HA automation works:
alias: EV charger stats refresh
description: ""
triggers:
- trigger: state
entity_id:
- switch.portable_ev_charger
to: "on"
- trigger: state
entity_id:
- timer.ev_charger_stats
from: active
to: idle
conditions: []
actions:
- action: switch.turn_on
target:
entity_id: switch.portable_ev_charger_live_updates
data: {}
- condition: state
entity_id: switch.portable_ev_charger
state: "on"
- action: timer.start
target:
entity_id: timer.ev_charger_stats
data:
duration: "00:02:00"
mode: single
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>