WTH can remote serial devices not be easily mounted as /dev/tty virtual devices?

Are you sending HEX commands? I’ve been struggling to set up my Sonance Whole Home Audio 12 channel amp with home assistant for a bit and just haven’t been able to get anything to work. @ryans has helped me with a few attempts but either due to my novice abilities with HA or the quirkiness of global cache and the sonance amp, nothing has worked. This is a main piece of my home. We use it every day and control it with ip2sl.

I can send HEX with the itest, zone one power on command is:
3a 5a 31 31 0D

But I have not been able to figure out the configuration to get this working in HA.

Could you provide a bit of your yaml set up for this? I’m really struggling to implement something similar for a 12 channel amp I use for music to 6 zones in my home. I currently control it with ip2sl and another bit of software that runs on my phone. I’d like to move to HA for everything and that seems doable for all of my other equipment and devices, but this piece has put a stop to that, as if this doesn’t work then there isn’t much point in the rest. It’s too expensive to replace just because I can’t control it how I want.

Just to add another voice to thread - I’m looking to integrate HiFi devices that present a IP/Serial programming interface, but I not seeing an obvious way to leverage these in HA. The current focus of my attention is an Arcam SA30, but I have other kit I’d like to control in this way.

I’m no dev, but it looks as though I going to need to get hands dirty

I’m using a global cache ip2sl device to control my amp. I finally got it working in a not very elegant way, but don’t really care as it works as I need it. The telnet switch was what worked for me. I just added a switch for each command. If you can control your device with IP commands, this might work for you too.

switch:
  - platform: telnet
    switches:
        wha_living_room_on:
          resource: 192.168.1.114
          port: 4999
          command_on: "':Z11\x0D'"
          command_off: "':Z11\x0D'"
          name: "LR On"
          timeout: 3

        wha_living_room_off:
          resource: 192.168.1.114
          port: 4999
          command_on: "':Z10\x0D'"
          command_off: "':Z10\x0D'"
          name: "LR Off"
          timeout: 3

        wha_living_room_up:
          resource: 192.168.1.114
          port: 4999
          command_on: "':V1++\x0D'"
          command_off: "':V1++\x0D'"
          name: "WHA Living Room"
          timeout: 3 
          
        wha_living_room_down:
          resource: 192.168.1.114
          port: 4999
          command_on: "':V1--\x0D'"
          command_off: "':V1--\x0D'"
          name: "WHA Living Room"
          timeout: 3  

image

3 Likes

The point of being able to mount remote serial devices (like IP2SL) to a /dev/xxxx mount point is that you could use EXISTING integrations that use serial out of the box WITHOUT having to do anything special except point to the /dev/xxx mount point (once it is mapped to an IP). No knowledge required of the actual serial protocol required since the existing integration would just work.

1 Like

Yeah, my method is poor, for sure. I just couldn’t stumble through getting the xantech fork you made for my sonance amp. I’m either too much of a novice to figure it out or it just wasn’t going to work for my use case. It may have been as simple as a null modem adapter. I tinkered with it in my spare time as much as I could, but just could never get it working directly connected between my hasio pi and the amp with a usb to serial cable. Thanks again for your efforts in this area. I know global cache has contracts with a lot of home automation companies so I get why they haven’t made a home assistant integration for their products. But I think they should, would really give them a new sales channel.

It isn’t about Global Cache implementing anything. What we need is Home Assistant Core to build a way to configure mapping a socket to a remote IP and mounting it into /dev/XXXXX. Then you can use existing plugins (which do not have to be updated in anyway) for any serial controlled device and they will just work whether the device is plugged into local RS232 adapter or a remote RS232 adapter that communicates over IP.

Second to that, and I briefly explored but just don’t have time, is a Home Assistant Add-On that you install which does the same thing and mounts a /dev/XXX such that Home Assistant core docker container can access it. It really shouldn’t be that hard to implement…just needs someone with time and skill. I generally lack the time for things these days unfortunately :frowning:

1 Like

I actually think this is backwards. I think we should push all integrations to only support network access, then have a feature in hassos to automatically set up ser2net instances for local devices.

1 Like

The problem is there are multiple protocols/methods for how to remotely tunnel RS232 over the network from plaintext ports opened, to secure SSL tunnels, etc. The integrations should not have to implement all the various ways…it is much simpler for the container itself to provide a way to map /dev/XXX access to the transport protocol and remote endpoint (including any authentication).

Putting the requirement on each integration to support is onerous…especially given many of the RS232 integrations are community built and not part of HA core.

Maybe nice for new products, but how do you plan manufacturers to only use lan interfaces?
Most manufacturers use their own proprietary protocols, so they can sell their proprietary products as option, and make more money that way.

Don’t forget a lot of integrations are made by ha users who just do it because they like to reverse engineer and see it as a challenge.

But this also poses a problem, as they will buy another device (or simply loose interest) and they stop maintaining the code, meaning that it is no longer developed

Has nothing to do with manufacturers. This is only about home assistant. There are very few manufacturer produced integrations in home assistant.

If there was a helper in hassos that automatically set up ser2net instances for local ttys, Al integrations could be written as if all devices was on network even though they are normal UART ttys.

Advanced users can then set up ser2net instances on remote hosts , and the integrations would still work.

2 Likes

Oh, that is what you ment.
Like I managed to develop my duepi pelletstove integration using Jeelabs’s ser2net esp8266 :stuck_out_tongue:

That is a very easy way to use ser2net, but there should be made something on ha’s side that reverses it again into net2ser… but there is no real need, for devs it is not much difference to send protocols over tcp or sending them over serial :wink:

Hi @SeldomSeen31 great to see that you got your amp working. When you press the button to change the switch how much latency are you experiencing? When I press a button then there are times when it switches immediate and other times when I have to wait 5-10 seconds. I wonder if there is a polling setting that scans for changes every X seconds? Any ideas about how I can reduce the latency of the Telnet switch?

I don’t notice any significant delay. Each button seems to execute the desired command nearly instantly. I will say that sometimes if feel like the first command sent, usually volume up or down may be missed. But I am certainly not getting anything close to a 5 second delay. Not sure what advice I can give you as I think it is a minor miracle that I got this working at all. As I mentioned this is a very square peg in a round hole solution.

Thanks it was worth a try. I deleted the optional timeout parameter but I’m not sure that did anything.

I agree it’s a workaround but for me it saves me from having to invest $10K+ in a new sound matrix system!

Yeah, I was in the same boat with a a sunk cost in a 6 zone amp that was working perfectly and controllable with my old control system. We use it every day. I wanted to move to HA but not if my audio system want able to work along with the other things that HA could do for me.

This is working and robust enough to make me feel comfortable to go all in on HA.