hello could anyone help me to fix the following issue?
I have a Modbus-Switch on my dashboard, with a slider to set the switch ON/OFF and the icon that show the switch state.
When I set the slider to ON, the hardware works immediately (the relay connected to the RS485 goes ON) but the icon shows that the switch is still OFF and after 12 sceconds (more or less) the icon shows that the switch is ON.
The same if I set the modbus switch OFF: in this case the icon shows that the switch is still ON and after 12 seconds (more or less) the icon shows OFF.
Following is part of the configuration.yaml interested:
Set ModBus
modbus:
name: modbus1
type: serial
port: /dev/ttyS0
baudrate: 9600
bytesize: 8
method: rtu
parity: N
stopbits: 1
My question is: there is something wrong in my yaml file? Could I improve it in order to have the icon on the dashboard updated in less than two or three seconds?
I am using HomeAssistantOS (HAOS) on a Raspberry Pi Compute Module 4 (CM4) mounted on the KC868-Server mini board (link to the board).
The board communicates with two peripheral boards KC868-A6 (link to the board). All three boards are on the same LAN and connected via the RS485 bus.
The UART has been enabled by uncommenting the appropriate line in the /boot/config.txt file:
enable_uart=1
Problem Description
When I control the relays of the peripheral boards via Wi-Fi from the HAOS graphical interface, everything works perfectly.
However, if I try to control the peripheral boards through the RS485 bus, bypassing Wi-Fi, the relays on the peripheral boards activate with a delay (ranging from a few seconds to over 30 seconds). Once triggered, the graphical interface is slow to update or temporarily shows them as unavailable (the frontend toggle switch appears grayed out and unclickable).
Meanwhile, the relays on the board with the CM4 continue to function perfectly.
Additional Software Configuration Details
The CM4 was flashed with the HAOS image haos_rpi4-64-7.4.img.xz and updated to version 12.4.
The system also runs HomeAssistantCore 2024.7.0.
The following configuration.yaml is used to setup the KC868-Server mini with HAOS:
The peripheral boards KC868-A6 were flashed and configured to enable Modbus using the firmware provided by the manufacturer available here, allowing them to act as slaves on the Modbus bus. (In the future, I intend to reflash these with ESPHome and use an appropriate YAML configuration.)