I have an original raspberry PI set up in another room, with a USB to serial cable and Ser2net running so I can control a Octava HDMI Matrix switch remotely (currently being done via my Vera home automation controller)
local socket = require("socket")
host = "192.168.1.77"
c = assert(socket.connect(host, 4001))
c:settimeout(5)
local sres, serr = c:send(string.char(0x02,0x32,0x31,0x31,0x03))
print("Send:", sres, serr)
local data, rerr = c:receive(100)
luup.log (data)
print ("Receive:", data, rerr)
c:close()
Now - I have to hold my hands up and say that I had a huge amount of help creating the LUA code above that sends the required value, but I was wondering if there was a way I could send the same information via Home Assistant ?
If it helps , here is my ser2net.conf entry for that port on the remote PI I target .
For those that do not know ser2net as I understand it, its an service that listens to a TCP port and pipes data to and from a serial port via the TCP port. It is configured by the file /etc/ser2net.conf and is run on the machine with the serial port that you want to make available over TCP/IP
I have created a group for the above TCP Sensor and it is actually getting information back from the HDMI matrix in the other room over ser2net…
It is giving me an error, which suggests something is being sent, and Home Assistant is receiving the feedback, which looks to be it’s standard error response from the Octava HDMI matrix i’m testing against. (I can’t see it all)
"0 ** invalid input. Refer to install guide or FAQ ... ."
By the looks of this, it is sending the command or checking for a response all the time ?
Can anyone confirm what is being seen here (exactly) ? My assumption is that it is constantly reading what the Matrix last said, but is the payload in the code earlier being sent every time to do that ?
Zooming into one of the entries, I see this, but other can just be a ‘0’ or partials of the following…
So I know this thread is a year old but I am actually in the market for a Octava UHD41-ARC (the newer version of the HD41-ARC) and of course I want to remote control it.
My first thought was the rs232 port because the manual so helpfully lists the HEX codes though I am leaning towards an IR transmitter so I can control more than just the UHD41 in the media cabinet; however, I will control everything via ser2net/socat.
Assuming you have ser2net and socat setup correctly, can you send a command from your HA server with socat to the PI running ser2net? I feel like the best approach is to use the Shell Command component to send the serial commands. HA doesn’t need to be aware of the device itself - a shell command just seems easier.
So from your HA server can you send a command like this (update to your correct port):
Hmm, I wasn’t aware of that product. I am going to do the same and try the RM Mini.
I figure by the time I buy a PI Zero, install the IR emitter, and spend an hour or so configuring it I am already past the $24 the Broadlink costs and my solution won’t look at nice.