New to home assitant

I’m new to HASS.and got stuck with a relative easy job? I want to turn on a second light if the first light is on for 100%. Meaning when it is at 0% to 99% there will be no need for a second light to be on.
How can I achieve this with automation?

Try something like this:

alias: Above 99%
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: light.sphere1
    value_template: '{{ state.attributes.brightness}}'
    above: '99'
  condition: []
  action:
  - service: light.turn_on
    data: {}
    entity_id: light.dinner1
  mode: single

FYI brightness is a scale of 0 to 255, you would want something like:

  trigger:
  - platform: numeric_state
    entity_id: light.sphere1
    attribute: brightness
    above: 254
1 Like

As yes, you’re right.

above: 252 I think

Not working. Still something wrong?

platform: numeric_state
entity_id: light.bf839bf95377c5fba474c5
attribute: brightness
above: ‘252’
condition: []
type: turn_on
device_id: 06a930f16bafea69310cf7d1060d9905
entity_id: switch.on_off_plug_in_unit_5
domain: switch

Please see the sticky post, which amongst other things explains how to format code.

1 Like

Not very helpfull. No probs I will figure it out by myself.

With formatted code we can help . It’s really hard to decode an unformatted blob to know where the problem may be.

1 Like