Hi everybody,
I have buttons in my Lovelace frontend. Each one turns on and off a scene (to look a film, a movie etc).
I have automations to manage the lights (time conditions, strenghth…), triggered by the scenes.
If I send a command turn_on for a scene, everything works perfectly. With the toggle action of the button, the scene turn on, but no automation lights works.
For exemple here, when I push the button to switch between the scenes “je_regarde_une_serie” and “la_serie_est_finie”, the automation to turn on the scenes “ambiance_cosy_de_la_bibliotheque” and “allume_les_lumieres_du_cinema” doesn’t work. But it’s woking when I send the turn_on command.
I’ve tried two possibilities:
cards:
- type: custom:decluttering-card
template: button_série
variables:
- name: Série
- entity: input_boolean.serie_power_switch
button_série:
card:
type: 'custom:button-card'
color: auto
size: 50%
show_icon: false
entity: '[[entity]]'
show_last_changed: true
aspect_ratio: 1/1
show_state: true
name: '[[name]]'
show_label: true
tap_action:
action: toggle
haptic: light
automation:
- alias: "[Boolean] Serie on"
initial_state: on
trigger:
- platform: state
entity_id: input_boolean.serie_power_switch
to: "on"
action:
- service: scene.turn_on
entity_id: scene.je_regarde_une_serie
- alias: "[Boolean] Serie off"
initial_state: on
trigger:
- platform: state
entity_id: input_boolean.serie_power_switch
to: "off"
action:
- service: scene.turn_on
entity_id: scene.la_serie_est_finie
automation.yaml :
- id: '1612296465924'
alias: Ambiance couché après une série
trigger:
- event_data:
domain: scene
service: turn_on
service_data:
entity_id: scene.la_serie_est_finie
event_type: call_service
platform: event
condition:
- condition: time
after: '21:00:00'
before: 05:00:00
action:
- service: scene.turn_on
entity_id: scene.ambiance_cosy_de_la_bibliotheque
- service: scene.turn_on
entity_id: scene.allume_les_lumieres_du_cinema
mode: parallel
max: 10
And then I thought, that an input_boolean is an automation and maybe it can’t triggered another automation, so I’ve tried with a switch:
cards:
- type: custom:decluttering-card
template: button_série
variables:
- name: Série
- entity: switch.serie_power_switch
button_série:
card:
type: 'custom:button-card'
color: auto
size: 50%
show_icon: false
entity: '[[entity]]'
show_last_changed: true
aspect_ratio: 1/1
show_state: true
name: '[[name]]'
show_label: true
tap_action:
action: toggle
haptic: light
switch:
- platform: template
switches:
serie_power_switch:
value_template: "{{ is_state('input_boolean.serie_power_switch', 'on') }}"
turn_on:
- service: scene.turn_on
entity_id: scene.je_regarde_une_serie
- service: input_boolean.turn_on
entity_id: input_boolean.serie_power_switch
turn_off:
- service: scene.turn_on
entity_id: scene.la_serie_est_finie
- service: input_boolean.turn_off
entity_id: input_boolean.serie_power_switch
automation.yaml :
- id: '1612296465924'
alias: Ambiance couché après une série
trigger:
- event_data:
domain: scene
service: turn_on
service_data:
entity_id: scene.la_serie_est_finie
event_type: call_service
platform: event
condition:
- condition: time
after: '21:00:00'
before: 05:00:00
action:
- service: scene.turn_on
entity_id: scene.ambiance_cosy_de_la_bibliotheque
- service: scene.turn_on
entity_id: scene.allume_les_lumieres_du_cinema
mode: parallel
max: 10
Can you help me please? What I’m doing wrong?
Thank you