Latency with modbus relays
Closed this issue · 5 comments
Since upgrading from V4 to run a newer HA, I am unable to get it working again with my modbus relays.
The problem is that although the relays turn on as expected, they will never turn off.
In developer tools, the state remains as on, and from there they can be manually turned on/off.
Running the service 'Irrigation controller: Stop programs' did not turn it off either.
This is logged:
Significant latency has been detected, zone switch may not be updating state correctly, unexpected behaviour may occur, switch.irrigation_zone_1
Any ideas on resolving this?
After monitoring for 'irrigation_event' events, I see a program_turned_on, zone_turned_on and lastly program_turned_off.
Should there be a zone_turned_off event?
Hi, Can you confirm that the modus switch behaves as expected when you use the switch turn on and switch turn off service calls from the developer tools.
using developer tools with:
service: switch.turn_off
data: {}
target:
entity_id: switch.irrigation_zone_2
is successful to turn it off, and the on service call will turn it on.
Modbus latency will always be high.
My setup uses a tcp to serial gateway, with the serial link at 9600 baud, so not fast, and it also has multiple devices on the bus, other than the 8 relays.
The modbus settings:
- name: "mb-gateway"
timeout: 5
host: 10.1.1.22
port: 8899
type: tcp
message_wait_milliseconds: 5
#the relays- name: irrigation_zone_2
unique_id: modbus-05-01
scan_interval: 120
write_type: coil
slave: 5
address: 1
verify:
input_type: coil
delay: 5
- name: irrigation_zone_2
My understanding is that it does a verify (read status) after changing the relay state. The delay I have set (it seems to be seconds) is quite long. I'll try adjusting it and see if anything changes.
Thanks.
After some experimenting, removing the modbus verify delay (setting it to 0) seems to have resolved the issue - seems it takes a reboot.
I'll need to monitor for a while in case it causes issues on the bus.
Thanks.
Great that's good news. The component monitors the state of the switch and if it takes to long to update the state to off it will cause this type of problem. My time-out is 5 seconds I think if you set your delay to 3 maybe 4 seconds or should be OK