Need advice to get data from a motion sensor

Hi community

First of all I wish you all happy holidays.

I am trying to setup my hue motion sensors to switch on different lights in my house. The problem is, that the sensors respond to slow for real-time events. I found a workaround via the Homekit integration but there are not many options to control their behaviour and it doesnt work reliable.

I found the huemagic nodes for Nodered and love it! Actually I am trying to build an automation which switches a light if motion is detected and switches it off with a delay of 1 minute. I have a basic-understanding of nodered but cant figure out how to get motion state (true or false) in order to pass the information to the lightswitch and integrate the 1 min delay.

question
How do I have to configure the switch-node to extract the motion state from the hue sensor?

payloads from the hue sensor
Bildschirmfoto 2020-12-29 um 15.05.19

I did some research but cant get the switch node to run :confused:

Many thanks for your advice!

Kind regards from Switzerland

Andrew

I am guessing your Switch Node looks like this:
image

Where it should look like this (if you are interested in “motion” specifically):
image

Note that you don’t “extract” information, rather compare the value of the object at msg.payload.motion to is true and is false.

1 Like

many thanks for your quick reply and explanation. you made my day, it works like a charm :star_struck:

1 Like

You’re welcome :slight_smile:

I highly highly recommend you have a look at the short written tutorials from the Node Red site:
https://nodered.org/docs/tutorials/

They cover the very basics like what you had asked.

It will save you a lot of headache if you can understand the “language” of Node Red!