SirGoodenough / HA_Blueprints

🧯 My Collection of Automation and Script Blueprints for Home Assistant 🧯
Other
132 stars 22 forks source link

[FR] Volume Control via cube #15

Closed SirGoodenough closed 1 year ago

SirGoodenough commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Request from the BluePrint Exchange from https://community.home-assistant.io/u/seffyroff/summary

https://community.home-assistant.io/t/zha-xiaomi-cube-controller/495975/18?u=sir_goodenough

As it stands now I plan to use a version of this script BP: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Scripts/long_short_toggle_4_magic_cube.yaml and set the short to a settable number like 1% volume and the long to a settable number like 10%.

Any Comments, concerns, suggestions?

SirGoodenough commented 1 year ago

Looks like something that might work from Petro...

https://community.home-assistant.io/t/cant-seem-to-set-volume-level-based-on-itself-from-data-template/237089/11?u=sir_goodenough

service: media_player.volume_set entity_id: media_player.onkyo_tx_nr717 data_template: volume_level: >- {% set e = trigger.event.data.event | int %} {% set v = state_attr('media_player.onkyo_tx_nr717', 'volume_level')|round(2) %} {{ v + 0.0000625 * e }}