I have a simple automation based on Afvalbeheer (waste management).
When the day has arrived that the waste needs to be put outside, my led strip in the garden flashes green, but only between 07.15 and 09.45 hrs.
When I take the trash out, I want a button on the Overview dashboard which can switch of the led strip. But the button must only work when the led strip is activated by Asfvalbeheer. I use the led-strip for multiple things, so the button must only disable the led strip for the garbage.
This is my automation for the garbage
alias: Grijze bak buitenzetten
description: ""
triggers:
- trigger: time
at: "07:15:00"
id: grijzebak-ledstrip-aan
- trigger: time
at: "09:45:00"
id: grijzebak-ledstrip-uit
conditions:
- condition: state
entity_id: sensor.purmerend_restafval
attribute: Days_until
state: "0"
actions:
- choose:
- conditions:
- condition: trigger
id:
- grijzebak-ledstrip-aan
sequence:
- parallel:
- type: turn_on
device_id: a73e11b81fc5282e62256f6d69409ce6
entity_id: d580fd487bf4584fdb16b87f202177b6
domain: light
brightness_pct: 8
- device_id: a73e11b81fc5282e62256f6d69409ce6
domain: select
entity_id: 351a7ca5b10b8c14d61ccd8514094a5c
type: select_option
option: Grijze bak
alias: Ledstrip aan naar preset grijze bak
- conditions:
- condition: trigger
id:
- grijzebak-ledstrip-uit
sequence:
- type: turn_off
device_id: a73e11b81fc5282e62256f6d69409ce6
entity_id: d580fd487bf4584fdb16b87f202177b6
domain: light
alias: Ledstrip uit
enabled: true
mode: single
And I created this for the button, but it doesn’t work:
alias: Afvalbak ledstrip uitzetten
description: ""
triggers:
- trigger: state
entity_id:
- input_button.afvalbak_reset
conditions:
- condition: state
entity_id: automation.grijze_bak
attribute: current
state: "on"
enabled: true
actions:
- type: turn_off
device_id: a73e11b81fc5282e62256f6d69409ce6
entity_id: d580fd487bf4584fdb16b87f202177b6
domain: light
mode: single
Is
state:"on"
ok? Or is there another way to check if the led strip is turned on via the Afvalbeheer?
alias: Grijze bak buitenzetten
description: ""
triggers:
- trigger: time
at: "07:15:00"
id: grijzebak-ledstrip-aan
- trigger: time
at: "09:45:00"
id: grijzebak-ledstrip-uit
- trigger: state
entity_id:
- input_button.afvalbak_reset
id: grijzebak-ledstrip-uit
conditions:
- condition: state
entity_id: sensor.purmerend_restafval
attribute: Days_until
state: "0"
actions:
- choose:
- conditions:
- condition: trigger
id:
- grijzebak-ledstrip-aan
sequence:
- parallel:
- type: turn_on
device_id: a73e11b81fc5282e62256f6d69409ce6
entity_id: d580fd487bf4584fdb16b87f202177b6
domain: light
brightness_pct: 8
- device_id: a73e11b81fc5282e62256f6d69409ce6
domain: select
entity_id: 351a7ca5b10b8c14d61ccd8514094a5c
type: select_option
option: Grijze bak
alias: Ledstrip aan naar preset grijze bak
- conditions:
- condition: trigger
id:
- grijzebak-ledstrip-uit
###. Add condition that the led is on at brightness 8 percent.
sequence:
- type: turn_off
device_id: a73e11b81fc5282e62256f6d69409ce6
entity_id: d580fd487bf4584fdb16b87f202177b6
domain: light
alias: Ledstrip uit
enabled: true
mode: single
Not sure what this option is you set also but perhaps this can also be a condition when turning it off.
And try and not use device triggers and/or device actions they are hard to read, will fail when you replace the device and so on…
Just use the normal actions like light on.
You can always test automations by using the developer tools to set states of entities to what they need to be for the automation to work.
And change the time in the automation.
I use Wled on a esp32 and this is a preset in the Wled I use. The LED strip flashes green between 07.17 and 09.45, so I know it’s time to take out the green bin.
And try and not use device triggers and/or device actions they are hard to read, will fail when you replace the device and so on…
I don’t understand what you mean with this. Sorry, just beginnen with HA.
When you use the GUI to create a trigger or action, you currently press the device action/trigger.
If you search for light instead then you will get the “normal” trigger/actions.