Hi everyone! I'm trying to set up an automation for my lights with the following behavior:
What I want:
Lights turn ON at sunset (but not later than 9 PM)
Lights turn OFF at 9 PM automatically
If I manually turn OFF the lights before 9 PM (e.g., at 8 PM), they should stay OFF
BUT the next day, the automation should work normally again (lights turn ON at sunset)
My concern:
If I manually turn off the lights in the evening, I don't want them turning back ON the same night, but they should still turn ON the next evening at sunset.
What I've tried:
I'm considering using a condition to check if it's before 9 PM and if the light is already OFF, but I'm not sure if this prevents the lights from turning ON the next day.
Should I use an input_boolean to track whether the automation should run, or is there a simpler solution?
Any help would be appreciated! Thanks
#Question about sunset automation with manual overrideHi everyone! I'm trying to
1 messages · Page 1 of 1 (latest)
I think if you set up the checks in this order, it should work fine.
When: "Sun sets"
And if: "[your light] is off"
Then do: "Light turn on"
Then second automation:
When: "Time is 2100 everyday" (there's a time trigger you can set, and it has options for each day)
And if: "[your light] is on"
Then do: "Light turn off"
the sunset trigger should reset each day, and you can also set it to check at specific times at specific days (e.g. every day)
To recap your wish, you want to turn on the lights on the sunset, but only if sunset is before 9PM and no matter what, you want them to turn off at 9PM. You can do this with a single automation having 2 triggers, or 2 automations.
But then you have said that if you manually turn the lights off before 9PM, they should stay off. That means if you manually turn lights off before the sunset (which is before 9PM) the sunset event should not turn them on?
This part is slightly confusing, but you can add a helper (input_boolean) that acts as a variable and you can set this helper to "manually set to off" and then you check the state in your automation to turn them on (sunset event). And another automation let's say at midnight, that will reset the helper for the next day activity.
Search for "motion enabled lights with manual override" type of automations
Thank you for your reply.
My main issue is the following:
If I go to sleep around 9:30 PM and the lights are still on, I usually turn them off manually using the wall light switch. The problem is that once I do that, the lights cannot be turned on again via Home Assistant, because they are completely without power.
What I’m looking for is a smarter solution, for example:
An automation that detects when I go to sleep and turns the lights off beforehand, or
An automation that turns the lights off at a fixed time (e.g. 9:00 PM), but
If I’m still awake and turn the lights on manually, Home Assistant should turn them off again automatically after a certain time.
I hope this explains my situation clearly. Any suggestions or best practices would be appreciated
Or don't physically turn them off and add smart switch instead?
Which smart switch would you recommend? In the evening i usually won't use my phone in case i need to turn off the lights tough that is why i was used to turn them off physically
Shelly is not bad. But if you use more Wifi iot stuff, be prepared to also spend money on a good wifi network. So you could go for a Zigbee Shelly.
If you have a neutral wire at the switch or you can place it near the light you can pick any Shelly, including an i4. If you don't have a neutral wire and can run one, you need a 1L or 2L.
Correct! Do you already have a Zigbee network?
Yes i do have one. But i am not 100% sure if i have a neutral wire or not
I live in germany
SONOFF ZBMINIL2 is 40% smaller than ZBMINIL, which means it takes up less space in the mounting box, suitable for most sizes of cabinets and leaves more space for DIY modifications. Although ZBMINIL2 is smaller, it has many functions, no neutral conductor required, two-way control, intelligent ti...
and these?
Sonoff ZBMINIL2 is likely for you, you don't need neutral and it is zigbee.
you plug it in the seris to your light and have 2 inputs for your switch on the wall. so you can control it remotely and manually
But you have smart bulb, don't you? Then a ZBminiL2 isn't usable/desirable as it will still kill the power to the smart bulbs. You need a module with detached mode. The Shelly has that.
What does this detached mode do?
And I have smart bulbs but I would replace them maybe
detached mode only sends notification to home assistant about "someone pressed physical switch" but does nothing to the light. Then HA does the rest.
If you have smart bulbs, I would replace the switches. I put Hue Tap Switch in my apartment for all lights
In detached mode the power to the light can stay on to power a smart bulb. And only notifies HA the switch was operated so you can make automations.
Also an option, same as Hue Wall switch. But downside is price and batteries. So yeah, certainly an option if that's not an issue 🙂
Tuya Wifi (and thus the Tuya integation) or Zigbee?
ZigBee but over the tuya Integration
Somehow it is shown in home assistant but I can not configure it to control any of the lights
Fernbedienung 2 it is called the remote
So you have a Tuya gateway?
Do you also have a Zigbee stick (USB / Ethernet)?
No I only have the tuya/silvercrest Gateway
Then I would definitely switch 😄
And which zigbee adapter?
alias: New automation
description: ""
triggers:
- trigger: sun
event: sunset
offset: 0
conditions: - condition: time
before: "21:00:00"
actions: - action: light.turn_on
metadata: {}
target:
entity_id:
- light.rgbic_strip_lights
- light.gu_10_weiss
- light.gu_10_farbig
- light.gu_10_weiss_3
- light.gu_10_weiss_4
- light.gu_10_weiss_6
device_id:
- ca787edba2218136ccaeb603f589f92f
- 2ca2b3c52d6294909927efba6dbeef3e
- 7edc257335b2386ff6b70eb2e7eb7649
- 685142b8fd880fce5e382ac15682500e
- 68dea247b22068d74da05f21df2e5bca
- 9f191852108b45faa844bc1ff331acbf
data:
color_temp_kelvin: 2000
mode: single
Why does this only work for 2 devices from the list?
that was the one that home assist used
alias: New automation
description: ""
triggers:
- trigger: sun
event: sunset
offset: 0
conditions: - condition: time
before: "21:00:00"
actions: - action: light.turn_on
metadata: {}
target:
entity_id:
- light.rgbic_strip_lights
- light.gu_10_weiss
- light.gu_10_farbig
- light.gu_10_weiss_3
- light.gu_10_weiss_4
- light.gu_10_weiss_6
- light.gu_10_farbig_2
- light.govee_light_2
- light.govee_light_3
data:
color_temp_kelvin: 2000
mode: single
that is better?
alias: Dreame Saugen
description: ""
triggers:
- trigger: time
at: "10:00:00"
weekday:- mon
- tue
- wed
- thu
- fri
conditions:
- condition: device
device_id: 5c63ab01b3b45ccab486cfbbd53a00df
domain: device_tracker
entity_id: 875a0cbbaf466ff73dbb2d95152e79bc
type: is_not_home - condition: device
device_id: 1e933ba6235e2635714d569a15129476
domain: device_tracker
entity_id: 904c0112b77bfaa486954ed4ca9abb99
type: is_not_home
actions: - device_id: 703bb6c301f47d888ba3f5c1404ec3d3
domain: vacuum
entity_id: b15cb5b6e403603c6c1067a73149b7bc
type: clean
mode: single
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
Maybe I do not understand the real problem but if you use a boolean helper for manual switch this will bypass your automation. And in your automation you add the trigger sunrise. when sunrise you put your helper to false this way it will reset automatically every day.
One light does not turn on on its own