input_number.living_room_volume changes with the volume on the TV but has a floating point and I think this is why the Sonos never updates. how do I make the number a integer with no decimal places?
Edit: Not sure if the int filter rounds, or just truncates, so I added a round(0) in there too. So this line will take the ‘volume_level’ attribute from the media_player.livingroom_tv entity, and first interpret it as a float, then multiply by 100 to get a number > 1, then round to the nearest integer, and finally make sure it’s typed as an integer.
The template seems sound. You may have to divide by 100 again when you set the volume level of the other media_player. All media_player components have a volume level that ranges from 0 - 1.
Upon reflection, you may be able to get rid of the input_number altogether, if you don’t want it, and just set one media player volume level to the other directly.
states(‘input_number.living_room_volume’)
Is shorter still, and is the recommended / preferred method as this avoids some issues at start-up with invalid values