I tried to build a generic light with the generic thermostat integration today. I used the elevation attribute of sun.sun as the temperature sensor and the light entity as the switch.
The only problem is that the labels are not right. Everything else works perfectly. I would be happy to see some integration like “generic light” in the future.
Im looking forward to the following. Everyday I turn on a group “Multimedia” via Google Assistant which includes an av receiver, a tv, light.jojo_wohnzimmer-led_stripes and another background light. The two lights in this group should switch to state on but actually should be switched on when its dark outside (sensor.sonnenstand). I don’t want to set the color temperature or something like this.
I could do this with automations in Node-RED but it would be cool to have another solution for this.
You can easily do this in a native automation. Let me see if I have this right. The below automation will trigger when your multimedia boolean (I’m assuming that’s what you are using) turns on from GA. Then it checks if it’s after sunset and before sunrise (dark). Then it turns on the two lights.
description: "Multimedia"
mode: single
trigger:
- platform: state
entity_id:
- input_boolean.[your boolean here]
from: "off"
to: "on"
condition:
- condition: sun
before: sunrise
after: sunset
action:
- service: light.turn_on
target:
entity_id:
- light.jojo_wohnzimmer-led_stripes
- light.[your other light]
Might need a choose condition with brightness: 1 if sun is above_horizon and another condition (with a corresponding trigger) with brightness:100 if sun is below horizon based on:
Then again, the requirements aren’t very clear and your code might be good enough for the intended purpose.
I’ll do all my automations in Node-RED and tried to get this working but I’m just too dumb. An easy generic light integration that works exactly like the generic thermostat integration would be awesome.