New to Home Assistant, need help with basic light automation

Hello.

Trying to get started with home assistant, but i struggle to get basic automation on lights working.

  • alias: Turn on Livingroom Lights
    trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor_1
    to: ‘on’
    action:
    service: light.turn_on
    entity_id: light.living_room

  • alias: Turn off Livingroom Lights
    trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor_1
    to: ‘off’
    for:
    minutes: 1
    action:
    service: light.turn_off
    entity_id: light.living_room

When i manual trigger the automation it works. But the sensor wont trigger it. The state of the sensor is always “ON” Is this correct?

Thanks for all replies.

First always post your config per the blue box at the top, its a big help when troubleshooting.

Second, is the state of the sensor ‘on’ or ‘ON’? It does make a difference.

Good news, the action part is correct!

Ok, sorry. Let me try again:

- alias: Turn on Livingroom Lights
  trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor_1
    to: 'on'
  action:
    service: light.turn_on
    entity_id: light.living_room

- alias: Turn off Livingroom Lights
  trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor_1
    to: 'off'
    for:
      minutes: 1
  action:
    service: light.turn_off
    entity_id: light.living_room

The state of the sensor is “On”!

Always use the ‘states’ tap in the dev tools to check states. See the red arrow in the example below, type in your entity Id in the left column where I have “device_tracker”

The front end sometimes uses more ‘friendly’ states for items. See the example below. Device trackers show away in the front end but not_home is the actual state to use for automations.

Also, your sensor will not fire to turn the light on if the state is always on. It has to go from some state other than on to ‘on’ to fire.

I would double check the entity_id you are using. Is the binary sensor listed the actual motion sensor you want to use to turn the light on? It seems like it should be turning off periodically unless there is constant motion in your house.

I left the sensor in a room alone. The state still is still only “On”

:roll_eyes:

Note that the state is ‘on’ not ‘On’. Very important to match the state properly.

Are their any other sensors or entitys related to your multisensor? You should have motion, temp, humidity, light level, and a few others with that sensor. I am guessing the binary sensor shown is just if the sensor itself is on, not the values for motion or temp or the other sensors.

Thanks for help, Silvrr, i got further. I now use the burgler function on my Aoetech multisensor. So when the value is 8 there is movement, and when the value is 0 there is none. The only problem i have now is that the sensor stays 8 for a long time after there is no movement. It does not return to 0 befor many minutes, then my countdown at 1 min starts.

Is this fixable?

Check the manual for your zwave sensor. Sometimes there are small switches to adjust these things or you will need to adjust it in software. A search of the forum might turn something up as that is a popular sensor.

Hi, Please, can you post your exact code here? I have the exact same sensor and problem. Also, did you find any settings for the sensor to get a lower timeout value?