Hello, I want to share complete integration of EV Charger AC - EM-CP-PP-ETH - 2902802 by Phoenix Contact.
https://www.phoenixcontact.com/online/portal/gb/?uri=pxc-oc-itemdetail:pid=2902802
This post is based on “EV Charger control with Modbus TCP”, but my controller is using different addresses/registers.
I want to write guide for newbies, because I spent hours with finding good section for pasted code and so on.
In your configuration.yaml put:
modbus:
- name: evmiki
type: tcp
host: 192.168.50.66
port: 502
To sensor section add:
- platform: modbus
scan_interval: 5
registers:
- name: EVMikiChargeTime
hub: evmiki
unit_of_measurement: s
slave: 180
register: 102
register_type: input
data_type: int
- name: EVMikiChargeCurrent
hub: evmiki
slave: 180
register: 300
register_type: holding
scale: 1
data_type: int
unit_of_measurement: A
- name: EVMikiStateDec
hub: evmiki
slave: 180
register: 100
register_type: input
- platform: template
sensors:
evmikistatetxt:
friendly_name: "EV Miki Charger State"
value_template: >-
{% if is_state('sensor.evmikistatedec', '65') %}
Disconnected
{% elif is_state('sensor.evmikistatedec', '66') %}
Connected
{% elif is_state('sensor.evmikistatedec', '67') %}
Charging
{% elif is_state('sensor.evmikistatedec', '68') %}
With ventilation
{% elif is_state('sensor.evmikistatedec', '69') %}
No energy
{% elif is_state('sensor.evmikistatedec', '70') %}
Error
{% else %}
failed
{% endif %}
To switch section add:
- platform: modbus
scan_interval: 5
coils:
- name: EVMikiChargerEnable
hub: evmiki
slave: 180
coil: 400
- name: EVMikiChargerReset
hub: evmiki
slave: 180
coil: 413
Create helper (number) called “EVMikiRequestedCurrent” min:0 max:32 step:1 unit:A
In automations section add:
- id: '1598715668668'
alias: G EV Miki Set Current - Off
description: ''
trigger:
- entity_id: input_number.evmikirequestedcurrent
platform: state
condition:
- below: '6'
condition: numeric_state
entity_id: input_number.evmikirequestedcurrent
action:
- data: {}
entity_id: switch.evmikichargerenable
service: switch.turn_off
mode: single
- id: '1598715830222'
alias: G EV Miki Set Current - 6-32A
description: ''
trigger:
- entity_id: input_number.evmikirequestedcurrent
platform: state
condition:
- above: '5'
condition: numeric_state
entity_id: input_number.evmikirequestedcurrent
action:
- data: {}
entity_id: switch.evmikichargerenable
service: switch.turn_on
- data_template:
address: 300
hub: evmiki
unit: 180
value: '{{ states(''input_number.evmikirequestedcurrent'') | int }}'
service: modbus.write_register
mode: single
Now you can control you EV charger by changing value of “EVMikiRequestedCurrent”. If current is <6A then charging station is disabled, whe is >6A charging station is enabled and requested current is send. After 5s (when data are read back to HA) you can see change on “EVMikiChargeCurrent”.
I hope, that I didn’t forgot to anythng…