automations.yaml:
- alias: Lights on based on motion
trigger:
platform: state
entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
to: 'on'
condition:
condition: or
conditions:
- condition: sun
after: sunset
after_offset: "00:30:00"
- condition: sun
before: sunrise
before_offset: "-00:30:00"
action:
service: homeassistant.turn_on
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
- alias: Lights off based on no motion
trigger:
platform: state
entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
to: 'off'
for:
minutes: 1
seconds: 30
condition:
condition: state
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
state: 'on'
action:
service: homeassistant.turn_off
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
–
And that was working in harmony, until update; trying to convert it so it’s functional within editor and such.
automations.yaml:
- id: '6982383996'
alias: Lights on based on motion hall
trigger:
- entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
from: 'off'
platform: state
to: 'on'
condition:
- after: sunrise
after_offset: "-00:30:00"
before: sunset
before_offset: "00:30:00"
condition: sun
action:
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
service: homeassistant.turn_on
- id: '323868583438'
alias: Lights off based on no motion hall
trigger:
- entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
platform: state
to: 'off'
for:
minutes: 1
seconds: 30
condition:
- condition: state
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
state: 'on'
action:
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
service: homeassistant.turn_off
–
Problem is that it never turns off, suggestions to why ?
id: Motion in BR # Normal Weekdays
alias: ‘Motion in BR’
trigger:
platform: state
entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor_2, binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor_3
to: ‘on’
condition:
condition: numeric_state
entity_id: ‘sensor.fibaro_system_fgms001zw5_motion_sensor_luminance_2’ # Read LUX levels to ensure room is dark
below: ‘50’
condition: time
after: ‘06:40:00’
before: ‘22:15:00’
condition: time
weekday:
mon
tue
wed
thu
fri
action:
service: homeassistant.turn_on
entity_id:
switch.mbr_bryan_light
service: homeassistant.turn_on
data_template:
entity_id: light.b2mbrled
brightness: 255
color_name: >-
{% if is_state(“sensor.dark_sky_icon”, “snow”) %}
blue
{% elif is_state(“sensor.dark_sky_icon”, “partly-cloud-day”) %}
yellow
{% elif is_state(“sensor.dark_sky_icon”, “rain”) %}
white
{% else %}
white
{% endif %}
One thing I would suggest doing is removing the before_sunset and after_sunset from your automatons, and use the sun.sun elevation level instead. e.g. below.
This example makes an automation work if the sun is below 10°. You can play around with the sun angle and see what works best for you depending on your location.
Also, double check the breaking changes that are listed for whatever the version of HA is that you have upgraded to (you haven’t mentioned it)
Oh well my YAML-skills arent that good, you entered no formatting so hard for me to replicate
Maybe you thought about everything, but where I live, sun never sets in the summer; so useless to turn light on
So to get it working perfectly I would prolly have to have some solution that looks like yours; mine was quite dumb to start with.