Hi.
Did you get yours working from RJ12 port?
So far I haven’t got anything out from mine.
Did quick check with scope but there doesn’t seem to be any signal from charger.
you must change your pin (gpio) config in the yaml to your hardware where you connect the rs485 shield
I checked spring terminals with scope today from my charger.
Cant find signals from any pin.
What did you request from your charger?
I had my ESP-RS232-485 converter connected and only TX blinks, same as when its not connected.
When measuring with scope there was nothing connected was just looking is there any life in any of pins.
There is zero communication if you don’t make valid modbus request.
Good to know.
Shouldn’t this project running on ESP make valid requests?
At least there is some traffic leaving.
Can you recommend things I should try/check?
No idea what you requested… How is your yaml and your corresponding log?
Hey there, yesterday I got my build of this project working. Thought I might share here since some information is missing or scattered all around.
I ended up using a Wemos D1 mini (or a clone of it) with a DC-DC step down converter and a MAX485 TTL converter.
Inside the eMH1 there is a header with 12V, might be hard to see on the picture but it’s deep inside to the bottom left of the circuit board (where I attached the red and blue wires). The headers are labeled 12V and M for +12V and GND respectively.
IMPORTANT!
The DC-DC stepdown converter needs to be “configured” otherwise you will fry your ESP. Plug the module into the 12V of the wallbox and it will most likely output 12V as well. You will need to turn the potentiometer on the module so that it will output 5V. Measure with a multimeter.
My wallbox uses RJ45 jacks for the RS485 interface so I crimped my own connector according to the pinout @zwartevogel sent.
I then plugged the RJ45 I made into the slot on the bottom.
I covered the backside of my board with electrical tape and chucked it into the enclosure of the wallbox and closed it up.
Wiring
My final wiring of the board looks something like this:
I added a capacitor to potentially smooth out the voltage and to cushion potential current spikes of the ESP.
With this wiring scheme my config now looks like this:
substitutions:
name: abl_emh1
device_description: "Monitor and configure ABL eMH1 Charger via RS485/Modbus-ASCII"
external_components_source: https://github.com/jrv/esphome-abl-emh1
tx_pin: "GPIO1"
rx_pin: "GPIO3"
flow_control_pin: "GPIO12"
# ...
# replacing esp32
esp8266:
board: d1_mini
# redirecting the logging uart to the second one (only TX) for good measure
# see https://esphome.io/components/uart.html#hardware-uarts
# I don't know if this is necessary
logger:
hardware_uart: "UART1"
# ...
Hope this helps
This is yaml for ESP
substitutions:
name: esphome-web-8c5fa4
friendly_name: ESPHome EV Charger 8c5fa4
device_description: "Monitor and configure ABL eMH1 Charger via RS485/Modbus-ASCII"
external_components_source: https://github.com/jrv/esphome-abl-emh1
tx_pin: "17"
rx_pin: "16"
flow_control_pin: "5"
esphome:
name: ${name}
comment: ${device_description}
friendly_name: ABL eMH1
project:
name: "jrv.esphome-abl-emh1"
version: 0.0.1
esp32:
board: esp32dev
external_components:
source:
type: git
url: ${external_components_source}
ref: main
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
- platform: esphome
id: ota_esphome
logger:
level: DEBUG
api:
encryption:
key: Jxxxxxx=
uart:
id: uart_2
baud_rate: 38400
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
parity: EVEN
emh1_modbus:
uart_id: uart_2
flow_control_pin: ${flow_control_pin}
id: modbus0
abl_emh1:
emh1_modbus_id: modbus0
update_interval: 5s
preferences:
flash_write_interval: 5min
text_sensor:
- platform: abl_emh1
mode:
name: "Status"
serial_number:
name: "Serial number"
disabled_by_default: true
- platform: template
name: Chargemode
id: chargemode
icon: "mdi:car"
update_interval: 5s
disabled_by_default: true
lambda: |-
int phaseCnt = 0;
if (id(outlet_state).state == 0xC2) {
if (id(l1_current).state > 1.0)
phaseCnt++;
if (id(l2_current).state > 1.0)
phaseCnt++;
if (id(l3_current).state > 1.0)
phaseCnt++;
}
std::__cxx11::string result;
switch (phaseCnt){
case 0:
result = "None";
break;
case 1:
result = "1 Phase";
break;
default:
result = "3 Phase";
}
return result;
sensor:
- platform: abl_emh1
l1_current:
name: "L1 current"
state_class: "measurement"
accuracy_decimals: 0
id: l1_current
l2_current:
name: "L2 current"
state_class: "measurement"
accuracy_decimals: 0
id: l2_current
l3_current:
name: "L3 current"
state_class: "measurement"
accuracy_decimals: 0
id: l3_current
max_current:
name: "Max current"
state_class: "measurement"
id: max_current
disabled_by_default: true
accuracy_decimals: 0
en1_status:
name: "EN1 status"
disabled_by_default: true
en2_status:
name: "EN2 status"
disabled_by_default: true
duty_cycle_reduced:
name: "Reduced Duty Cycle (max_current)"
disabled_by_default: true
ucp_status:
name: "Ucp Status <= 10V"
disabled_by_default: true
outlet_state:
name: "Outlet state"
disabled_by_default: true
id: outlet_state
- platform: uptime
name: Uptime Sensor
id: abl_uptime
update_interval: 15s
number:
- platform: template
name: "Max Amps"
id: set_current
icon: mdi:arrow-oscillating
min_value: 3
max_value: 32
step: 1
optimistic: false
lambda: 'return std::lround(id(max_current).state);'
update_interval: 1s
set_action:
lambda: |-
ESP_LOGD("main", "Sending modbus value = %d", std::lround(x));
id(modbus0)->send_current(std::lround(x));
switch:
- platform: template
name: "Enable"
id: enable_switch
icon: "mdi:power"
lambda: 'return (id(outlet_state).state != 0xE0);'
turn_off_action:
- lambda: |-
if ((id(abl_uptime).state > 10.0) && (id(outlet_state).state != NAN))
id(modbus0)->send_enable(0);
turn_on_action:
- lambda: |-
if ((id(abl_uptime).state > 10.0) && (id(outlet_state).state != NAN))
id(modbus0)->send_enable(1);
And this is what log shows
[18:06:30][C][emh1_modbus:162]: eMH1Modbus:
[18:06:30][C][emh1_modbus:163]: Flow Control Pin: GPIO5
[18:06:30][E][uart:029]: Invalid parity: Integration requested parity NONE but you have EVEN!
[18:06:30][C][template.text_sensor:020]: Template Sensor 'Chargemode'
[18:06:30][C][template.text_sensor:020]: Icon: 'mdi:car'
[18:06:30][C][uptime.sensor:031]: Uptime Sensor 'Uptime Sensor'
[18:06:30][C][uptime.sensor:031]: Device Class: 'duration'
[18:06:30][C][uptime.sensor:031]: State Class: 'total_increasing'
[18:06:30][C][uptime.sensor:031]: Unit of Measurement: 's'
[18:06:30][C][uptime.sensor:031]: Accuracy Decimals: 0
[18:06:30][C][uptime.sensor:031]: Icon: 'mdi:timer-outline'
[18:06:30][C][template.number:050]: Template Number 'Max Amps'
[18:06:30][C][template.number:050]: Icon: 'mdi:arrow-oscillating'
[18:06:30][C][template.number:051]: Optimistic: NO
[18:06:30][C][template.number:052]: Update Interval: 1.0s
[18:06:30][C][template.switch:068]: Template Switch 'Enable'
[18:06:30][C][template.switch:070]: Icon: 'mdi:power'
[18:06:30][C][template.switch:091]: Restore Mode: always OFF
[18:06:30][C][template.switch:057]: Optimistic: NO
[18:06:30][C][abl_emh1:151]: ABLeMH1:
[18:06:30][C][abl_emh1:152]: Address: 0x01
[18:06:30][C][abl_emh1:153]: Outlet State 'Outlet state'
[18:06:30][C][abl_emh1:153]: State Class: ''
[18:06:30][C][abl_emh1:153]: Unit of Measurement: ''
[18:06:30][C][abl_emh1:153]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:153]: Icon: 'mdi:information'
[18:06:30][C][abl_emh1:155]: EN1 Status 'EN1 status'
[18:06:30][C][abl_emh1:155]: State Class: ''
[18:06:30][C][abl_emh1:155]: Unit of Measurement: ''
[18:06:30][C][abl_emh1:155]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:155]: Icon: 'mdi:information'
[18:06:30][C][abl_emh1:156]: EN2 Status 'EN2 status'
[18:06:30][C][abl_emh1:156]: State Class: ''
[18:06:30][C][abl_emh1:156]: Unit of Measurement: ''
[18:06:30][C][abl_emh1:156]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:156]: Icon: 'mdi:information'
[18:06:30][C][abl_emh1:157]: Duty cycle reduced 'Reduced Duty Cycle (max_current)'
[18:06:30][C][abl_emh1:157]: State Class: ''
[18:06:30][C][abl_emh1:157]: Unit of Measurement: ''
[18:06:30][C][abl_emh1:157]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:157]: Icon: 'mdi:information'
[18:06:30][C][abl_emh1:158]: UCP Status 'Ucp Status <= 10V'
[18:06:30][C][abl_emh1:158]: State Class: ''
[18:06:30][C][abl_emh1:158]: Unit of Measurement: ''
[18:06:30][C][abl_emh1:158]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:158]: Icon: 'mdi:information'
[18:06:30][C][abl_emh1:159]: L1 Current 'L1 current'
[18:06:30][C][abl_emh1:159]: Device Class: 'current'
[18:06:30][C][abl_emh1:159]: State Class: 'measurement'
[18:06:30][C][abl_emh1:159]: Unit of Measurement: 'A'
[18:06:30][C][abl_emh1:159]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:160]: L2 Current 'L2 current'
[18:06:30][C][abl_emh1:160]: Device Class: 'current'
[18:06:30][C][abl_emh1:160]: State Class: 'measurement'
[18:06:30][C][abl_emh1:160]: Unit of Measurement: 'A'
[18:06:30][C][abl_emh1:160]: Accuracy Decimals: 0
[18:06:30][C][abl_emh1:161]: L3 Current 'L3 current'
[18:06:31][C][abl_emh1:161]: Device Class: 'current'
[18:06:31][C][abl_emh1:161]: State Class: 'measurement'
[18:06:31][C][abl_emh1:161]: Unit of Measurement: 'A'
[18:06:31][C][abl_emh1:161]: Accuracy Decimals: 0
[18:06:31][C][abl_emh1:162]: Max current 'Max current'
[18:06:31][C][abl_emh1:162]: Device Class: 'current'
[18:06:31][C][abl_emh1:162]: State Class: 'measurement'
[18:06:31][C][abl_emh1:162]: Unit of Measurement: 'A'
[18:06:31][C][abl_emh1:162]: Accuracy Decimals: 0
[18:06:31][C][abl_emh1:163]: Mode name 'Status'
[18:06:31][C][abl_emh1:163]: Icon: 'mdi:information'
[18:06:31][D][sensor:094]: 'Uptime Sensor': Sending state 9.54200 s with 0 decimals of accuracy
[18:06:31][C][mdns:115]: mDNS:
[18:06:31][C][mdns:116]: Hostname: esphome-web-8c5fa4
[18:06:31][C][esphome.ota:073]: Over-The-Air updates:
[18:06:31][C][esphome.ota:074]: Address: esphome-web-8c5fa4.local:3232
[18:06:31][C][esphome.ota:075]: Version: 2
[18:06:31][C][safe_mode:018]: Safe Mode:
[18:06:31][C][safe_mode:020]: Boot considered successful after 60 seconds
[18:06:31][C][safe_mode:021]: Invoke after 10 boot attempts
[18:06:31][C][safe_mode:023]: Remain in safe mode for 300 seconds
[18:06:31][C][api:139]: API Server:
[18:06:31][C][api:140]: Address: esphome-web-8c5fa4.local:6053
[18:06:31][C][api:142]: Using noise encryption: YES
[18:06:31][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:32][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:33][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:34][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:34][W][emh1_modbus:173]: Query Status Report
[18:06:34][D][emh1_modbus:283]: TX -> :0103002E0005C9
[18:06:34][D][text_sensor:064]: 'Chargemode': Sending state 'None'
[18:06:35][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:36][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:37][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:38][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:39][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:39][W][emh1_modbus:173]: Query Status Report
[18:06:39][D][emh1_modbus:283]: TX -> :0103002E0005C9
[18:06:39][D][text_sensor:064]: 'Chargemode': Sending state 'None'
[18:06:40][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:41][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:42][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:43][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:44][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:44][W][emh1_modbus:173]: Query Status Report
[18:06:44][D][emh1_modbus:283]: TX -> :0103002E0005C9
[18:06:44][D][text_sensor:064]: 'Chargemode': Sending state 'None'
[18:06:45][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:46][D][sensor:094]: 'Uptime Sensor': Sending state 24.50700 s with 0 decimals of accuracy
[18:06:46][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:47][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:48][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:49][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:49][W][emh1_modbus:173]: Query Status Report
[18:06:49][D][emh1_modbus:283]: TX -> :0103002E0005C9
[18:06:49][D][text_sensor:064]: 'Chargemode': Sending state 'None'
[18:06:50][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:51][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:52][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:53][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:54][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:54][D][sensor:094]: 'L1 current': Sending state nan A with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'L2 current': Sending state nan A with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'L3 current': Sending state nan A with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'Max current': Sending state nan A with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'EN1 status': Sending state nan with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'EN2 status': Sending state nan with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'Reduced Duty Cycle (max_current)': Sending state nan with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'Ucp Status <= 10V': Sending state nan with 0 decimals of accuracy
[18:06:54][D][sensor:094]: 'Outlet state': Sending state 0.00000 with 0 decimals of accuracy
[18:06:54][D][text_sensor:064]: 'Status': Sending state 'Offline'
[18:06:54][D][text_sensor:064]: 'Serial number': Sending state ''
[18:06:54][D][abl_emh1:124]: The device is or was offline. Broadcasting discovery for address configuration...
[18:06:54][W][emh1_modbus:183]: Query Serial Number
[18:06:54][D][emh1_modbus:283]: TX -> :010300500008A4
[18:06:54][W][component:237]: Component abl_emh1 took a long time for an operation (121 ms).
[18:06:54][W][component:238]: Components should block for at most 30 ms.
[18:06:54][D][text_sensor:064]: 'Chargemode': Sending state 'None'
[18:06:55][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:56][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:57][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:58][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:59][D][number:012]: 'Max Amps': Sending state 2147483648.000000
[18:06:59][W][emh1_modbus:173]: Query Status Report
[18:06:59][D][emh1_modbus:283]: TX -> :0103002E0005C9
[18:06:59][D][text_sensor:064]: 'Chargemode': Sending state 'None'
One thing that came to my mind is that my 232-485 converter doesnt have flow control pin so its not connected from ESP. But TX led on converter blinks, RX doesnt.
There is life in lines from ESP when measured with scope.
That’s ok. But is your converter rs485-TTL or 232-485 like you write ?? Rs232 signal is not “compatible” with esp serial.
Ps. Your log shows error for even parity.
It has print RS485 to TTL so that should be OK.
Is parity error as simple as changing EVEN to NONE in YAML?
Yes, but I don’t know your custom library.
Anyway, most of modbus implementations use None.
I tried to follow instructions of jrvs project.
I have Espduino that has ESP Wroom 32.
This is my second implementation of ESPs, first one has been BLE proxies. So knowledge of these things are basically 0 so far.
I don’t know Espduino but esp wroom 32 as a chip is good choice. I don’t know your custom component either. But priority is to have correct and solid wiring and to get any response from your charger (even error would be step ahead).
If you can’t get ahead you could just try to read one register with standars modbus component.
Changed parity from EVEN to NONE. No error message on logs.
Took another 485 - TTL adapter of same model just in case first one would be faulty.
Have now tested RJ12 port and 3 lowest pins in spring connector inside charger.
In last one I had wires around 10cm long.
So far RX led shows no life and have no data coming to HA. ESP it self is detected and shows sensors with out any information.
This is how my charger looks inside just in case.
Any help is welcome.
I see two spring terminal connectors above the RJ-12. The one closest to the RJ-12 looks like the right connector to use, and I can almost read that they actually have CONTROL-A and CONTROL-B mark. I would try that instead of the RJ-12. (see page 53 in zwartevogel’s post above).
There are many possible causes for this error, so I would go for a step by step approach:
- Make sure your charger works via RS-485 by connecting it to the ABL windows software via RS485-USB converter. This is also a good way to find out if you’re using the right wires.
- Use an Arduino or the PC adapter to test communication with the ESP via RS-485. Sending some of the example strings from the ABL documentation should give you output in the ESPHome logfile. And you should receiver queries from the ESP on the adapter.
I tested ABL Configuration Software with my old USB adapter that has pins for both RS-232 and RS-485. It didn’t find my charger. I checked with scope that my adapter is still alive. ~1v when no traffic. A goes to 5V and B to 0 when there is traffic. For what I have understood this is correct behavior.
Also measured that RJ12 and spring connectors are connected together.
Are we getting to conclusion that my charger is dead on communication side or is there something more that can be done?
Double check everything, continuity of wiring, correct rx-tx and tx-rx etc…
Maybe some power cycle or dip switch to set charger to slave mode?
I found newer version of configuration software(2.0) that seems to have found my charger. Previous version I tried was dated year before my charger has on label.
Serial matches whats printed on label on my charger.
This was over RJ12 cable that I left connected to charger.
Still no success from ESP over RJ12 and could not open charger as been rainy day.
Will continue when I can open charger again.