Hei,
Har fått bygget, montert og integrert et OpenEVSE kit mot Home Assistant. Eksisterende Home Assistant integrasjon er utdatert og fungerer kun delvis.
Valgte å bruke MQTT for integrering, HTTP støttes også, mer info her
Sensors:
- platform: mqtt
state_topic: 'openevse/amp'
name: 'openevse_amp'
expire_after: 300
value_template: "{{ value | multiply(0.001) | round(2) }}"
unit_of_measurement: 'A'
unique_id: 'openevse001'
- platform: mqtt
state_topic: 'openevse/pilot'
expire_after: 300
name: 'openevse_pilot'
unit_of_measurement: 'A'
unique_id: 'openevse002'
- platform: mqtt
state_topic: 'openevse/wh'
name: 'openevse_wh'
expire_after: 300
unit_of_measurement: 'Wh'
unique_id: 'openevse003'
- platform: mqtt
state_topic: 'openevse/state'
name: 'openevse_state'
expire_after: 300
value_template: >-
{% set values = { '1':'Klar', '2':'Tilkoblet' ,'3':'Lader','4':'Feil', '254':'Klar - Bil tilkoblet', '255':'Klar - Bil ikke tilkoblet' } %}
{{ values[value] if value in values.keys() else 'Unknown' }}
unique_id: 'openevse004'
- platform: mqtt
state_topic: 'openevse/vehicle'
name: 'openevse_vehicle'
expire_after: 300
unique_id: 'openevse005'
- platform: mqtt
state_topic: 'openevse/colour'
name: 'openevse_colour'
expire_after: 300
value_template: >-
{% set values = { '0':'Off', '1':'Red' ,'2':'Green','3':'Yellow', '4':'Blue', '5':'Violet', '6':'Teal', '7':'White' } %}
{{ values[value] if value in values.keys() else 'Unknown' }}
unique_id: 'openevse006'
- platform: mqtt
state_topic: 'openevse/manual_override'
name: 'openevse_manual_override'
expire_after: 300
unique_id: 'openevse007'
Automation:
# Read charge level from MQTT
- alias: OpenEVSE Set slider
trigger:
platform: mqtt
topic: openevse/set_pilot
action:
service: input_number.set_value
target:
entity_id: input_number.openevse_capasity
data:
value: '{{ trigger.payload }}'
id: 56a6f9d542174f8bbd5dbb6633fe1342
# Publish MQTT charge level
- alias: OpenEVSE slider moved
trigger:
platform: state
entity_id: input_number.openevse_capasity
action:
service: mqtt.publish
data:
topic: openevse/rapi/in/$SC
retain: true
payload: '{{ states(''input_number.openevse_capasity'') | int }}'
id: c15be7f0051244839beef00a1ae32343
# Publish MQTT charge state on
- alias: OpenEVSE charge on
trigger:
entity_id: input_boolean.openevse_state
platform: state
to: 'on'
action:
service: mqtt.publish
data:
topic: openevse/rapi/in/$FE
retain: true
# payload: ''
id: c15be7f0051244839beef00a1a324324
# Publish MQTT charge state off
- alias: OpenEVSE charge off
trigger:
entity_id: input_boolean.openevse_state
platform: state
to: 'off'
action:
service: mqtt.publish
data:
topic: openevse/rapi/in/$FD
retain: true
# payload: ''
id: c15be7f0051244839beef00a1a345332
# Read back charge status and set input boleean
- alias: OpenEVSE charge set on
trigger:
entity_id: sensor.openevse_state
platform: state
to: 'Lader'
action:
service: input_boolean.turn_on
target:
entity_id: input_boolean.openevse_state
id: 56a6f9d542174f8bbd5dbb66334352
- alias: OpenEVSE charge set off
trigger:
- platform: template
value_template: "{{ not is_state('sensor.openevse_state', 'Lader') or (is_state('sensor.openevse_vehicle', '0'))}}"
action:
service: input_boolean.turn_off
target:
entity_id: input_boolean.openevse_state
id: 56a6f9d542174f8bbd5dbb663324342
# Overstyringsflagg på
- alias: OpenEVSE charge override on
trigger:
entity_id: sensor.openevse_manual_override
platform: state
to: '1'
condition:
condition: time
before: '22:00'
after: '10:00'
action:
service: input_boolean.turn_on
target:
entity_id: input_boolean.openevse_override
id: 56a6f9d542174f8bbd54324324258
# Overstyringsflagg av
- alias: OpenEVSE charge override off
trigger:
entity_id: sensor.openevse_vehicle
platform: state
to: '0'
action:
service: input_boolean.turn_off
target:
entity_id: input_boolean.openevse_override
id: 56a6f9d542174f8bbd5898654442
configuration:
input_number:
# OpenEVSE Kapasitet
openevse_capasity:
name: Ladestrøm
min: 6
max: 16
step: 1
unit_of_measurement: 'A'
icon: mdi:target
input_boolean:
openevse_state:
name: Lading
icon: mdi:car-battery
initial: off
openevse_override:
name: Overstyring
icon: mdi:car-battery
initial: off