Hi,
I’m integrating my Etrel Inch home charger similar to this post:
https://community.home-assistant.io/t/ev-charger-control-with-modbus-tcp/112784
It also supports Modbus TCP. An overview of its registers can be found here:
I can read out the read registers, but I’m having trouble to write to the registers. I want to be able to set the “Set Current Setpoint” or the “Set Power Setpoint”
Should I define the write registers as sensors?
Since the values are float32, I cannot set them as a switch.
# Etrel
modbus:
- name: Etrel Inch
type: tcp
host: 10.0.0.209
port: 502
sensors:
- name: Etrel_Power_set_point
slave: 255
address: 11
write_type: holding
Similar as in the example, I’m trying to set the values using the modbus.write_register service, linked to a button.
type: horizontal-stack
title: Laadsnelheid instellen
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: modbus.write_register
data:
address: 11
slave: 255
value: 0
hub: Etrel Inch
target: {}
icon: mdi:gauge-empty
name: Uit
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: modbus.write_register
data:
address: 11
slave: 255
value: 4
hub: Etrel Inch
target: {}
name: 4kW
icon: mdi:gauge-low
show_state: false
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: modbus.write_register
data:
address: 11
slave: 255
value: 8
hub: Etrel Inch
target: {}
name: 8kW
icon: mdi:gauge
- show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: modbus.write_register
data:
address: 11
slave: 255
value: 11
hub: Etrel Inch
target: {}
name: 11kW
icon: mdi:gauge-full
But when doing so I get the following error:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/modbus/modbus.py:176
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14 maart 2023 om 12:47:05 (14 occurrences)
Last logged: 16:40:37
[139736414885664] 'Etrel Inch'
[139736643361552] 'Etrel Inch'
[139736228614288] 'Etrel Inch'
[139736393687600] 'Etrel Inch'
[139736429082560] 'Etrel Inch'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/components/modbus/modbus.py", line 176, in async_write_register
hub = hub_collect[
KeyError: 'Etrel Inch'