Jump to content

Homeassistant sensor automation

LasseLito

Hi Guys,

 

since I moved to a new appartment I decided to change my smarthome setup to homeassitant.

First of all my setup: I'm running homeassist on a 4gb raspberry pi 4 with a conbeeII stick.

Before I basicly only had a hue bridge and some lights. 

Now im trying to start my first sensor based automation.

The idea is very simple: I want the light to turn on if someone is in the hallway. When its past 23:00 the light still should turn on but with a lower brightness setting. If no motion is dedected after 2 minutes the lights should turn off again.

I'm using a hue sensor and three ledvance bulps.

 

This is how my automation looks. Sadly it doens't work. I think it has something to do with the sensor, because also in preconfigured motion automation it doenst work. However in the Homeassists logs the sensor shows movement.

 

Maybe someone can help me. 🙂

Cheers, Lasse

if:
  - type: is_motion
    condition: device
    device_id: c69f661ea032fdd582223fefca810218
    entity_id: binary_sensor.philips_sml001_motion
    domain: binary_sensor
    for:
      hours: 0
      minutes: 2
      seconds: 0
then:
  - if:
      - condition: time
        after: "23:00:00"
        before: "07:00:00"
        weekday:
          - mon
          - tue
          - wed
          - thu
          - sun
          - sat
          - fri
    then:
      - type: turn_on
        device_id: 68abf1a8994193790d1a713aa2b8e909
        entity_id: light.gluhbirne_durchgang_light_2
        domain: light
        brightness_pct: 30
      - type: turn_on
        device_id: dfb800837ac7796b00dff763788ef35e
        entity_id: light.gluhbirne_eingang_light
        domain: light
        brightness_pct: 30
      - type: turn_on
        device_id: fa6deb968e787f080ea05727d62514a2
        entity_id: light.gluhbirne_zimmerturen_light
        domain: light
        brightness_pct: 30
    else:
      - type: turn_on
        device_id: 68abf1a8994193790d1a713aa2b8e909
        entity_id: light.gluhbirne_durchgang_light_2
        domain: light
        brightness_pct: 100
      - type: turn_on
        device_id: dfb800837ac7796b00dff763788ef35e
        entity_id: light.gluhbirne_eingang_light
        domain: light
        brightness_pct: 100
      - type: turn_on
        device_id: fa6deb968e787f080ea05727d62514a2
        entity_id: light.gluhbirne_zimmerturen_light
        domain: light
        brightness_pct: 100
else:
  - type: turn_off
    device_id: 68abf1a8994193790d1a713aa2b8e909
    entity_id: light.gluhbirne_durchgang_light_2
    domain: light
  - type: turn_off
    device_id: dfb800837ac7796b00dff763788ef35e
    entity_id: light.gluhbirne_eingang_light
    domain: light
  - type: turn_off
    device_id: fa6deb968e787f080ea05727d62514a2
    entity_id: light.gluhbirne_zimmerturen_light
    domain: light
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×