65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
mqtt:
|
|
sensor:
|
|
- unique_id: 32a_ev_wallcharger_power
|
|
name: "32A EV Wallcharger Power"
|
|
device_class: power
|
|
unit_of_measurement: kW
|
|
state_topic: "stat/tasmo-wemosd1-7280-powermon-1/EnergyMeterCount"
|
|
value_template: "{{ value_json.EVChargerWhCount * 2 * 60 / 1000 }}"
|
|
- unique_id: 16a_ev_wallcharger_power
|
|
name: "16A EV Wallcharger Power"
|
|
device_class: power
|
|
unit_of_measurement: kW
|
|
state_topic: "stat/tasmo-s4chan-7594-garage-1/EnergyMeterCount"
|
|
value_template: "{{ value_json.EVChargerWhCount * 2 * 60 / 1000 }}"
|
|
|
|
# Use the Riemann sum integral to calculate energy in kWh
|
|
# from the contimuous power measuring sensors
|
|
sensor:
|
|
- platform: integration
|
|
unique_id: 32a_ev_wallcharger_power_total
|
|
name: "32A EV Wallcharger Power Total"
|
|
source: sensor.32a_ev_wallcharger_power
|
|
#device_class: energy
|
|
#unit_of_measurement: Wh
|
|
#unit_time: h
|
|
#unit_prefix: k # Show in kWh
|
|
round: 0 # Only need 0 decimals accuracy
|
|
- platform: integration
|
|
unique_id: 16a_ev_wallcharger_power_total
|
|
name: "16A EV Wallcharger Power Total"
|
|
source: sensor.16a_ev_wallcharger_power
|
|
#device_class: energy
|
|
#unit_of_measurement: Wh
|
|
#unit_time: h
|
|
#unit_prefix: k
|
|
round: 0
|
|
|
|
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] }}
|
|
'
|