OK, I have recently deployed a Sonance DSP-750 MKII through IP commands. This took a bit of stuffing around to get the commands correct, but is now working a treat! I thought I would post this for anyone else trying to do it and for when I need it again and have forgotten (about two weeks!).
I’m using HAOS on x86 hardware. I installed HAOS using a Ubuntu live USB and restored the latest disk image. So these commands are specific to this type of deployment, as it will be using shell commands.
Without further ado, here is the code for your shell_commands section of configuration, or shell_commands.yaml file if using it externally to the configuration.yaml file. Please note, I could not get variables or !secrets to work in this, so the full commands are static:
### shell_commands.yaml
### DSP 750 Control Commands #####################################
### Zone 1 Volume Up
z1_volume_up: 'echo -ne "\xFF\x55\x02\x04\x00" | nc 192.168.1.10 52000'
### Zone 1 Volume Down
z1_volume_down: 'echo -ne "\xFF\x55\x02\x05\x00" | nc 192.168.1.10 52000'
### Zone 1 Volume Mute
z1_volume_mute: 'echo -ne "\xFF\x55\x02\x06\x00" | nc 192.168.1.10 52000'
### Zone 2 Volume Up
z2_volume_up: 'echo -ne "\xFF\x55\x02\x04\x01" | nc 192.168.1.10 52000'
### Zone 2 Volume Down
z2_volume_down: 'echo -ne "\xFF\x55\x02\x05\x01" | nc 192.168.1.10 52000'
### Zone 2 Volume Mute
z2_volume_mute: 'echo -ne "\xFF\x55\x02\x06\x01" | nc 192.168.1.10 52000'
################################################################################
The full list of commands can be found in the Excel spreadsheet published by Sonance: Sonance IP Command List
I also created some sensors to query the unit for its current state of the volume and mute.
### sensors.yaml
### Sonance DSP2-750 MK II #####################################################
### Zone 1 Volume Query
- platform: command_line
name: z1_room_volume
command: 'echo -ne "\xFF\x55\x02\x10\x00" | nc 192.168.1.10 52000'
value_template: '{{ value | regex_findall_index("(?<=\=)(.*?)(?=\ )") }}'
scan_interval: 15
unit_of_measurement: "db"
command_timeout: 5
### Zone 1 Mute Query
- platform: command_line
name:z1_room_mute
command: 'echo -ne "\xFF\x55\x02\x12\x00" | nc 192.168.1.10 52000'
value_template: '{{ value | regex_findall_index("(?<=\=)(.*)") }}'
scan_interval: 15
command_timeout: 5
### Zone 2 Volume Query
- platform: command_line
name: z2_room_volume
command: 'echo -ne "\xFF\x55\x02\x10\x01" | nc 192.168.1.10 52000'
value_template: '{{ value | regex_findall_index("(?<=\=)(.*?)(?=\ )") }}'
scan_interval: 15
unit_of_measurement: "db"
command_timeout: 5
### Zone 2 Mute Query
- platform: command_line
name:z2_room_mute
command: 'echo -ne "\xFF\x55\x02\x12\x01" | nc 192.168.1.10 52000'
value_template: '{{ value | regex_findall_index("(?<=\=)(.*)") }}'
scan_interval: 15
command_timeout: 5
################################################################################
And finally scripts that activate the shell commands, then trigger a sensor update so the status is reflected immediately in the entities.
### scripts.yaml
### Zone 1 Volume UP
z1_volume_up:
alias: Zone 1 Volume Up
sequence:
- service: shell_command.z1_volume_up
- service: homeassistant.update_entity
entity_id: sensor.z1_room_volume
### Zone 1 Volume Down
z1_volume_down:
alias:Zone 1 Volume Down
sequence:
- service: shell_command.z1_volume_down
- service: homeassistant.update_entity
entity_id: sensor.z1_room_volume
### Zone 1 Mute Toggle
z1_volume_mute:
alias: Zone 1 Volume Mute
sequence:
- service: shell_command.z1_volume_mute
- service: homeassistant.update_entity
entity_id: sensor.z1_room_mute
### Zone 2 Volume UP
z2_volume_up:
alias: Zone 2 Volume Up
sequence:
- service: shell_command.z2_volume_up
- service: homeassistant.update_entity
entity_id: sensor.z2_room_volume
### Zone 2 Volume Down
z2_volume_down:
alias:Zone 2 Volume Down
sequence:
- service: shell_command.z2_volume_down
- service: homeassistant.update_entity
entity_id: sensor.z2_room_volume
### Zone 2 Mute Toggle
z2_volume_mute:
alias: Zone 2 Volume Mute
sequence:
- service: shell_command.z2_volume_mute
- service: homeassistant.update_entity
entity_id: sensor.z2_room_mute
Obviously this would work for other hex commands to be sent over IP (check my other post for controlling a Grandview projector lift via an iTach IP2SL).
Hopefully that will help someone!