28 lines
875 B
YAML
28 lines
875 B
YAML
input_select:
|
|
leaf_ev_charging_mode:
|
|
icon: mdi:ev-plug-type1
|
|
name: Leaf EV Charge Mode
|
|
initial: "Normal (Offpeak)"
|
|
options:
|
|
- "Normal (Offpeak)"
|
|
- "Offpeak until charged"
|
|
- "1hr top-up now"
|
|
- "Charge now until full"
|
|
- "Stop charging now"
|
|
|
|
automation:
|
|
- id: set_the_leaf_ev_charging_mode
|
|
alias: Set the Leaf EV Charging MOde
|
|
trigger:
|
|
entity_id: input_select.leaf_ev_charging_mode
|
|
platform: state
|
|
action:
|
|
service: mqtt.publish
|
|
data:
|
|
topic: viewroad-status/evcharging/leaf-chargemode
|
|
payload:
|
|
'{% set mapping = { "Normal (Offpeak)":"normal", "Offpeak until charged":"offpeak-full",
|
|
"1hr top-up now":"boost", "Charge now until full":"now-full", "Stop charging now":"stop" } %} {% set dta = trigger.to_state.state %}
|
|
{{ mapping[dta] }}
|
|
'
|