Hello community,
this is my first post here so please be kind to me
I configured an automation which should turn on the kitchen light in the morning if at least one of two devices are at home and the sun is not yet up.
The device trackers are working and manually switching the light on and off is working as well but this automation is never triggering.
The sun-up change is happened are around 8:15 here right now so this should be okay, too.
Can you help me finding out what is wrong here?
- id: '1579591309996'
alias: Turn light on in the morning if someone is at home
description: ''
trigger:
- at: 06:45:00
platform: time
condition:
- condition: device
device_id: fd03bb[...]da
domain: device_tracker
entity_id: device_tracker.ane_lx1
type: is_home
- condition: or
conditions:
- condition: device
device_id: caa8fa[...]b5
domain: device_tracker
entity_id: device_tracker.oneplus_a5000
type: is_home
- condition: and
conditions:
- before: sunrise
condition: sun
action:
- device_id: 4bfb4[...]1e
domain: light
entity_id: light.kitchen
type: turn_on
(i shortened the device_ids in this code, in real they are longer of course )
@myxor, I think for your first automation (that you are asking a question about) this one is relatively complex but your attempt is pretty close to where it needs to be.
@browetd, your response is first rate, looks spot on to me, but you went further and included the link so that the OP could learn more. We are often lazy (including me) and don’t explain our answers properly
Browtd, I was not being sarcastic, I thought your previous answer was very good (admittedly it’s now even better) myxor clearly has done some work on this issue rather than just posting a question without putting some effort in and then whining about it. Also his name implies an understanding of logic functions. He is not English but the question is sensibly asked with all relevant information (much better than I could do even with the assistance of Google’s mangling).
I am frustrated when I get an answer that works but I don’t understand and, as I say, I’m guilty of giving such answers myself.
I truly meant my approval. (not that it means much )
@myxor, I know what you mean about entity names, but you can name them anything you want so shorter names (under a considered naming format (so you replace devices or expand in a logical manner)) can pay dividends. I’ve rebuilt my system twice to achieve this. First, when I was rebuilding my z wave network and the second when I moved to packages