hilbert
(Hilbert)
August 11, 2022, 10:34am
1
opened 11:35AM - 11 Aug 22 UTC
integration: modbus
### The problem
Hi, I’ve been working on a project using the HA Modbus integra… tion. My Modbus server is running in NodeRed. To connect with this server i use the following config:
```
modbus:
- type: tcp
host: 192.168.2.74
port: 502
name: Modbus_Server
retry_on_empty: true
delay: 5
```
Now on with my issue:
Whenever I try to use coils in my config.yaml, for example a binary sensor or a switch using write_type: coil, the time it takes to control the modbus entities dramaticaly increases. If I just use regular registers it takes less than a second to set a coil or register, but when i add a coil type entitiy to my config it takes at least 5 seconds.
Correctly working:
```
sensors:
#############################################
# Hoofdkast
#############################################
# Waterhoogte voorraadtank grijswater
- name: _mod_AI_FilthWater_WaterHeight
address: 0
scan_interval: 10
scale: 0.1
unique_id: Waterhoogte voorraadtank grijswater
switches:
# Vloerverwarming Slaapkamer 1
- name: _mod_O_Heating_Bedroom1
address: 106
write_type: holding
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 1
verify:
```
Not working correctly (at least 5 second delay):
```
sensors:
#############################################
# Hoofdkast
#############################################
# Waterhoogte voorraadtank grijswater
- name: _mod_AI_FilthWater_WaterHeight
address: 0
scan_interval: 10
scale: 0.1
unique_id: Waterhoogte voorraadtank grijswater
switches:
# Vloerverwarming Slaapkamer 1
- name: _mod_O_Heating_Bedroom1
address: 106
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 1
verify:
```
This phenomenon only starts appearing when is use more than 10 coil type entities.
Below 10 the delay is not noticable. As my project contains about 200 digital IO i use 200 coils.
When using this many coils (combination of switches and binary_sensors), the delay is about 10 seconds.
Again, when I just use registers instead of coils there is no delay.
Thank you very much!
### What version of Home Assistant Core has the issue?
Home Assistant 2022.8.3
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
Modbus
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus/
### Diagnostics information
_No response_
### Example YAML snippet
```yaml
- type: tcp
host: 192.168.2.74
port: 502
name: Modbus_Server
retry_on_empty: true
delay: 5
sensors:
#############################################
# Hoofdkast
#############################################
# Waterhoogte voorraadtank grijswater
- name: _mod_AI_FilthWater_WaterHeight
address: 0
scan_interval: 10
scale: 0.1
unique_id: Waterhoogte voorraadtank grijswater
# Temperatuur Douche Kelder
- name: _mod_AI_Temp_ShowerBasement
address: 4
scan_interval: 10
scale: 0.1
unique_id: Temperatuur Douche Kelder
switches:
#############################################
# Hoofdkast
#############################################
# Vloerverwarming Slaapkamer 1
- name: _mod_O_Heating_Bedroom1
address: 106
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 1
verify:
# Vloerverwarming Slaapkamer 2
- name: _mod_O_Heating_Bedroom2
address: 107
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 2
verify:
# Vloerverwaming Kantoor
- name: _mod_O_Heating_Office
address: 108
write_type: coil
scan_interval: 1
unique_id: Vloerverwaming Kantoor
verify:
# Vloerverwarming Douche Kelder
- name: _mod_O_Heating_ShowerCellar
address: 109
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Douche Kelder
verify:
# Vloerwerwarming Gang Kelder
- name: _mod_O_Heating_HallwayCellar
address: 110
write_type: coil
scan_interval: 1
unique_id: Vloerwerwarming Gang Kelder
verify:
# Vloerwerwarming Trap Buiten
- name: _mod_O_Heating_StairsOutside
address: 111
write_type: coil
scan_interval: 1
unique_id: Vloerwerwarming Trap Buiten
verify:
# Vloerverwarming Woonkamer
- name: _mod_O_Heating_LivingRoom
address: 112
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Woonkamer
verify:
# Vloerverwarming Keuken
- name: _mod_O_Heating_Kitchen
address: 113
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Keuken
verify:
# Vloerverwarming Hal Beganegrond
- name: _mod_O_Heating_HallwayGroundFloor
address: 114
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Hal Beganegrond
verify:
# Vloerverwarming Bijkeuken
- name: _mod_O_Heating_Scullery
address: 115
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Bijkeuken
verify:
# 6 weg klep, kelder verwarmen
- name: _mod_O_HeatingValves_Cellar
address: 116
write_type: coil
scan_interval: 1
unique_id: 6 weg klep, kelder verwarmen
verify:
# 6 weg klep, kelder koelen
- name: _mod_O_CoolingValves_Cellar
address: 117
write_type: coil
scan_interval: 1
unique_id: 6 weg klep, kelder koelen
verify:
```
### Anything in the logs that might be useful for us?
```txt
No logs are created.
```
### Additional information
_No response_
Hi, I’ve been working on a project using the HA Modbus integration. My Modbus server is running in NodeRed. To connect with this server i use the following config:
modbus:
- type: tcp
host: 192.168.2.74
port: 502
name: Modbus_Server
retry_on_empty: true
delay: 5
Now on with my issue:
Whenever I try to use coils in my config.yaml, for example a binary sensor or a switch using write_type: coil, the time it takes to control the modbus entities dramaticaly increases. If I just use regular registers it takes less than a second to set a coil or register, but when i add a coil type entitiy to my config it takes at least 5 seconds.
Correctly working:
sensors:
#############################################
# Hoofdkast
#############################################
# Waterhoogte voorraadtank grijswater
- name: _mod_AI_FilthWater_WaterHeight
address: 0
scan_interval: 10
scale: 0.1
unique_id: Waterhoogte voorraadtank grijswater
switches:
# Vloerverwarming Slaapkamer 1
- name: _mod_O_Heating_Bedroom1
address: 106
write_type: holding
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 1
verify:
Not working correctly (at least 5 second delay):
sensors:
#############################################
# Hoofdkast
#############################################
# Waterhoogte voorraadtank grijswater
- name: _mod_AI_FilthWater_WaterHeight
address: 0
scan_interval: 10
scale: 0.1
unique_id: Waterhoogte voorraadtank grijswater
switches:
# Vloerverwarming Slaapkamer 1
- name: _mod_O_Heating_Bedroom1
address: 106
write_type: coil
scan_interval: 1
unique_id: Vloerverwarming Slaapkamer 1
verify:
This phenomenon only starts appearing when is use more than 10 coil type entities.
Below 10 the delay is not noticable. As my project contains about 200 digital IO i use 200 coils.
When using this many coils (combination of switches and binary_sensors), the delay is about 10 seconds.
Again, when I just use registers instead of coils there is no delay.
Thank you very much!