My name is Oriol, I’m starting with Home Assistant, up to now using the foro, manuals, tutorials I could solve all problems I got.
But now I’m try to do an automation that:
Trigger
When we arrive at home ( 1 user of more… using life360)
Conditions
-Entrance lights are switched off.
AND
-Sun state: below_horizon
action
-Switch on entrance light
-Star timer to switch off the light in 5 minuts
This is the code I’ve:
- id: '1595094439711'
alias: night
description: ''
trigger:
- entity_id: device_tracker.life360_User1
event: enter
platform: zone
zone: zone.home
- entity_id: device_tracker.life360_User2
event: enter
platform: zone
zone: zone.home
- entity_id: device_tracker.life360_User3
event: enter
platform: zone
zone: zone.home
- entity_id: device_tracker.life360_User4
event: enter
platform: zone
zone: zone.home
condition:
condition: and
conditions:
- condition: state
entity_id: switch.entrance_light
state: 'off'
- condition: state
entity_id: sun.sun
state: below_horizon
action:
- data: {}
entity_id: switch.entrance_light
service: switch.turn_on
- data:
entity_id: timer.tempsretardfarolesnit
service: timer.start
I’m sure that the problem I’ve is with sun condition. as If I take out this condition, it runs perfect, So my point of view is that I have a problem on AND. Could someone help me to understand why?
Thanks a lot! Keep Save of Covid!
Oriol
Home Assistant Core 0.112.4
Operating System 4.10
On Raspberry 4
Dear Francisp, Thanks a lot for your help an patient, is my 1st post so I’m trying to understand all rules and way-to-do!
Thanks another time!
PD. also I broke my left had 3 weeks ago, and is really difficult to write with just one hand overall: `
Hi,
Yes it comes ( part) from automation editor, and yes I reload it.
I made the change that you suggest, and chane the sun to above_horizon ( just to do the trials right now)
I’ll come back!
Thanks a lot!