I am new with Home Assistant, I have an hardware controlled home automation. So far I did use Node Red as host system with their Dashboard. All works fine but I do see the support of so many devices are very well supported in Home Assistant that I want to move over completely.
My hardware is controlled via a serial port 19k2 8N1. The Hardware could be controlled by address banks with Read / Write / Update commands. With Read command you can read the status, with write you write the status and when there are updates the hardware will send an update.
With the home automation you can set scenes, control lights and get information of the sensors (PIR / Temperature / Illumincance).
The protocol is quiet simple:
Start - R/W/U - HighAddress - Low Address - Value
Start = 0x24
Read / Write / Update = 0x54 / 0x57 / 0x55
High = 0x00 (high address)
Low = 0x00 (low address)
Value = 0x00
Example to set a scene (Kitchen = 0x00 0x19) on (0x01)
0x24 0x57 0x0 0x19 0x01
The home automation also will answer with an update:
0x24 0x55 0x0 0x19 0x01
Or when the temperature is updated:
0x24 0x55 0x0 0xD0 0x13 (address 0x0d update with value 0x13)
A pir sensor then has 1 byte output for 8 different sensors, example of input sensor on address 0x43 with bit 4 triggered:
0x24 0x55 0x0 0x43 0x4
In Node-Red I did use a serial input and serial output and translate the different addresses, where needed translate the bits into variables.
Now the question is how can I control this via the serial port in Home Assistant?
Thanks for your help. Possiby this is a solution for sending commands to the system. Actually this method does have some issues:
When sending serial commands at the same time you might get an hardware conflict of claiming the serial port. Another issue the system must also keep listening to the same serial port for updates and feedback from sensors.
What happens when you create an automation turning all lights off, eg with 20 calls at the same time? I should expect a conflict of hardware claiming?
Further at the same time I must listen to the same serial port, looks like this is not possible when also calling a shell command claiming the port?
in the link i posted, ‘usbsensor3’ is my sensor that receives back from the serial port, and it didnt give me any issues with , the automations that handle the response/s caught everything.
dont overthink it, what i linked to not only allowed fluid sending to and receiving from serialport, it showed the example of how to make an input_text field to test your commands and responses. dive in.