le evse_template_number.yaml
- name: evse max-DLB A
unique_id: evse1_max_dlb
state: "{{ states('sensor.evse_max_dlb') }}"
# min: "{{ [1300, states('sensor.evse_max_dlb')|int(1300)]|max }}"
min: 1
max: 63
step: 0.5
availability: "{{ not states('sensor.evse_max_dlb') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 102
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse max-PWM A
unique_id: evse1_max_pwm
state: "{{ states('sensor.evse_max_pwm') }}"
min: 6
max: 33
step: 1
availability: "{{ not states('sensor.evse_max_pwm') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 109
unit: 255
hub: evse
value: "{{ value * 166.7 }}"
- name: evse max CT-curent
unique_id: evse1_max_ct_current
state: "{{ states('sensor.evse_max_ct_current') }}"
min: 50
max: 150
step: 1
availability: "{{ not states('sensor.evse_max_ct_current') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 103
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse DLB max-startup
unique_id: evse1_dlb_max_startup
state: "{{ states('sensor.evse_dlb_max_startup') }}"
min: 10
max: 100
step: 1
availability: "{{ not states('sensor.evse_dlb_max_startup') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 101
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse sampling coef
unique_id: evse1_sampling coef
state: "{{ states('sensor.evse_sampling_calibration_coef') }}"
min: 900
max: 1400
step: 1
availability: "{{ not states('sensor.evse_sampling_calibration_coef') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 104
unit: 255
hub: evse
value: "{{ value }}"
et le evse_template_sensor.yaml
- name: EVSE status
unique_id: evse_status_text
state: >
{% set modes = {
'0': 'demarrage',
'1': 'libre, barnchez-la !',
'2': 'principal',
'3': 'charge TERMINEE',
'4': 'Bypass mode',
'5': 'en charge...',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'10': '10',
'11': 'Fault mode'}
%}
{% if states('sensor.evse_status') in modes.keys() %}
{{ modes.get(states('sensor.evse_status')) }}
{% else %}
{{ states('sensor.evse_status') }}
{% endif %}
- name: evse max-DLB A
unique_id: evse1_max_dlb
state: "{{ states('sensor.evse_max_dlb') }}"
# min: "{{ [1300, states('sensor.evse_max_dlb')|int(1300)]|max }}"
min: 1
max: 63
step: 0.5
availability: "{{ not states('sensor.evse_max_dlb') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 102
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse max-PWM A
unique_id: evse1_max_pwm
state: "{{ states('sensor.evse_max_pwm') }}"
min: 6
max: 33
step: 1
availability: "{{ not states('sensor.evse_max_pwm') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 109
unit: 255
hub: evse
value: "{{ value * 166.7 }}"
- name: evse max CT-curent
unique_id: evse1_max_ct_current
state: "{{ states('sensor.evse_max_ct_current') }}"
min: 50
max: 150
step: 1
availability: "{{ not states('sensor.evse_max_ct_current') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 103
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse DLB max-startup
unique_id: evse1_dlb_max_startup
state: "{{ states('sensor.evse_dlb_max_startup') }}"
min: 10
max: 100
step: 1
availability: "{{ not states('sensor.evse_dlb_max_startup') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 101
unit: 255
hub: evse
value: "{{ value * 100 }}"
- name: evse sampling coef
unique_id: evse1_sampling coef
state: "{{ states('sensor.evse_sampling_calibration_coef') }}"
min: 900
max: 1400
step: 1
availability: "{{ not states('sensor.evse_sampling_calibration_coef') in ['unavailable', 'unknown', 'none'] }}"
set_value:
- service: modbus.write_register
data:
address: 104
unit: 255
hub: evse
value: "{{ value }}"
et le evse_template_sensor.yaml
- name: EVSE status
unique_id: evse_status_text
state: >
{% set modes = {
'0': 'demarrage',
'1': 'libre, barnchez-la !',
'2': 'principal',
'3': 'charge TERMINEE',
'4': 'Bypass mode',
'5': 'en charge...',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'10': '10',
'11': 'Fault mode'}
%}
{% if states('sensor.evse_status') in modes.keys() %}
{{ modes.get(states('sensor.evse_status')) }}
{% else %}
{{ states('sensor.evse_status') }}
{% endif %}