Generic light integration

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.

Why wouldn’t you just use a template-light?

1 Like

Can you please explain how to transfer this in Template Light?

  - platform: generic_thermostat
    name: JOJO - Wohnzimmer - LED Stripes
    unique_id: climate.jojo_wohnzimmer_led_stripes
    heater: light.jojo_wohnzimmer_led_stripes
    target_sensor: sensor.sonnenstand
    min_temp: 0
    max_temp: 1000
    precision: 1

Are you looking to set the color temperature of the light strip? I think that’s what you’re trying to do with the heater: property.

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.

Hmmmm… :thinking:

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]
1 Like

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.

1 Like

Thank you all.

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.