Hi all
I have a spare tradfri remote, so I wanted to use it to turn up/down the volume.
I created the automation and it works.
but…
the service volume_up (or down) can only be called once, a second time will not do anything.
the set_volume service seems to work as expected for a fixed value. If I try to
{{state_attr("media_player.luidspreker", "volume_level") + 0.1}}
it will only go up once.
the volume_level in developer tools / states never changes from 0.57.
the volume slider in the device will not change.
using the slider will allow me to increase the volume in steps.
I’m thinking I must be doing something wrong here? though it might be my speaker that f.e. doesn’t have a stop nor pause command, I can only stop it by selecting an invalid source.
alias: ZilverRemote
description: ""
trigger:
- platform: event
event_type: deconz_event
event_data:
device_id: 222bd9cb30d72414fd1ff0550977bcb9
condition: []
action:
- service: persistent_notification.create
data:
message: zilverremote {{ trigger.event.data.event }}
enabled: false
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event == 1002}}"
sequence:
- service: media_player.volume_up
data: {}
target:
device_id: 8cf1b8f40fc8c97822551f389a95cb16
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event == 2002}}"
sequence:
- service: media_player.volume_down
data: {}
target:
device_id: 8cf1b8f40fc8c97822551f389a95cb16
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event == 3002}}"
sequence:
- service: media_player.volume_set
data:
volume_level: >-
{{state_attr("media_player.luidspreker", "volume_level") +
0.1}}
target:
device_id: 8cf1b8f40fc8c97822551f389a95cb16
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event == 4002}}"
sequence:
- service: media_player.volume_set
data:
volume_level: >-
{{state_attr("media_player.luidspreker", "volume_level") +
0.2}}
target:
device_id: 8cf1b8f40fc8c97822551f389a95cb16
mode: single