I am pretty new to HA; so am just experimenting at this point. I bought both the Aqara and Hue motion sensors and a Hue Light bulb all running off Zigbee. The Aqara motion sensor was a breeze to setup and used to turn on/off the light bulb. The Hue motions sensor; on the other hand, has got me baffled. I know that the hue motion sensor has senses light and temperature also and maybe that is my issue. The problem is that I can’t use motion to turn on the light bulb. Any examples or help would be greatly appreciated. Btw, I am using the Automation GUI to set this up and not Yaml. Thanks!
Please show the code of your non working automation.
- id: ‘1615143487644’
alias: basement_stairs_sensor_2_light_on
description: ‘’
trigger:- platform: state
entity_id: binary_sensor.philips_sml001_37c66708_occupancy
to: ‘On’
condition: []
action: - service: light.turn_on
data: {}
entity_id: light.philips_lwa008_21714109_level_on_off
mode: single
- platform: state
- id: ‘1615143834897’
alias: basement_stairs_sensor_2_light_off
description: ‘’
trigger:- platform: state
entity_id: binary_sensor.philips_sml001_37c66708_occupancy
to: ‘off’
for: 0:03:00
condition: []
action: - service: light.turn_off
data: {}
entity_id: light.philips_lwa008_21714109_level_on_off
mode: single
- platform: state
I’m familiar with the Aqara motion sensor (nice pick, reliable and inexpensive) but not the Hue.
First, what are you using to talk zigbee? (ZHA, deCONZ, zigbee2mqtt)
Second, on the Aqara, you will have a STATE for motion, LUX and other stuff depending on your software… those are easy. The motion sensor part is a binary sensor with a STATE value of on/off… you use that one the most.
Now on the Hue, if it’s like some other sensors, the motion is buried in the ATTRIBUTE and you may have to write a sensor template to extract it. If that is the case, search here for motion sensor templates… there are a couple of them laying around.
Thanks. I have a ZHA zigbee device on a rPI USB port
For the Hue motion sensor, look for a binary.sensor.(whatever_you_named_it) to see if you have one, and if it gives you the motion sensor STATE.
If you don’t see one, look for a sensor.(whatever_you_named_it) and look for a motion sensing in the ATTRIBUTES.
(you do this in the Developer Tools Menu under States… just scroll down until you find it)
Looks like I have “binary_sensor.phillips.sml007…on_off” and “binary_sensor.phillips.sml007…occupancy”
could not find any “motion” with this sensor
Also found: “sensor.phillips.sml007…power”, “sensor.phillips.sml007…temperature” ,and “sensor.phillips.sml007…illumiinance”
just for giggles, change your automation from binary.sensor.blahblah.occupancy to binary.sensor.blahblah.(the on_off one).
Did not work
Keep your 'puter on the Developer Tools/States display and watch that binary.sensor STATE to see if it changes when you walk in front of the sensor to see if it’s working. If so, then check the indenting and spelling in your automation.
Saw the binary_sensor “occupancy” flip to on; but, the light did not come on
10 seconds later, it flipped back to off
It’s working as advertised…
Then it’s all in the automation. If the other automations work (the ones for the Aqara sensor), do a REALLY careful comparison and triple check the device names for the sensor and the light bulb. It’s gotta be a simple duh! when you find it.
Will do. Thanks for your time!
Here’s my automation that does basicly the same thing. This one works fine here.
#######################################
# Utility light on motion detection
# if motion sensed turn on light
# turn off after 4 minutes
# (2 minute sensor, 2 minute timer)
#-|---|---|---|---|---|---|---|---|---|
- alias: 'Utility light on motion'
trigger:
platform: state
entity_id: binary_sensor.utility_motion
to: 'on'
action:
service: light.turn_on
entity_id: light.utility_ceiling_light
- alias: Turn off Utility light after delay
trigger:
platform: state
entity_id: binary_sensor.utility_motion
to: 'off'
for:
minutes: 2
action:
service: light.turn_off
entity_id: light.utility_ceiling_light
Please format your code properly as explained in point 11 of the community guidelines.
Binary sensors are either on
or off
, the states are lowercase. You are wrongly using On
. Ypu can see the correct state under Developer Tools -> States
Thanks! That was it