Fairly new to HA and am mostly getting where I need to go through trial and error, but running into an error I can’t seem to resolve. I want to use the compensation integration to normalize volume levels for my AVRs (I have a Yamaha where the volume scale goes from -80dB to +16dB and an NAD where it goes from -92dB to +1dB). I want 100 on HA to equal the max and 0 to equal the minimum.
Check the indentation and use of - in your config with the documentation, the media players should not be a list and the information below it is indented differently. Indentation matters in yaml.
The documentation could do with some improvement. It shows duplicate keys. These actually have to be unique. E.g.
compensation:
media_player_db_volume:
source: media_player.yamaha_receiver
attribute: volume_level
unit_of_measurement: dB
data_points:
- [0.2, -80.0]
- [1.0, 0.0]
media_player_zone_2_db_volume: # can't be the same name as the one above.
source: media_player.yamaha_receiver_zone_2
attribute: volume_level
unit_of_measurement: dB
# Ensure that the sensor's value will not have a state lower than -80.0
# when the source sensors value is less than 0.2
lower_limit: true
# Ensure that the sensor's value will not have a state greater than 0.0
# when the source sensors value is greater than 1.0
upper_limit: true
data_points:
- [0.2, -80.0]
- [1.0, 0.0]
Thanks Tom, that fixed it. One other question, the scale is capped at 100 = 0dB, but my AVR goes to 16db (this is fine for the NAD which only goes to 1dB). I am looking to have the volume scale mirror the percentage of max volume as close as possible. I’ve tried