Send UDP-packages with HA on rPi

Hi everyone,

I have HA installed on my rPi and currently presence detection (over network scan) and weather conditions are presented fine on the UI.

Furthermore I have an old setup with 433mHz switches being controlled by remote controls and a bridge (Trust ICS-1000) (also known as KAKU) which I would like to integrate within my HA setup.

I found out that I can control my Trust bridge over my internal network based on UDP broadcasts on port 9760. These contain the following fields:

< id > < room > < device > < function > | text1 | text2 |

I would like to set up a connection between my rPi (with HA installed) and the Trust bridge. I would then like to send UDP packages from my rPi to the bridge, to control my 433mHz switches.

I know I’d probably be better off with an 433mHz transceiver like an RFXcom, but I consider it as a challenge to use the bridge as that transceiver.

Anybody who can help me in the right direction?

UDP doesn’t require connections, its all purely packet based. So you just have to send the packets to the correct port.

You should be able to send packets from HA with a command line switch using nc as the command.

$ nc
usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-O length]
          [-P proxy_username] [-p source_port] [-q seconds] [-s source]
          [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
          [-x proxy_address[:port]] [destination] [port]

Hello everybody
i try with this command . . .

platform: command_line'
    switches:
      comandoa:
        command_on: "echo 'TestOn1' | nc -u 192.168.1.136 9998"
        command_off: "echo 'TestOff1' | nc -u 192.168.1.136 9998"
        friendly_name: Comando Invioa

but it works only once . . . for send again the packege i need to restart hassio . . . have you some advise for me ?
Very appreciate any suggest
Bye
Paolo