Tip: finetune a light dimmer/media player volume with a remote

This is not really a project but more of a tip.

I’m using zigbee remotes (Ikea & sonoff) to control lights and the volume of multiple media players.
There are wonderful blueprints to help you with this. (I’m using these: 💡 Awesome HA Blueprints: A curated list of blueprints + easily create controller-based automations (remotes, switches,...) for controlling lights, media players, and more)

By using a different value for increasing and lowering a light/media player output, you have a better control.
This is for instance from an automation for 1 of my mediaplayers:

      action_rotate_left:
      - service: media_player.volume_set
        target:
          entity_id: media_player.living
        data:
          volume_level: '{{ state_attr("media_player.living", "volume_level") -0.005
            }}'
      action_rotate_right:
      - service: media_player.volume_set
        target:
          entity_id: media_player.living
        data:
          volume_level: '{{ state_attr("media_player.living", "volume_level") +0.03
            }}'
2 Likes

You can also multiply, eg by 1.2 to go up, and 0.8 to go down.

1 Like

Thanks for the tip! :+1: