I’m working with an older Onkyo AVR (vsx-lx102) that I have in a closet in my garage.
The Onkyo AVR Media Player integration doesn’t really fit my need so my I’m building a page with my own controls for input, volume, power, etc. I’ll focus on Volume for the purpose of this question.
I’ve successfully built the controls utilizing eiscp shell commands to the device. I can control the volume up and down, and can retrieve the current volume from the device as well.
I use this shell command to control the volume:
shell_command:
onkyo_volume_up: onkyo --host 192.168.2.67 volume=level-up-1db-step
I execute the command via script:
alias: scrpt_Onkyo_Volume_Up
sequence:
- service: shell_command.onkyo_volume_up
target:
entity_id: sensor.onkyo_current_volume
The volume_up shell command returns a value of “unknown-model: master-volume = 46” showing the now current volume. I use template sensor to format the output to just “46”.
I’m then displaying the current volume template sensor on my dashboard.
The problem is that when I press the volume up, there can be as much as a 10 second delay in the template volume sensor updating. The response is instant from the volume up command, so I’m not sure why there is such a delay in updating the sensor.
Is there a more efficient way of accomplishing this?
EDIT:
It just dawned on me that it’s possible that the firing of the script is the slow part, and not the return of the data. Is there an easy way to troubleshoot this?
UPDATE:
I have verified that the execution of the script is not the issue. After executing the script I immediately queried the AVR and got the updated volume well before the sensor was updated in HA.
Further testing of the sensor.onkyo_current_level shows that the output from the script execution is not updating this sensor timely. The delay seems to be in the actual updating of the target sensor. Once the sensor is updated, it displays immediately.
So why is there such a delay in processing the output of the shell command when the value is returned instantly from the AVR?