This feels like a redicoulous… I understand I could use a template increase the music by 0.01+current volume level, and a conditional for stopping at a certain level, but i’m not sure how I could get the delay working properly.
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.02
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.03
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.04
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.05
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.06
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.07
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.08
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.09
- delay: '00:00:30'
- service: media_player.volume_set
data:
entity_id: media_player.all
volume_level: 0.10
pbocsak
January 13, 2019, 11:17am
2
Hi,
I’ve done something like this for my bedroom light. I have two scripts calling each other after a 1 sec delay. When called, they increment the bedroom light brightness by 5.
'1544727032544':
alias: increase bedroom brightness A
sequence:
- data_template:
brightness: '{% if states.light.bedroom.attributes.brightness %} {{ (states.light.bedroom.attributes.brightness
| int) +5 }}{%- else -%}5{%- endif %}'
entity_id: light.bedroom
service: light.turn_on
- delay: 00:00:01
- condition: template
value_template: '{{ (states.light.bedroom.attributes.brightness | int) < 150 }}'
- data:
entity_id: script.1544727033544
service: script.turn_on
'1544727033544':
alias: increase bedroom brightness B
sequence:
- data_template:
brightness: '{% if states.light.bedroom.attributes.brightness %} {{ (states.light.bedroom.attributes.brightness
| int) +5 }}{%- else -%}5{%- endif %}'
entity_id: light.bedroom
service: light.turn_on
- delay: 00:00:01
- condition: template
value_template: '{{ (states.light.bedroom.attributes.brightness | int) < 150 }}'
- data:
entity_id: script.1544727032544
service: script.turn_on
They keep calling eachother until the brightness is 150. You can push this further by having an input_number set to 150 (well, anything between 2 and 255) and then compare it to that, so you can configure the desired value in the UI.
Hope this helps.