#"When it's Dark" Light

1 messages · Page 1 of 1 (latest)

warm ibex
#

Is there such a thing as a virtual-light that proxies for a physical light, but only comes on when it's dark?

Assume it's "light" from 0600 to 1800. I turn on the light at 1700, and the physical light will automatically come on at 1800. (But not before).

I know I can achieve this effect in various ways, but I want to not have to think about it in every place I try to do it, and I don't like the "code duplication" it would require.

spare relic
#

You can make a template light

ember kernel
#

Is this an on/off-only light (or will be treated like one), or do you also need to consider brightness, color, etc

small sable
#

Unless I’m missing something couldn’t you just automate it?

ember kernel
#

I understand the goal as wanting to have it appear like a normal light in HA, but the physical device is only lit when the night condition is also active.

If that’s the case, @spare relic recommendation of the template light is spot on, and I’d also follow the official example of firing scripts.

You can limit code duplication (and allow for the possibility of different is_dark rules) by making a script that wants three entity inputs: 1) template light 2) template binary_sensor for “is dark” 3) actual physical light; the script would then decide to illuminate(or not) the physical device

Firing the script from template light on/off events covers half of what you want; you could get the other half by setting up an automation to watch changes to the template binary_sensor and fire the same script with the same inputs

Home Assistant

Instructions on how to integrate Template Sensors into Home Assistant.

#

The only thing I’d want for this that I’m not sure how to do, is to add the actual state of the physical light to the template light. It doesn’t look like you can add attributes? And since the template light isn’t its own device, you can’t just attach another sensor to it

dusk badger
#

For something like that, easiest would just be to make a input_boolean (toggle helper) and give it a lightbulb icon. Could make a template light and maybe mimic brightness etc as well. But it is a whole lot more work.

I kind of have the same, just a toggle that my living room is active. When it get's dark, lights are turned on if that toggle is on.