Lights off when no movement

I’m not seeing anything wrong with your automation. Not sure what to tell you. If it were me, I’d be checking home-assistant.log to see what actually happened at sunset.

But the thing is that the two other lamps are only suppose to be switched on after sunset and if a light is already on. Don’t need them before after dark, but sometimes we have to adjust the living room lights manually.

It never fired according to the log

It could also be that you are using the trigger of at sunset, and the condition of below horizon?

I have no clue, what should the automation looks like then?
I am open to everything as long as it does what I want :stuck_out_tongue:

At sunset sun.sun changes to below_horizon. But I suppose there could be some small delay between sunset and the time sun.sun’s state changes in the state machine. So maybe it would be better to use the following conditions:

  condition:
    - condition: or
      conditions:
        - condition: sun
          after: sunset
        - condition: sun
          before: sunrise
    - condition: state
      entity_id: light.fibaro_system_fgd212_dimmer_2_level_7
      state: 'on'
1 Like

And according to the log, or history, was light.fibaro_system_fgd212_dimmer_2_level_7 on at sunset?

Regarding the conditions in my other reply, that’s the way I was going to write it originally, but I thought using below_horizon was simpler. But @talkshowonmute26 has a point and that might not work. So try it with the new conditions.

Again thanks a lot for taking time to look into this again. I will try the new code and check if it works tomorrow.

1 Like

From everything I can see, I believe @pnbruckner 's solution will work, and do everything you want it to.
Let us know tomorrow

Hi again,

I am unable to be home before sunset to check if the code works or not :(.
I think I need one more automation which turn on other lights when I switch on the living room lights. How could I do that?

You don’t need to be home. That’s what the Logbook and home-assistant.log are for. :wink:

That is a very basic automation. Have you read the docs starting here yet? I don’t mind helping with tougher questions, but with a little reading you should be able to answer that question yourself. :slight_smile:

Well the automation should not run if the living room light is not on.
I guess the log wont show anything since it did not run as living room lights is not on if we are not home.

Thank you very much for the docs, I will explore that closer for sure :smiley:

1 Like