Hi. I created an automation whereby when I turn on my Xbox, or more specifically when the Xbox logs into my account, the light turns on 3o minutes before sunset. I don’t know what’s going on, but it’s not working. The light itself works fine and is made with ESP32+LEDs – WLED. If you have a moment, could you take a look at my blueprint and see where the error is?
You swapped your triggers & conditions. What you have right now only turns on the light if you switch on your xbox and it’s past 30 minutes before sunset.
Set the trigger to sun and the condition to xbox, and it will turn on your light 30 mins before sunset if your xbox is currently on.
That says at the exact time the sun met that condition it fired then checked whatever pixel warlord is - it checked for on. It was off so executions stopped.
First please no more screenshots most of us are reading this on our phones. And screenies are Bad.
Please download the trace and look at it and post THAT in a code block as instructed earlier in the future.
Now all of these are the same thing.
Trigger fires conditions are checked… In that order. The condition is checked ONLY when the trigger fires.
So it will Only look (trigger) when the sun GOES down not because it IS down. When it goes down at that EXACT MOMENT it checks your Status in the condition block.
In your case it was off.
It did exactly what you told it to do.
If you’re trying to make it work just because it’s dark. That’s a different story
Both your pictures show that the state of the Xbox and the Shield was unavailable when the automation triggered. This means that either you are referencing an unreliable device, or else it means that the device was offline during the automation trigger.
How are these 2 devices integrated in HA, and can you check their history to see whether you see unavailable at any point during the automation trigger time?
@NathanCu I’m not sure where you saw that the state was off. Did I miss something in the trace pictures?
It turn ON according to the automation code but turn off doesn’t quite work the way I want it to because the light shuts off after an hour of running the XBOX. The reason may be the second automation which also activates the same light only that in a different color is operated by a motion sensor which activates the light when I sit at the computer.
Hello. Ok start from begining. I already have a working Xbox automation that controls my lights when the Xbox is turned on or off. It’s almost perfect. The thing is, my automation controls LEDs and turns them on when I play, lighting up the appropriate colour, and turns off the other lights, e.g. on the ceiling. At the same time, when I turn off the Xbox, the LEDs go out and the ceiling light comes on, which gradually goes out within three minutes so that I can leave the room calmly. I’ve been struggling with this for a long time and nothing helps. While playing, the LEDs go out from time to time and the ceiling light comes on when it detects that the Xbox has been turned off. I added various automations to this that were supposed to remove this problem and control whether it is on or off. I finally realised that the problem lies in the integration and the console itself. The console sends and loses micro-connections from time to time, which are detected in Home Assistant as switching off or on, which disrupts the entire automation and the lights go out for a moment or turn on. To the Integration authors, please fix this.
If anyone is interested, below is the automation controlling the Xbox, TV shield, ceiling lights and LED strip.
alias: Inteligentne Światło Komputer Patyk
description: >-
Automatyczne światło z priorytetami: Xbox > Shield > Komputer. Jasność
dopasowana do pogody i pory dnia.
triggers:
trigger: state
entity_id: binary_sensor.czujnik_obecnosci_patyk_occupancy
to: “on”
id: obecnosc
trigger: state
entity_id: binary_sensor.czujnik_obecnosci_patyk_occupancy
to: “off”
for:
minutes: 2
id: brak_obecnosci
trigger: state
entity_id: input_boolean.xbox_active
id: device_change
trigger: state
entity_id: input_boolean.shield_active
id: device_change
conditions:
actions:
if:
condition: state
entity_id: input_boolean.xbox_active
state: “on”
then: