Integrating HTD Into HomeAssistant

So a bit of a status update:

A buddy pointed me to the following page Input slider values to a python script for RGB LED - #14 by nnelg which actually helped me a lot to setup the sliders to work correctly.

So now I can actually update the volume within HA :slight_smile:

So you need to create some entries in a shell_command.yaml (if you don’t have it create is and don’t forget to add the include line in your configuration (shell_command: !include shell_command.yaml))

In there I added the following entry:

zone1_volume_slider:
   python3 /config/scripts/htd-lync12.py volume 1 {{volumevalue}}

Then I created a numeric helper

Then I created an automation

alias: HTD_Kitchen_Volume
description: Automation to handle the volume slider for the HTD Zone 1 (kitchen/Livingroom)
trigger:
  - platform: state
    entity_id: input_number.kitchen_livingroom_volume
condition: []
action:
  - service: shell_command.zone1_volume_slider
    data_template:
      volumevalue: '{{states.input_number.kitchen_livingroom_volume.state | int}}'
mode: single

After adding that so my lovelace card and testing it out by moving it around it successfully changed the volume (up and down).

The HTD only supports a max volume setting of 60 so I made sure my slider was set the same.
Now my speaker card looks like this:
image

Another side-note, which you’re probably aware of, changing the volume when the speaker is off powers it on, this isn’t the script it’s the way the HTD system works.