Presence in master room

Presence in master room combination of 2 Acura fp2 fp1 sensors

Everything works fine, the question is how can I make this flow more correct, I want to check every time something enters the room, so there will be a loop

is it true ?

All the details behind this thing work, fix, only this flow, I would be happy to improve on the subject of the test

any one???:_)

Why the loop with the “status someone ?”???
Just react to its change once.

i don’t want to miss the presence on the room,
if i leave or enter the room then the status will make another check that the room is empty and turn off the light

At the moment it works but sometimes it misses and the room remains in “empty” mode and the lamp is still on

But you are not really checking the room.
You just pull the state from HA, which would not have changed, if there have not been a state change.
And if there have been a state change then you could just react to that.

1 Like

Ok so how can I make a timer? Or a test that will do a test every time I enter and leave the room?

Node Red just reads the data in HA.
If HA is not updated with new data from your sensors, then there is no need for it.
It is your sensors that needs to test for a presence, not HA and not Node Red.

You right, I have the sensors that do this in HA and there the change works fine, but I want to do a proper automation for testing in Tatos, do you have something similar?

You would need a sensor that you can pull with a service call from HA and then make the service call from Node Red,but it would not make sense to have such a sensor, since if it detects presence, then it should already be reporting it to HA as default.

I understand,

But do you still have something similar? who is doing a test, maybe I can understand better?

Imagine you have 3 persons standing in a room.
1 person is named sensor, one is named HA and one is named NR.
You enter the room now and the person named sensor quickly tells HA that someone entered the room.
HA writes a note that someone is in the room and then tells NR that some is in the room.
NR checks his checklist to see if something should be done.

You now shoot the person named sensor and leaves the room.
NRs digital watch beeps and he checks his checklist again where he has a note that asks if someone else is in the room.
NR then asks HA if someone is in the room and HA answers yes, because that is what HA has written on his note.

HA does not know that nobody else is in the room, because sensor have not told him so due to him being dead.

can you share ?
I will see if I can learn this and coordinate with my HA

image

[{"id":"97e6a3ea.2d8cd","type":"api-call-service","z":"fe1a8042.af255","name":"Garage Light On","server":"f3f422ce.9f2a6","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.garagelightswitch"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":310,"y":191,"wires":[["4e0859a3.102238"]]},{"id":"4ff57502.55030c","type":"api-call-service","z":"fe1a8042.af255","name":"Garage Light Off","server":"f3f422ce.9f2a6","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.garagelightswitch"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":519,"y":248,"wires":[[]]},{"id":"a1f8653c.15a248","type":"trigger-state","z":"fe1a8042.af255","name":"Garage Motion","server":"f3f422ce.9f2a6","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.garage_motion_motion","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"},{"targetType":"entity_id","targetValue":"switch.garagelightswitch","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":102,"y":191,"wires":[["97e6a3ea.2d8cd"],[]]},{"id":"4e0859a3.102238","type":"ha-wait-until","z":"fe1a8042.af255","name":"No Motion","server":"f3f422ce.9f2a6","version":2,"outputs":1,"entityId":"binary_sensor.garage_motion_motion","entityIdFilterType":"exact","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"0","timeoutType":"num","timeoutUnits":"minutes","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"x":290,"y":249,"wires":[["4ff57502.55030c"]]},{"id":"f3f422ce.9f2a6","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

you can use event states node. Select your motion sensor (exact) >then If state Off for Xx seconds
If the state is true is sends a off command. This off state resets every time a motion is triggered.
Connect the false to your illuminance sensor (current state) and that sensor triggers a light and your done.
But you can make also extra sensor for person triggers etc. off course

exactly!

Do you have an example that you work with that you can share :slight_smile:

@yuval221183

Most simple flow is like this. (motion detection, Lux level > light on | No motion xx seconds > light off)

[{"id":"04946fc1375fe7dd","type":"server-state-changed","z":"60aa8ea9c7477ca7","name":"Wasruimte Motion","server":"85cb4144.a30f7","version":4,"exposeToHomeAssistant":true,"haConfig":[{"property":"name","value":"Wasruimte Automation"},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_sensor_wasruimte_any","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"600","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":1340,"wires":[["06f55963b0d16f91"],["6fff4ad296f6110d"]]},{"id":"6fff4ad296f6110d","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Wasruimte Lux < 25","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"25","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.motion_sensor_wasruimte_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","x":360,"y":1340,"wires":[["7dc1edf70ad900ad"],[]]},{"id":"06f55963b0d16f91","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Turn off lights","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":340,"y":1280,"wires":[[]]},{"id":"7dc1edf70ad900ad","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Light On 20%","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"{\"brightness_pct\":20}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":580,"y":1340,"wires":[[]]},{"id":"85cb4144.a30f7","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

This is a more complex methode but maybe usefull for your FP2 ( can’t wait to get one of those )
It uses a state machine and state node. So you can trigger a switch states or other stuff (like people etc.)

Depending on what state the state node is in and witch states it gets you can make a action that only counts then.

[{"id":"1ce2aeee07be4cf0","type":"comment","z":"60aa8ea9c7477ca7","name":"Smart Lights Wasruimte","info":"","x":120,"y":840,"wires":[]},{"id":"c8a5b8133f4017ed","type":"trigger-state","z":"60aa8ea9c7477ca7","name":"Light Wasruimte","server":"85cb4144.a30f7","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"light.light_wasruimte","entityidfiltertype":"substring","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":100,"y":1120,"wires":[["fbdd542cdfcc1b44"],[]]},{"id":"69ccd9cb80e3deb9","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Light On 3%","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"{\"brightness_pct\":3}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":920,"wires":[["76f5eb3278f967cc"]]},{"id":"f69fb8fe41397248","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Turn off lights","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":1160,"wires":[["79137bf3677e811c"]]},{"id":"fbdd542cdfcc1b44","type":"change","z":"60aa8ea9c7477ca7","name":"switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"switch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":1120,"wires":[[]]},{"id":"3e281722d02fd779","type":"change","z":"60aa8ea9c7477ca7","name":"motion","rules":[{"t":"set","p":"payload","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":960,"wires":[["724e70e51e69be13"]]},{"id":"150a5d2bbaa364cb","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Light state","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.light_wasruimte","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"for":0,"forType":"num","forUnits":"minutes","x":1270,"y":1160,"wires":[["136e2acdf143537a"],[]]},{"id":"75dbf017c224fd09","type":"change","z":"60aa8ea9c7477ca7","name":"motion-on","rules":[{"t":"set","p":"payload","pt":"msg","to":"motion-on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":1060,"wires":[["136e2acdf143537a"]]},{"id":"5120e12d2ecb8e69","type":"link in","z":"60aa8ea9c7477ca7","name":"kitchen state machine","links":["136e2acdf143537a"],"x":345,"y":1180,"wires":[["724e70e51e69be13"]]},{"id":"136e2acdf143537a","type":"link out","z":"60aa8ea9c7477ca7","name":"kitchen state machine","links":["5120e12d2ecb8e69"],"x":1435,"y":1100,"wires":[]},{"id":"c2e188b929199459","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Wasruimte Lux < 25","server":"85cb4144.a30f7","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.motion_sensor_wasruimte_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","x":340,"y":960,"wires":[["efc9859b5785abb5","675140b4f4503a2f"]]},{"id":"7129191bb6e50592","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Morning","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"Morning","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","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":900,"y":920,"wires":[["69ccd9cb80e3deb9"],[]]},{"id":"cbaf3a40e2608c9e","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Day","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"Day","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","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":890,"y":980,"wires":[["1d6c124b40366f08"],[]]},{"id":"fd30a0249ec4d8bb","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Evening","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"Evening","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","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":900,"y":1040,"wires":[["93ccc35a3fa8b8cf"],[]]},{"id":"bfcff2a5a05ac021","type":"api-current-state","z":"60aa8ea9c7477ca7","name":"Night","server":"85cb4144.a30f7","version":3,"outputs":2,"halt_if":"Night","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.time_of_day","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":890,"y":1100,"wires":[["46dbaa80f37abb3f"],[]]},{"id":"1d6c124b40366f08","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Light On 20%","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"{\"brightness_pct\":20}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":980,"wires":[["76f5eb3278f967cc"]]},{"id":"93ccc35a3fa8b8cf","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Light On 8%","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"{\"brightness_pct\":4}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1040,"wires":[["76f5eb3278f967cc"]]},{"id":"46dbaa80f37abb3f","type":"api-call-service","z":"60aa8ea9c7477ca7","name":"Light On 1%","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light_wasruimte"],"data":"{\"brightness_pct\":1}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1100,"wires":[["76f5eb3278f967cc"]]},{"id":"9473ef84907f8dad","type":"rbe","z":"60aa8ea9c7477ca7","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":650,"y":920,"wires":[["f69fb8fe41397248"]]},{"id":"efc9859b5785abb5","type":"switch","z":"60aa8ea9c7477ca7","name":"> 26","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"26","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":920,"wires":[["9473ef84907f8dad"]]},{"id":"675140b4f4503a2f","type":"switch","z":"60aa8ea9c7477ca7","name":"< 25","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"25","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":960,"wires":[["3e281722d02fd779"]]},{"id":"2360aa53c5bc0050","type":"stoptimer","z":"60aa8ea9c7477ca7","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"pause detection","x":920,"y":1220,"wires":[["150a5d2bbaa364cb"],[]]},{"id":"79137bf3677e811c","type":"stoptimer","z":"60aa8ea9c7477ca7","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"pause","x":1090,"y":1160,"wires":[["150a5d2bbaa364cb"],[]]},{"id":"76f5eb3278f967cc","type":"stoptimer","z":"60aa8ea9c7477ca7","duration":"15","units":"Second","payloadtype":"num","payloadval":"0","name":"pause","x":1250,"y":1000,"wires":[["75dbf017c224fd09"],[]]},{"id":"e4dc9e91341d1501","type":"switch","z":"60aa8ea9c7477ca7","name":"State Action","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"motion-detected","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":650,"y":1120,"wires":[["7129191bb6e50592","cbaf3a40e2608c9e","fd30a0249ec4d8bb","bfcff2a5a05ac021"],["f69fb8fe41397248"],["2360aa53c5bc0050"]]},{"id":"724e70e51e69be13","type":"state-machine","z":"60aa8ea9c7477ca7","name":"","triggerProperty":"payload","triggerPropertyType":"msg","stateProperty":"payload","statePropertyType":"msg","initialDelay":"0","persistOnReload":false,"outputStateChangeOnly":true,"throwException":false,"states":["off","on","motion-detected","motion-on","switch"],"transitions":[{"name":"motion","from":"off","to":"motion-detected"},{"name":"motion","from":"on","to":"motion-detected"},{"name":"motion-on","from":"switch","to":"motion-detected"},{"name":"motion","from":"switch","to":"motion-detected"},{"name":"off","from":"motion-on","to":"off"},{"name":"off","from":"motion-detected","to":"off"},{"name":"switch","from":"motion-detected","to":"switch"},{"name":"switch","from":"on","to":"switch"},{"name":"switch","from":"switch","to":"switch"},{"name":"switch","from":"off","to":"switch"}],"x":460,"y":1120,"wires":[["e4dc9e91341d1501"]]},{"id":"8eef76d0f029d538","type":"server-state-changed","z":"60aa8ea9c7477ca7","name":"Wasruimte Motion","server":"85cb4144.a30f7","version":4,"exposeToHomeAssistant":true,"haConfig":[{"property":"name","value":"Wasruimte Automation"},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_sensor_wasruimte_any","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"600","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":110,"y":960,"wires":[["724e70e51e69be13"],["c2e188b929199459"]]},{"id":"9e3a50cae752cf85","type":"server-state-changed","z":"60aa8ea9c7477ca7","name":"Wasruimte Lux","server":"85cb4144.a30f7","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.motion_sensor_wasruimte_illuminance","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","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":320,"y":900,"wires":[["efc9859b5785abb5"]]},{"id":"85cb4144.a30f7","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
1 Like

Great, I’m also waiting for FP2 but I have FP1 which also works great. You just have to know how and where to place it in the room because it’s really, really sensitive lol

I’ll take the second automation looks awesome!!! I drop the subject of the amount of light because the room is dark anyway, I don’t measure by the amount of light

1 Like
[
    {
        "id": "0a50bb4c971348c1",
        "type": "trigger-state",
        "z": "fac0de9d0c8c4524",
        "name": "Light Wasruimte",
        "server": "26956a45.92d866",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityid": "light.fan_parents_room",
        "entityidfiltertype": "substring",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "on"
            }
        ],
        "inputs": 1,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": true,
        "x": 2120,
        "y": 1760,
        "wires": [
            [
                "f1ae364149a881d0"
            ],
            []
        ]
    },
    {
        "id": "f1ae364149a881d0",
        "type": "change",
        "z": "fac0de9d0c8c4524",
        "name": "switch",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "switch",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 2290,
        "y": 1760,
        "wires": [
            []
        ]
    },
    {
        "id": "aca5ea5393da9eac",
        "type": "change",
        "z": "fac0de9d0c8c4524",
        "name": "motion",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "motion",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 2570,
        "y": 1660,
        "wires": [
            [
                "5a3bfbd8a41ec670"
            ]
        ]
    },
    {
        "id": "06af96fb6519a8e1",
        "type": "api-current-state",
        "z": "fac0de9d0c8c4524",
        "name": "Light state",
        "server": "26956a45.92d866",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "light.fan_parents_room",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "x": 3090,
        "y": 1840,
        "wires": [
            [
                "b4c9bd976fbe735d"
            ],
            []
        ]
    },
    {
        "id": "c92eee3ee09a835b",
        "type": "change",
        "z": "fac0de9d0c8c4524",
        "name": "motion-on",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "motion-on",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 3780,
        "y": 1660,
        "wires": [
            [
                "b4c9bd976fbe735d"
            ]
        ]
    },
    {
        "id": "5e9df7c8bcda3881",
        "type": "link in",
        "z": "fac0de9d0c8c4524",
        "name": "kitchen state machine",
        "links": [
            "b4c9bd976fbe735d"
        ],
        "x": 2395,
        "y": 1820,
        "wires": [
            [
                "5a3bfbd8a41ec670"
            ]
        ]
    },
    {
        "id": "b4c9bd976fbe735d",
        "type": "link out",
        "z": "fac0de9d0c8c4524",
        "name": "kitchen state machine",
        "links": [
            "5e9df7c8bcda3881"
        ],
        "x": 3725,
        "y": 1780,
        "wires": []
    },
    {
        "id": "56ecbf88670fd986",
        "type": "stoptimer",
        "z": "fac0de9d0c8c4524",
        "duration": "5",
        "units": "Second",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "pause detection",
        "x": 2880,
        "y": 1840,
        "wires": [
            [
                "06af96fb6519a8e1"
            ],
            []
        ]
    },
    {
        "id": "07579efd673df8e7",
        "type": "stoptimer",
        "z": "fac0de9d0c8c4524",
        "duration": "10",
        "units": "Second",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "pause",
        "x": 3090,
        "y": 1760,
        "wires": [
            [
                "06af96fb6519a8e1"
            ],
            []
        ]
    },
    {
        "id": "d650a46cf3e38a5e",
        "type": "stoptimer",
        "z": "fac0de9d0c8c4524",
        "duration": "15",
        "units": "Second",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "pause",
        "x": 3650,
        "y": 1640,
        "wires": [
            [
                "c92eee3ee09a835b"
            ],
            []
        ]
    },
    {
        "id": "c99f3bcc95277bce",
        "type": "switch",
        "z": "fac0de9d0c8c4524",
        "name": "State Action",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "motion-detected",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "off",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "switch",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 2670,
        "y": 1760,
        "wires": [
            [
                "8a12b9b81bb82465"
            ],
            [
                "11cff70e5d36e877"
            ],
            [
                "56ecbf88670fd986"
            ]
        ]
    },
    {
        "id": "5a3bfbd8a41ec670",
        "type": "state-machine",
        "z": "fac0de9d0c8c4524",
        "name": "",
        "triggerProperty": "payload",
        "triggerPropertyType": "msg",
        "stateProperty": "payload",
        "statePropertyType": "msg",
        "outputStateChangeOnly": true,
        "throwException": false,
        "states": [
            "off",
            "on",
            "motion-detected",
            "motion-on",
            "switch"
        ],
        "transitions": [
            {
                "name": "motion",
                "from": "off",
                "to": "motion-detected"
            },
            {
                "name": "motion",
                "from": "on",
                "to": "motion-detected"
            },
            {
                "name": "motion-on",
                "from": "switch",
                "to": "motion-detected"
            },
            {
                "name": "motion",
                "from": "switch",
                "to": "motion-detected"
            },
            {
                "name": "off",
                "from": "motion-on",
                "to": "off"
            },
            {
                "name": "off",
                "from": "motion-detected",
                "to": "off"
            },
            {
                "name": "switch",
                "from": "motion-detected",
                "to": "switch"
            },
            {
                "name": "switch",
                "from": "on",
                "to": "switch"
            },
            {
                "name": "switch",
                "from": "switch",
                "to": "switch"
            },
            {
                "name": "switch",
                "from": "off",
                "to": "switch"
            }
        ],
        "x": 2500,
        "y": 1760,
        "wires": [
            [
                "c99f3bcc95277bce"
            ]
        ]
    },
    {
        "id": "c82df05e5ded5f28",
        "type": "server-state-changed",
        "z": "fac0de9d0c8c4524",
        "name": "Presence mode changes",
        "server": "26956a45.92d866",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "Someone",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": "",
        "forType": "num",
        "forUnits": "seconds",
        "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": 2130,
        "y": 1700,
        "wires": [
            [
                "5a3bfbd8a41ec670",
                "6d770f3d99086b7d"
            ],
            []
        ]
    },
    {
        "id": "6d770f3d99086b7d",
        "type": "api-call-service",
        "z": "fac0de9d0c8c4524",
        "name": "Room Occupancy - On",
        "server": "26956a45.92d866",
        "version": 5,
        "debugenabled": false,
        "domain": "input_boolean",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_boolean.parents_room_occupancy"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 2380,
        "y": 1660,
        "wires": [
            [
                "aca5ea5393da9eac"
            ]
        ]
    },
    {
        "id": "11cff70e5d36e877",
        "type": "api-call-service",
        "z": "fac0de9d0c8c4524",
        "name": "Turn off room light",
        "server": "26956a45.92d866",
        "version": 5,
        "debugenabled": false,
        "domain": "homeassistant",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.fan_parents_room"
        ],
        "data": "",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 2910,
        "y": 1760,
        "wires": [
            [
                "07579efd673df8e7"
            ]
        ]
    },
    {
        "id": "8a12b9b81bb82465",
        "type": "api-current-state",
        "z": "fac0de9d0c8c4524",
        "name": "parents_sleep_mode IS OFF ?",
        "server": "26956a45.92d866",
        "version": 3,
        "outputs": 2,
        "halt_if": "off",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "input_boolean.parents_sleep_mode",
        "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",
        "x": 2910,
        "y": 1700,
        "wires": [
            [
                "bb3d44f95df6cf8e"
            ],
            []
        ]
    },
    {
        "id": "bb3d44f95df6cf8e",
        "type": "api-current-state",
        "z": "fac0de9d0c8c4524",
        "name": "jewish_issur_melacha IS ON ?",
        "server": "26956a45.92d866",
        "version": 3,
        "outputs": 2,
        "halt_if": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "binary_sensor.jewish_calendar_issur_melacha_in_effect",
        "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",
        "x": 2910,
        "y": 1640,
        "wires": [
            [
                "5299c180a187363e"
            ],
            [
                "54b3f6d3a277aede"
            ]
        ]
    },
    {
        "id": "5299c180a187363e",
        "type": "time-range-switch",
        "z": "fac0de9d0c8c4524",
        "name": "Between 8:50- 20:30",
        "lat": "32.0167 ",
        "lon": "34.7667",
        "startTime": "sunrise",
        "endTime": "20:30",
        "startOffset": "170",
        "endOffset": 0,
        "x": 3180,
        "y": 1600,
        "wires": [
            [
                "0435427f62dfd26f"
            ],
            []
        ]
    },
    {
        "id": "54b3f6d3a277aede",
        "type": "time-range-switch",
        "z": "fac0de9d0c8c4524",
        "name": "Between sunrise - 20:30",
        "lat": "32.0167 ",
        "lon": "34.7667",
        "startTime": "sunrise",
        "endTime": "20:30",
        "startOffset": "110",
        "endOffset": 0,
        "x": 3190,
        "y": 1660,
        "wires": [
            [
                "11b88158c9039e78"
            ],
            []
        ]
    },
    {
        "id": "11b88158c9039e78",
        "type": "api-call-service",
        "z": "fac0de9d0c8c4524",
        "name": "Turn on the can lights",
        "server": "26956a45.92d866",
        "version": 5,
        "debugenabled": false,
        "domain": "homeassistant",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.fan_parents_room"
        ],
        "data": "",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 3460,
        "y": 1660,
        "wires": [
            [
                "d650a46cf3e38a5e"
            ]
        ]
    },
    {
        "id": "0435427f62dfd26f",
        "type": "api-call-service",
        "z": "fac0de9d0c8c4524",
        "name": "Turn on the can lights",
        "server": "26956a45.92d866",
        "version": 5,
        "debugenabled": false,
        "domain": "homeassistant",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "light.fan_parents_room"
        ],
        "data": "",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 3440,
        "y": 1600,
        "wires": [
            [
                "d650a46cf3e38a5e"
            ]
        ]
    },
    {
        "id": "26956a45.92d866",
        "type": "server",
        "name": "Hass.io",
        "version": 4,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": 30,
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m"
    }
]

What am I not doing right, or missing?


I did it that way and it doesn’t work