53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
mqtt:
|
|
sensor:
|
|
- unique_id: 32a_ev_charger_power
|
|
name: "32A EV Charger Power"
|
|
state_topic: "stat/tasmo-wemosd1-7280-powermon-1/EnergyMeterCount"
|
|
value_template: "{{ value_json.EVChargerWhCount * 2 * 60 }}"
|
|
- unique_id: 16a_ev_charger_power
|
|
name: "16A EV Charger Power"
|
|
state_topic: "stat/tasmo-s4chan-7594-garage-1/EnergyMeterCount"
|
|
value_template: "{{ value_json.EVChargerWhCount * 2 * 60 }}"
|
|
|
|
sensor:
|
|
- platform: integration
|
|
unique_id: 32a_ev_charger_power_total
|
|
name: "32A EV Charger Power Total"
|
|
source: sensor.32a_ev_charger_power
|
|
#unit_prefix: k
|
|
#round: 2
|
|
- platform: integration
|
|
unique_id: 16a_ev_charger_power_total
|
|
name: "16A EV Charger Power Total"
|
|
source: sensor.16a_ev_charger_power
|
|
#unit_prefix: k
|
|
#round: 2
|
|
|
|
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] }}
|
|
'
|