RS232 control via itach IP2SL - tweak of itach remote component

Actually that still doesn’t offer as clean of a solution as you proposed for defining commands. I might play around with a IP2SL client that is a pure RS232 remote.

I don’t actually use the feedback as that became difficult - particularly as the Denon feedback is continuously overwriting the previous feedback all on one line - without clearing the line first. Don’t know if that is a quirk of the IP2SL or the Denon.

The only thing I really needed/wanted feedback on was the volume setting (although it would be nice to see what the audio decode mode currently is - DTS-HD MA etc). As I don’t ever use the physical remote, I now use Home Assistant to exclusively control the volume - anything that changes the volume actually changes an input_number in HA which then fires off an automation to set the volume. Not as elegant (or responsive) as what I was paying for before but perfectly usable. This way I can use Alexa or any one of several iPads/phones around the house to control the volume and all are synchronised - unless someone turns the knob on the amp but as that is in a media cupboard downstairs, that would only ever be me. :slight_smile:

I did look at using that IP2SL notify component but it didn’t work. I still like my idea of just sending the actual command to the IP2IR rather than converting it - or have a flag which turns on IR command translation if needed.
e.g.
Standard IR command data which needs to be translated to Global Cache format:

  - platform: itach
    host: <itach_ip_address>
    port: 4998    #ip2ir command port
    devices:
      - name: TV
        connaddr: 2
        commands:
          - name: "ON"
            data: "0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689"
            translate: "yes"

vs the same command using Global Cache format directly:

  - platform: itach
    host: <itach_ip_address>
    port: 4998    #ip2ir command port
    devices:
      - name: TV
        connaddr: 2
        commands:
          - name: "ON"
            data: "sendir,1:1,1,37000,1,1,128,63,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,48,16,48,16,48,16,48,16,16,16,16,16,16,16,48,16,48,16,48,16,48,16,48,16,16,16,48,16,2712"
            translate: "no"

That would keep everyone happy.
Particularly if the default option for translate was yes - then it’s not a breaking change (and we all know how annoying those are!!!) :slight_smile:

Here was an example configuration I was playing with for a IP2SL client to one of my amplifiers. The RS232 devices I have all just take commands, not try to replicate IR codes over serial.

- platform: ip2sl
  host: <itach_ip_address>
  port: 4999 # serial port 1 = 4999
  name: "Xantech Amplifier"
  commands:
    - name: "All Off"
      data: "!AO+"

- platform: ip2sl
  host: <itach_ip_address>
  port: 4999 # serial port 1 = 4999
  name: "Xantech Zone 1"
  commands:
    - name: "On"
      data: "!1PR1+"
    - name: "Off"
      data: "!1PR0+"
    - name: "Power Toggle"
      data: "!1PT+"
    - name: "Volume Up"
      data: "!1VI+"
    - name: "Volume Down"
      data: "!1VD+"
    - name: "Mute On"
      data: "!1MU1+"
    - name: "Mute Off"
      data: "!1MU0+"
    - name: "Source TV"
      data: "!1SS1+"
    - name: "Source Sonos"
      data: "!1SS2+"
    - name: "Source Spotify"
      data: "!1SS3+"
    - name: "Source FM"
      data: "!1SS4+"
    - name: "Source DVD"
      data: "!1SS5+"
    - name: "Source XBOX One"
      data: "!1SS6+"
    - name: "Source None"
      data: "!1SS7+"
    - name: "Source None"
      data: "!1SS8+"

Though I’m not really convinced that a completely generic IP2SL interface from Home Assistant is useful except for initial experimentation. Amost every case I get into, I want more discrete control over details (exact volume level, dimmer level setting, passing source ids, etc)…or want the data/commands exposed in more complex interfaces like media_player.

I think for a media_player it would probably need to be more specific rather than a generic implementation. If you don’t require the feedback (if you assume the command was always successful and nothing externally ever changed the settings) then volume (for the denon at least) and potentially dimming are easy. The Denon allows setting specific volume levels directly: eg MV30

It would be great if we could take the feedback from an IP2SL and use that. Similar to how I currently use the command_line sensor. Example from my Raspberry Pi:

  - platform: command_line
    name: rasplex_temp
    command: ssh [email protected] "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}' 

  - platform: command_line
    name: rasplex_sd
    command: ssh [email protected] "./rasplex_sd.sh"
    unit_of_measurement: "GB"
    value_template: '{{ value | multiply(0.001) | round(1) }}'  
    scan_interval: 3600

  - platform: command_line
    name: rasplex_ram
    command: ssh [email protected] "./rasplex_ram.sh"
    unit_of_measurement: "MB"

  - platform: command_line
    name: rasplex_cpu
    command: ssh [email protected] "./rasplex_cpu.sh"
    unit_of_measurement: "%"
    scan_interval: 60

image

Not entirely sure what that thing is doing at 15% CPU though! Shouldn’t be anything happening there at all!!

For Volume, I do this, which works with a generic command and could happily be converted for another platform:

  • All volume changes are made to input_number.avr_volume (-80 to -10 as I limit the volume as +18 is just stupidly loud)
  • sensor.avr_volume_sensor translates the input number to a number the Denon expects to see (0-80)
  • The AVR_Volume automation applies the sensor value to the Denon via the IP2SL
  • sensor.avr_volume_display just formats the volume nicely for the volume display button
  • tapping/clicking the sensor.avr_volume_display button brings up the input number slider to easily set a specific volume

Input_number:

avr_volume:
  name: Lounge
  icon: mdi:volume-medium
  initial: -80
  min: -80
  max: -10
  step: 0.5
  unit_of_measurement: dB

AVR_volume sensors:

      avr_volume_sensor:
        value_template: "{{(states.input_number.avr_volume.state | float) + 80 }}"
        friendly_name: Denon Volume
      avr_volume_display:
        value_template: "{{ states.input_number.avr_volume.state + 'dB' }}"  
        friendly_name: Volume

AVR_Volume Automation

- alias: Set AVR volume
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: input_number.avr_volume
  action:
  - delay:
      milliseconds: 50  
  - service: rest_command.avr_buttons
    data_template:
      command: MV{{((states.sensor.avr_volume_sensor.state | replace('.','')))}}

When dragging the slider I can see the value I’m setting the value to…
image

None of which really helps you though as you setup seems to need something more customised.

If you do come across a better way of doing any/all of this, let me know. I’m happy to test things with my setup if that helps.

I feel like my way of doing things is SUPER convoluted and there must be an easier way!!
After staring at it for so long though it’s hard to see the forest for the trees…

What does the feedback look like?
Is it all mashed up on the same line or is it cleared after every command?

Yes…same parts of my configuration. It gets convoluted quickly if you are using generic serial/IR/communication/command line/etc interfaces.

For things I’m building, I’m striving to make simpler for users by installing via add-on stores and setup with minimal config. For home automation there are often so many layers, it isn’t completely obvious to users what is going on, how many things are involved and where things break. And that is just getting things talking to one another…it gets really complicated once you try to bind everything together into a nice looking Lovelace interface.

1 Like

Serial devices write out to buffers, which means clients read everything the device is sending in order (including old replies). My Xantach amp replies always include enough info (line by line) to interpret the result, and dispatch to the appropriate handler. Effectively you have to think of it as asynchronous bi-directional communication, the reply may or may not be the next thing you read off the serial port.

Do you have the Xantech fully integrated now? I have one that I was going to get rid of. But my Russound has been really flaky, so I thought I might put the Xantech back if I could get it working with HA.

@samgreco No, but I’ve started working on it again. I decided to change the approach and instead just make the connection simulate a Monoprice, since there are so many apps, libraries, etc that communicate with Monoprice (it uses the same protocol just with some minor tweaks). Then the Xantech can be used with any Monoprice client. I hope to do this in the next few weeks.

The Xantech is a MUCH better amp than the Monoprice units and I have two different ones so I’m incentivized to eventually get to this…

I actually have 3 audio matrixes. I have a Russound MCA-C5, which works great with HA. Until it decides to lose it’s network connection. Sometimes in a n hour, sometimes days or weeks.

I also have a Vaux Lattis LE-1600A, which is a 16X16 that I have been using for a couple of years with my old automation software. But no driver for it in HA.

And then the Xantech ZPR68-10 with expander. That’s why this post piqued my interest.

And the idea of emulating is interesting. I’d love to see how you do that.

@samgreco The Xantech protocol for the old ZPR68-10 is completely different anyhow, so this wouldn’t work for you I don’t think anyway.

I kinda thought so, once i realized you were working with the MCRs. I’d love to continue using the Vaux Lattis I had. Always worked brilliantly. And I have 18 channels of amplification.

Wish I could code :slight_smile:

Hi guys, so am following the threads with Itach in them. I too have an itach ip2sl. Has anyone managed to successfully integrate this into HA or even Node-red yet? I don’t really know how to code, so am at a bit of a loss. I have been waiting for ages for someone smarter than me to come up with a solution.

Is it working at all for anyone?

I didn’t come across anyone else doing anything better so I’m still using the docker container with python scripts in it to talk to the IP2SL and I just use a REST API to talk to the container. I don’t get feedback but because we only ever use the HA “remote” to control everything, there are no issues. But feedback would be nice as I know it’s possible.

Surely someone could fix this integration so it worked properly and was easy to implement??
The people at SimpleControl (aka Roomie) can’t be the only ones to make this work properly can they??

Haven’t tried Node-red. Will have a look at that. What are you controlling with the IP2SL by the way?

I was controlling an Epson Projector (TW6100w). Currently am using a broadlink RM mini to do it, but i paid good money for these itach’s and it’s a shame not to utilise them, especially when theoretically they should perform better (with the feedback). I saw that someone had added a global cache integration (GC100) it’s such a shame it can’t be expanded to include the itach flex.

Am I right in my understanding that I only need to add this to my config’ (changing the serial commands (data) of course? Do I need to add a different file into custom components or anything like that?

  • platform: ip2sl
    host: <itach_ip_address>
    port: 4999 # serial port 1 = 4999
    name: “Xantech Amplifier”
    commands:

    • name: “All Off”
      data: “!AO+”
  • platform: ip2sl
    host: <itach_ip_address>
    port: 4999 # serial port 1 = 4999
    name: “Xantech Zone 1”
    commands:

    • name: “On”
      data: “!1PR1+”
    • name: “Off”
      data: “!1PR0+”
    • name: “Power Toggle”
      data: “!1PT+”

Sorry, I haven’t tried the IP2SL component in ages and it wouldn’t do what I wanted at the time so not sure.

@ryans may be able to help? He seems a bit more in touch with the technical ins and outs.

1 Like

I would like to help test anything I can to contribute toward this effort.
While IR is nice, it would be marvelous to have 232 control as well.

@ryans is the platform ip2sl available natively in HA or is it a custom component ?