Node red intrgarted to home asistant

Hello all

As per @WallyR, reply to me, I am opening a new thread on my issue

I am new to NR and i just started to learn how to create a flow (i guess)

I’m trying to turn on a light based upon motion detection, illuminance and time of day

I have a “enent state” (motion detection) that is configured “if State” is On. this node is connected to a “current event state” in which i have set illuminance <= 4

This in turn is connected to Bigtimer inode n which I set a time of 17:00 to 23:45 that is connected to “call service” to turn on the light

This node is connected to a “delay node” which is set to 30 seconds and this in turn is connected to a call service to turn the light off.

When i deploy the flow, the flow starts and completed perfectly

However

When I cross in front of the motion sensor, the motion sensor is activated.
But

The Ehtrance Hall light does not turn on

If i use the inject node and send a true stamp and connect it to the illuminance call service node the flow starts and completes perfectly.

Therefore i surmise that my motion detection event state is not working correctly

This event state node is configured as follow
Name : Motion
Server: Homeassistant
entity: binary_sensor_entrance _hall_sensor_motion _detection (friendly name: entrance hall motion detection)

State is on
State type; Strigng

I am trying to copy and paste a screen show of my flow and/or the yaml code (which i do not know where to get it)

I have a debug node linked to all the noded (debug 1,2,3,4,5,6,) only debug 3 to 6 list in the debug window

I am new to NR and i just started to learn how to create a flow (i guess)

What did i not configure correctly?

Thank you in advance for yous help and teachings

Hello, export your code with :

And try to put some debug nodes (at the output of your nodes) to see what happens : Capture d'écran 2023-10-17 184448

Thank you @meluvo59 wow that was fast.

tried the export route however i do not get the picture as you did I only can paste the text version of it

The debug nodes only give me
10/17/2023, 6:51:54 PMnode: debug 6msg.payload : string[2]

“On”
after every debug node

This message conmes from the bigtimer node that has on msg =: on and off msg=: off

It’s ok for the text, that’s the normal way.

And for the debug node =>

Thank you for your availability @meluvo59

[{"id":"e901b5dfd444e4a5","type":"tab","label":"Stairs Light Control","disabled":false,"info":"to control all entrance and stairwell lights","env":[]},{"id":"d0d4bd828a93a1db","type":"delay","z":"e901b5dfd444e4a5","name":"30 Sec Delay","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1130,"y":820,"wires":[["08e7e1e6fafb4c5b","69290bb86647a390"]]},{"id":"ceb6baaac58a9232","type":"api-call-service","z":"e901b5dfd444e4a5","name":"Entrance Hall Night Light on","server":"8687e46ec9bc620c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":["entrance_hall"],"deviceId":[],"entityId":["light.entrance_hall_light"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"brightness_pct","propertyType":"msg","value":"30","valueType":"num"}],"queue":"none","x":860,"y":860,"wires":[["d0d4bd828a93a1db"]]},{"id":"7c9778648d1e2427","type":"bigtimer","z":"e901b5dfd444e4a5","outtopic":"","outpayload1":"On","outpayload2":"OFF","name":"Day Schedular","comment":"","lat":"46.145242","lon":"12.794489","starttime":"1080","endtime":1425,"starttime2":"1425","endtime2":"450","startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":"0","sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":0,"xmonth7":0,"xday8":0,"xmonth8":0,"xday9":0,"xmonth9":0,"xday10":0,"xmonth10":0,"xday11":0,"xmonth11":0,"xday12":0,"xmonth12":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":600,"y":840,"wires":[["ceb6baaac58a9232","f17df4d1a6d2d4e1","3c90b92e70c5cf40"],[],[]]},{"id":"f6695991abdf38a2","type":"api-current-state","z":"e901b5dfd444e4a5","name":"Illuminance","server":"8687e46ec9bc620c","version":3,"outputs":2,"halt_if":"4","halt_if_type":"flow","halt_if_compare":"lte","entity_id":"sensor.entrance_hall_sensor_illuminance","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":840,"wires":[["7c9778648d1e2427","2b3184bf33942fd8"],[]]},{"id":"f17df4d1a6d2d4e1","type":"api-call-service","z":"e901b5dfd444e4a5","name":"Entrance Hall Evening Light on","server":"8687e46ec9bc620c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":["entrance_hall"],"deviceId":["b84f023137ed2a83ed872a779abd8a8e"],"entityId":["light.entrance_hall_light"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"brightness_pct","propertyType":"msg","value":"60","valueType":"num"}],"queue":"none","x":870,"y":800,"wires":[["d0d4bd828a93a1db","95df5fb9b8cf7c29"]]},{"id":"f4aacc9aac952103","type":"inject","z":"e901b5dfd444e4a5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":720,"wires":[["f6695991abdf38a2"]]},{"id":"08e7e1e6fafb4c5b","type":"api-call-service","z":"e901b5dfd444e4a5","name":"","server":"8687e46ec9bc620c","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":["b84f023137ed2a83ed872a779abd8a8e"],"entityId":["light.entrance_hall_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":820,"wires":[["9ef58e1fd63d2fef"]]},{"id":"4ba22f749ae37694","type":"debug","z":"e901b5dfd444e4a5","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":380,"y":680,"wires":[]},{"id":"2b3184bf33942fd8","type":"debug","z":"e901b5dfd444e4a5","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":680,"wires":[]},{"id":"3c90b92e70c5cf40","type":"debug","z":"e901b5dfd444e4a5","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":800,"y":680,"wires":[]},{"id":"95df5fb9b8cf7c29","type":"debug","z":"e901b5dfd444e4a5","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1060,"y":680,"wires":[]},{"id":"69290bb86647a390","type":"debug","z":"e901b5dfd444e4a5","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1260,"y":680,"wires":[]},{"id":"9ef58e1fd63d2fef","type":"debug","z":"e901b5dfd444e4a5","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1480,"y":680,"wires":[]},{"id":"ecac47c9fc4cafb6","type":"server-state-changed","z":"e901b5dfd444e4a5","name":"Motio9n Detection","server":"8687e46ec9bc620c","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.entrance_hall_sensor_motion_detection","entityIdType":"exact","outputInitially":true,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"1","forType":"num","forUnits":"milliseconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":840,"wires":[["f6695991abdf38a2","4ba22f749ae37694"],[]]},{"id":"8687e46ec9bc620c","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"numeric","statusMonth":"short","statusDay":"2-digit","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":false}]

Thank your for your help

Ouch, for some reason, i’m not able to copy/paste your code, it gives me errors. Can you put it with the preformatted text function ? (</>)

Sorry I tried

With this tool

I edited my msg and applied the </>

did this not help

Thank you for taking the time from your day to help me

Some text got in to the code in the beginning, which will need to be removed before importing.

Oops sorry I included here is when I highlighted the code I fixed it hop this helps.

Still trying learn how to paste the picture of the screen capture

Once again sorry to have you waste so much of your time .I would be happy to pay you both a beer if this would make up for it

I tried too with a motion sensor, and i’m not able to see the change in nodered, something weird. I will check more deeply tomorrow, sorry :wink:

Hi

I’m using an aeotech multisensor 6 as a device.

I emailed Aeotec support just now to see if they can also help

Once again thank you all

Hello all

Success

After an email to Aeotec support and to Node Red community and we all agreed that the issue was the sensor.

A few minutes ago i (and i believe all z wave JS UI users) I received an update to JS UI which caused to update to the devices

i had to restart js ui restart ha remove and reinterview the devices

i corrected the nodes with the updated items and deployed

the flow completed successfully and all debug nodes reported

then

i placed the sensor back to its location

reset the debug nodes list

passed in front of the motion sensor and the flow started and completed successfully and all debus node reported

Thank you all for your help and patience.

Be well