Help Presence Faker in Node Red with Suncron

Hi I am trying to use Presence Faker in Node Red but using the Suncron feature so it only works from Sunset to 23:59

The Presence Faker Module only has a single input, the Example shows the Suncron output feeding into the module.

Question How do you add the vacation Boolean input?

presence-faker

suncron

Regards, Dave

I added a state node prior to the suncron node. When the state of the vacation Boolean changes to On, the suncron node is fired.

EDIT: ops, sorry, I lied! That was the way I handled the faker node without suncron. Iā€™ll be watching for a solution here as well.

This seems to be working for me

Are you able to stop (deactivate) presence faker when the vacation Boolean is turned off?

Iā€™m using a text field as a trigger (Automatic/Manual/House Sitter/Vacation). When the text field evaluates to Vacation, the function passes a true or false to presence faker. When true, suncron messages are acted upon, when false, the node is set inactive. Hereā€™s the flow Iā€™m using. Debug nodes where left intact to aid with deciphering flows.

[{"id":"3064c1e4da03748d","type":"tab","label":"Vacation Lighting","disabled":false,"info":"","env":[]},{"id":"22f34ec4.9d3a22","type":"comment","z":"3064c1e4da03748d","name":"Vacation Lighting","info":"","x":140,"y":80,"wires":[]},{"id":"8234726a0a8aeb8b","type":"presence-faker","z":"3064c1e4da03748d","name":"Dining Room","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.dining","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.dining","windowBegin":"17:00","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"15","minDurationSeconds":0,"minDuration":"4500","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"none","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":410,"y":140,"wires":[["89e3fe975fc80b3e"]]},{"id":"89e3fe975fc80b3e","type":"api-call-service","z":"3064c1e4da03748d","name":"Call Service","server":"fcf9b76b.256a88","version":5,"debugenabled":false,"domain":"homeassistant","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"{}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":690,"y":200,"wires":[[]]},{"id":"b3b8cc883674dbc8","type":"link in","z":"3064c1e4da03748d","name":"Vacation Mode","links":["b47fd13aca9a9d36"],"x":235,"y":140,"wires":[["8234726a0a8aeb8b","e275f646cae085ee","a67f71989a8adc2a","5f8d5646.1c9208","8db08b64.688498","8eaef87f59cd0739"]]},{"id":"e275f646cae085ee","type":"presence-faker","z":"3064c1e4da03748d","name":"Kitchen Island","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.kitchen_island","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.kitchen_island","windowBegin":"17:00","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"45","minDurationSeconds":0,"minDuration":"6300","maxDurationHours":"2","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"7800","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"none","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":420,"y":200,"wires":[["89e3fe975fc80b3e"]]},{"id":"a67f71989a8adc2a","type":"presence-faker","z":"3064c1e4da03748d","name":"Kitchen Pots","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.kitchen_pot_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.kitchen_pot_lights","windowBegin":"18:30","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"30","minDurationSeconds":0,"minDuration":"5400","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"none","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":410,"y":260,"wires":[["89e3fe975fc80b3e"]]},{"id":"8db08b64.688498","type":"presence-faker","z":"3064c1e4da03748d","name":"","onPayload":"ON","onPayloadType":"str","onTopic":"","offPayload":"OFF","offPayloadType":"str","offTopic":"","windowBegin":"08:00","windowEnd":"09:00","minDurationHours":0,"minDurationMinutes":"2","minDurationSeconds":0,"minDuration":"120","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":0,"maxDuration":"300","minCount":"2","maxCount":"5","startupBehavior":"onStartup","actionOnDisable":"none","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":840,"y":440,"wires":[["472dd6f5346e9612"]]},{"id":"5f8d5646.1c9208","type":"suncron","z":"3064c1e4da03748d","name":"","lat":"89.9999978","lon":"-135.0000000","replay":false,"ejectScheduleOnUpdate":true,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":440,"y":440,"wires":[["d2acfb9f.e06f98","b901e9f2b2df66bb","d218ef23e2f78e13"]]},{"id":"d2acfb9f.e06f98","type":"function","z":"3064c1e4da03748d","name":"PF config","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunrise'\nconst windowEndEvent = 'sunset'\n\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\nconst windowEnd = msg.payload[windowEndEvent].cronTime.substring(11)\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":440,"wires":[["e810fc0f.7778d","8db08b64.688498","1e6193f549c9b935"]]},{"id":"e810fc0f.7778d","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.windowBegin","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":340,"wires":[]},{"id":"472dd6f5346e9612","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1070,"y":440,"wires":[]},{"id":"b901e9f2b2df66bb","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":340,"wires":[]},{"id":"1e6193f549c9b935","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.windowEnd","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":400,"wires":[]},{"id":"9c542f26680edf65","type":"server-state-changed","z":"3064c1e4da03748d","name":"Listen For Control Mode Change","server":"fcf9b76b.256a88","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select.control_mode","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","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"}],"x":210,"y":440,"wires":[["80dba302897ddb5f","63403d56989f8c38","5f8d5646.1c9208"]],"outputLabels":["Automatic"],"info":"Listen For Control Mode Change"},{"id":"80dba302897ddb5f","type":"function","z":"3064c1e4da03748d","name":"","func":"if(msg.payload == \"Vacation\")\n{\n    msg.payload=\"true\";\n    return [msg];}\nelse{\n    msg.payload=\"false\";\n    return [msg];}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":800,"wires":[["5e34b424562939a1","8db08b64.688498","8eaef87f59cd0739"]]},{"id":"5e34b424562939a1","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":800,"wires":[]},{"id":"63403d56989f8c38","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":640,"wires":[]},{"id":"d218ef23e2f78e13","type":"function","z":"3064c1e4da03748d","name":"PF config","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunset'\n\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nreturn {\n    payload: {\n      windowBegin\n    }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":500,"wires":[["c59cac5debb276af","7cea2ad13a160f64","8eaef87f59cd0739"]]},{"id":"c59cac5debb276af","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.windowBegin","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":560,"wires":[]},{"id":"7cea2ad13a160f64","type":"debug","z":"3064c1e4da03748d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.windowEnd","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":620,"wires":[]},{"id":"8eaef87f59cd0739","type":"presence-faker","z":"3064c1e4da03748d","name":"","onPayload":"ON","onPayloadType":"str","onTopic":"","offPayload":"OFF","offPayloadType":"str","offTopic":"","windowBegin":"08:00","windowEnd":"21:00","minDurationHours":0,"minDurationMinutes":"2","minDurationSeconds":0,"minDuration":"120","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":0,"maxDuration":"300","minCount":"2","maxCount":"5","startupBehavior":"onStartup","actionOnDisable":"none","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":840,"y":500,"wires":[[]]},{"id":"fcf9b76b.256a88","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

Yes, Presence faker is looking for a True or False statement, so using a change node to change from on off to true false.

Worked ok last night, here is my flow, need to put in your own Long Lat in Suncron.

Not done much with node red so there maybe some shortcuts that can be done.

[{"id":"a1774f76.0cb69","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2349eb2db35f76ca","type":"presence-faker","z":"a1774f76.0cb69","name":"Office Light Faker","onPayload":"on","onPayloadType":"str","onTopic":"on","offPayload":"off","offPayloadType":"str","offTopic":"off","windowBegin":"09:30","windowEnd":"23:59","minDurationHours":0,"minDurationMinutes":"5","minDurationSeconds":0,"minDuration":"300","maxDurationHours":0,"maxDurationMinutes":"30","maxDurationSeconds":0,"maxDuration":"1800","minCount":"2","maxCount":"6","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"on","lastBlockType":"off","isLoggingEnabled":false,"x":630,"y":360,"wires":[["ecdb325c1ad65130"]]},{"id":"d2acfb9f.e06f98","type":"function","z":"a1774f76.0cb69","name":"PF config","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunset'\nconst windowEndEvent = 'sunset'\n\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\n\nreturn {\n    payload: {\n      windowBegin\n    }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":660,"wires":[["2349eb2db35f76ca"]]},{"id":"5f8d5646.1c9208","type":"suncron","z":"a1774f76.0cb69","name":"","lat":"0","lon":"0","replay":false,"ejectScheduleOnUpdate":true,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":"-1","sunsetOffsetHours":"0","sunsetOffsetMinutes":"0","sunsetOffset":"0","duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":260,"y":660,"wires":[["d2acfb9f.e06f98"]]},{"id":"1d196d049c822625","type":"server-state-changed","z":"a1774f76.0cb69","name":"Away Lights Random Mode","server":"659eca85f428414e","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.lights_away_random","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"1","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":200,"y":440,"wires":[["7c2fb603.bd9348"]]},{"id":"7c2fb603.bd9348","type":"change","z":"a1774f76.0cb69","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":90,"wires":[["2349eb2db35f76ca"]]},{"id":"006b01541d5e3da5","type":"api-call-service","z":"a1774f76.0cb69","name":"Phil Light On","server":"659eca85f428414e","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.philips"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":560,"wires":[[]]},{"id":"b05c3246bc413dfd","type":"api-call-service","z":"a1774f76.0cb69","name":"Phil Light Off","server":"659eca85f428414e","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.philips"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":660,"wires":[[]]},{"id":"ecdb325c1ad65130","type":"switch","z":"a1774f76.0cb69","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":730,"y":520,"wires":[["006b01541d5e3da5"],["b05c3246bc413dfd"]]},{"id":"659eca85f428414e","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

Nice idea!

I downloaded your code to see how it works. Thanks for posting. Hereā€™s a cleaned up version of my code.

[{"id":"8234726a0a8aeb8b","type":"presence-faker","z":"3064c1e4da03748d","name":"Dining Room","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.dining","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.dining","windowBegin":"17:00","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"15","minDurationSeconds":0,"minDuration":"4500","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":870,"y":140,"wires":[["89e3fe975fc80b3e"]]},{"id":"89e3fe975fc80b3e","type":"api-call-service","z":"3064c1e4da03748d","name":"Call Service","server":"fcf9b76b.256a88","version":5,"debugenabled":false,"domain":"homeassistant","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"{}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1090,"y":200,"wires":[[]]},{"id":"e275f646cae085ee","type":"presence-faker","z":"3064c1e4da03748d","name":"Kitchen Island","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.kitchen_island","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.kitchen_island","windowBegin":"17:00","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"45","minDurationSeconds":0,"minDuration":"6300","maxDurationHours":"2","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"7800","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":880,"y":200,"wires":[["89e3fe975fc80b3e"]]},{"id":"a67f71989a8adc2a","type":"presence-faker","z":"3064c1e4da03748d","name":"Kitchen Pots","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.kitchen_pot_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.kitchen_pot_lights","windowBegin":"18:30","windowEnd":"20:30","minDurationHours":"1","minDurationMinutes":"30","minDurationSeconds":0,"minDuration":"5400","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":1,"startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":870,"y":260,"wires":[["89e3fe975fc80b3e"]]},{"id":"5f8d5646.1c9208","type":"suncron","z":"3064c1e4da03748d","name":"","lat":"84.9999978","lon":"-135.000533","replay":false,"ejectScheduleOnUpdate":true,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":360,"y":300,"wires":[["d2acfb9f.e06f98","d218ef23e2f78e13","48ed18acc78c230d"]]},{"id":"d2acfb9f.e06f98","type":"function","z":"3064c1e4da03748d","name":"PF config - Dining Room","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunset'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"19:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":300,"wires":[["8234726a0a8aeb8b"]]},{"id":"d218ef23e2f78e13","type":"function","z":"3064c1e4da03748d","name":"PF config - Kitchen Island","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunset'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"20:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":340,"wires":[["e275f646cae085ee"]]},{"id":"48ed18acc78c230d","type":"function","z":"3064c1e4da03748d","name":"PF config - Kitchen Island","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunset'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"20:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":380,"wires":[["a67f71989a8adc2a"]]},{"id":"f70ac3fdc2fb0906","type":"link in","z":"3064c1e4da03748d","name":"","links":["b47fd13aca9a9d36"],"x":225,"y":140,"wires":[["8234726a0a8aeb8b","e275f646cae085ee","a67f71989a8adc2a","5f8d5646.1c9208"]]},{"id":"fcf9b76b.256a88","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

A different flow evaluates a ā€œControl Modeā€ (Automatic/Manual/House Sitter/Vacation). If itā€™s set to Vacation a true state is passed to this flow via the ā€œLink Inā€, enabling presence faker. If set to any other condition, a false state is sent to this flow via the ā€œLink Inā€, disabling presence faker.

Iā€™m also battling with the combination of:

  • Vacation mode helper, just a manual switch
  • Suncron, to make sure the lights only turn on after sunset
  • Presence faker, to have 1 light randomly turn on after SUNCRON sunset and fixed end time

Iā€™ve read so many post, but I think I must have a shortcut in my brains :slight_smile:

What I have so far

[{"id":"56bade6e6032ed4a","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"a41d9b31.610738","type":"debug","z":"56bade6e6032ed4a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1070,"y":320,"wires":[]},{"id":"8bbde663.b0b528","type":"api-call-service","z":"56bade6e6032ed4a","name":"Toggle","server":"f401242c.86dbe8","version":5,"debugenabled":true,"domain":"homeassistant","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":890,"y":320,"wires":[["a41d9b31.610738"]]},{"id":"aedd9ffc.64eb2","type":"presence-faker","z":"56bade6e6032ed4a","name":"switch.0xa4c13865e61d6050 (1)","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.0xa4c13865e61d6050","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.0xa4c13865e61d6050","windowBegin":"17:30","windowEnd":"23:00","minDurationHours":0,"minDurationMinutes":"15","minDurationSeconds":"15","minDuration":"915","maxDurationHours":"2","maxDurationMinutes":"2","maxDurationSeconds":"2","maxDuration":"7322","minCount":"1","maxCount":"5","startupBehavior":"onMsg","actionOnDisable":"none","isLoggingEnabled":false,"x":640,"y":320,"wires":[["8bbde663.b0b528"]]},{"id":"78b2abf.6fe9754","type":"server-state-changed","z":"56bade6e6032ed4a","name":"Check Vacation","server":"f401242c.86dbe8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.vacationmode","entityidfiltertype":"exact","outputinitially":true,"state_type":"habool","haltifstate":"","halt_if_type":"str","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":140,"y":320,"wires":[["2c0b2f4bb28712b0"]]},{"id":"2c0b2f4bb28712b0","type":"suncron","z":"56bade6e6032ed4a","name":"","lat":"52.378649","lon":"5.182449","replay":false,"ejectScheduleOnUpdate":true,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":360,"y":320,"wires":[["aedd9ffc.64eb2"]]},{"id":"f401242c.86dbe8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

Could somebody please assist?

1 Like

Iā€™m willing to have a look for you but your posted code needs to be formatted using a code block before Iā€™m able to copy it.

Finally figured out how to use the code :upside_down_face:, so see my initial post

@DaSuperGrover

Iā€™ve copied your code to my instance on Node Red so that I may look at later today. One thing I noticed straight away is the absence of a command to initiate the Presence Faker node. There should be a link from the output of the Check Vacation node to the input of the Faker node. This link will control when the node should be active. True for active and False for inactive.

I am really not that familiar with Node Red.

Now the longer nights are here I feel this if you are using Sunset as your start time you really could do with more On & Offā€™s throughout your total period.

In the document there is a Dynamic Configuration avaliable

{
    "windowBegin": "00:00",
    "windowEnd": "23:59:59",
    "minDuration": 60,
    "maxDuration": 600,
    "minCount": 10,
    "maxCount": 25
}

Not sure how I feed that into the Presense Faker Module?

Any help appriciated.

Re Dave

my presence faker works, BUT it leaves all the light ON at the end.
Any idea how to solve that?

In the Presence Faker node, change the ā€œlast blockā€ setting to ā€œOFF messageā€ if you want everything off.

Thanks @doctorkb that works for me!

Now I have a next question.
I have a flag that trigger the presence faker called ā€œsimulation lightsā€
When this is ON, the flow starts
This works
But, when I am on vacation and the simulation_lights I leave it ON, at night the process of presence faker starts perfect, but when it ends with a text " cycle completed"
So, I needs to turn off and turn on again the smilutation_lights flag so it works agian at night

How can I fix this?
Thanks
Here is the code

[{"id":"5e526835.c7bad8","type":"tab","label":"Simulation LIghts","disabled":false,"info":""},{"id":"198d6a70.3b0876","type":"presence-faker","z":"5e526835.c7bad8","name":"Living","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.luz_living","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.luz_living","windowBegin":"18:30","windowEnd":"23:45","minDurationHours":0,"minDurationMinutes":"1","minDurationSeconds":"5","minDuration":"65","maxDurationHours":0,"maxDurationMinutes":"7","maxDurationSeconds":"10","maxDuration":"430","minCount":1,"maxCount":"5","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":80,"wires":[["62b8938c.36298c"]]},{"id":"62b8938c.36298c","type":"api-call-service","z":"5e526835.c7bad8","name":"","server":"7955c4ca.4bf5fc","version":5,"debugenabled":false,"domain":"homeassistant","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","output_location":"topic","output_location_type":"msg","x":780,"y":160,"wires":[[]]},{"id":"5c53b535.e813dc","type":"presence-faker","z":"5e526835.c7bad8","name":"Foco jardĆ­n ","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.foco_jardin_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.foco_jardin_2","windowBegin":"20:00","windowEnd":"23:50","minDurationHours":0,"minDurationMinutes":"5","minDurationSeconds":"5","minDuration":"305","maxDurationHours":0,"maxDurationMinutes":"15","maxDurationSeconds":"10","maxDuration":"910","minCount":1,"maxCount":"7","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":410,"y":140,"wires":[["62b8938c.36298c"]]},{"id":"19104253.fea67e","type":"presence-faker","z":"5e526835.c7bad8","name":"Master Room","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.master_room","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.master_room","windowBegin":"19:30","windowEnd":"23:45","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"15","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":420,"y":220,"wires":[["62b8938c.36298c"]]},{"id":"6c94472.0d711b8","type":"presence-faker","z":"5e526835.c7bad8","name":"Comedor","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.comedor_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.comedor_2","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"15","maxDurationSeconds":"10","maxDuration":"910","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":400,"y":280,"wires":[["62b8938c.36298c"]]},{"id":"b4c7f71c.858738","type":"server-state-changed","z":"5e526835.c7bad8","name":"Simulation","server":"7955c4ca.4bf5fc","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.simulation_lights","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"","halt_if_type":"str","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":120,"y":280,"wires":[["198d6a70.3b0876","5c53b535.e813dc","19104253.fea67e","6c94472.0d711b8","2db9bad6.361376","5e9d6303.07a06c","7e0faeed.03c64","23e04710.c44048","38439a65.2058e6","4b6dcff2.fa37b","df13cfb2411d4141","81110a7de3a8a47b","1a9910db5d2f173e"]]},{"id":"2db9bad6.361376","type":"presence-faker","z":"5e526835.c7bad8","name":"Salva","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.luz_salvador_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.luz_salvador_2","windowBegin":"19:30","windowEnd":"23:10","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":340,"wires":[["62b8938c.36298c"]]},{"id":"5e9d6303.07a06c","type":"presence-faker","z":"5e526835.c7bad8","name":"Guille","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.luz_guillermo","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.luz_guillermo","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":400,"wires":[["62b8938c.36298c"]]},{"id":"7e0faeed.03c64","type":"presence-faker","z":"5e526835.c7bad8","name":"Bano","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.bano_techo","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.bano_techo","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":460,"wires":[["62b8938c.36298c"]]},{"id":"23e04710.c44048","type":"presence-faker","z":"5e526835.c7bad8","name":"Pasillo","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.luz_pasillo_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.luz_pasillo_2","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":520,"wires":[["62b8938c.36298c"]]},{"id":"38439a65.2058e6","type":"presence-faker","z":"5e526835.c7bad8","name":"Downlights Cocina","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.downlights_cocina","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.downlights_cocina","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":410,"y":640,"wires":[["62b8938c.36298c"]]},{"id":"4b6dcff2.fa37b","type":"presence-faker","z":"5e526835.c7bad8","name":"Studio","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.studio_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.studio_2","windowBegin":"19:30","windowEnd":"23:30","minDurationHours":0,"minDurationMinutes":"3","minDurationSeconds":"5","minDuration":"185","maxDurationHours":0,"maxDurationMinutes":"5","maxDurationSeconds":"10","maxDuration":"310","minCount":1,"maxCount":"10","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":390,"y":580,"wires":[["62b8938c.36298c"]]},{"id":"df13cfb2411d4141","type":"presence-faker","z":"5e526835.c7bad8","name":"Pasillo OverNight","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.luz_pasillo_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.luz_pasillo_2","windowBegin":"00:01","windowEnd":"05:00","minDurationHours":0,"minDurationMinutes":"1","minDurationSeconds":"5","minDuration":"65","maxDurationHours":0,"maxDurationMinutes":"3","maxDurationSeconds":"10","maxDuration":"190","minCount":1,"maxCount":"30","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":430,"y":720,"wires":[["62b8938c.36298c"]]},{"id":"81110a7de3a8a47b","type":"presence-faker","z":"5e526835.c7bad8","name":"Master Room OverNight","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.master_room","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.master_room","windowBegin":"00:01","windowEnd":"04:45","minDurationHours":0,"minDurationMinutes":"1","minDurationSeconds":"5","minDuration":"65","maxDurationHours":0,"maxDurationMinutes":"3","maxDurationSeconds":"10","maxDuration":"190","minCount":1,"maxCount":"20","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":450,"y":780,"wires":[["62b8938c.36298c"]]},{"id":"1a9910db5d2f173e","type":"presence-faker","z":"5e526835.c7bad8","name":"Foco jardĆ­n OverNight","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.foco_jardin_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.foco_jardin_2","windowBegin":"00:01","windowEnd":"05:00","minDurationHours":0,"minDurationMinutes":"2","minDurationSeconds":"5","minDuration":"125","maxDurationHours":0,"maxDurationMinutes":"10","maxDurationSeconds":"10","maxDuration":"610","minCount":1,"maxCount":"40","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":440,"y":840,"wires":[["62b8938c.36298c"]]},{"id":"7955c4ca.4bf5fc","type":"server","name":"Home Assistant","version":4,"addon":false,"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"}]

Have you tried leaving it for a second night to see what happens? I understood it would come back on the next day.

I am confused by my flow trying to use presence faker, suncron in conjunction with a vacation node (that I have not seen work).


[{"id":"a8b4155bf4cfa5fd","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Kitchen Island ","onPayload":"turn_on","onPayloadType":"str","onTopic":"switch.kitchen_island_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"switch.kitchen_island_lights","windowBegin":"08:00","windowEnd":"20:30","minDurationHours":"0","minDurationMinutes":"10","minDurationSeconds":0,"minDuration":"600","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":880,"y":520,"wires":[["3579cf70db501432","8b7fc858299e6688"]]},{"id":"3579cf70db501432","type":"api-call-service","z":"3dec4f5f10a1bb49","name":"Call Service","server":"6e751b1b.8f17c4","version":5,"debugenabled":false,"domain":"homeassistant","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"{}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":560,"wires":[["cd962343eebc344e","9f432d9334f0289c"]]},{"id":"74327f2921f9480e","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Lower Chandelier","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.lower_entryway_chandelier_3","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.lower_entryway_chandelier_3","windowBegin":"11:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"5","minDurationSeconds":0,"minDuration":"300","maxDurationHours":"1","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"4200","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":750,"y":620,"wires":[["3579cf70db501432"]]},{"id":"576c7ea5ccadcbe8","type":"function","z":"3dec4f5f10a1bb49","name":"PF config - Kitchen ","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunrise'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"20:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":520,"wires":[["6022393aa4f6014f","a8b4155bf4cfa5fd","28ab98ad27b547ee"]]},{"id":"37c7a760ca6cadcf","type":"function","z":"3dec4f5f10a1bb49","name":"PF config - Downstairs","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunrise'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"22:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":620,"wires":[["74327f2921f9480e","ed399f0b9367285e","f94b2ab8ae85119e","3cff8395c3fcf285","6a3c7b75d1b806a9"]]},{"id":"115d67975fb0c566","type":"function","z":"3dec4f5f10a1bb49","name":"PF config - Upstairs","func":"if (msg.topic != 'suncron:schedule') {\n    return\n}\n\nconst windowBeginEvent = 'sunrise'\nconst windowBegin = msg.payload[windowBeginEvent].cronTime.substring(11)\n\nconst windowEnd = \"23:45\"\n\nreturn {\n    payload: {\n      windowBegin,\n      windowEnd\n    }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":940,"wires":[["50393b11cc4e52dd","6866f2a42e7067b7","4ab76bf10974bef2","0401a6d3fce16e89"]]},{"id":"a89967a256e7dc57","type":"suncron","z":"3dec4f5f10a1bb49","name":"","lat":"26.35","lon":"-80.20","replay":false,"ejectScheduleOnUpdate":true,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":220,"y":460,"wires":[["576c7ea5ccadcbe8","37c7a760ca6cadcf","115d67975fb0c566","3b77f3cf9f4b9a8b"]]},{"id":"6022393aa4f6014f","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Kitchen Table ","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.kitchen_table_light_2","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.kitchen_table_light_2","windowBegin":"08:00","windowEnd":"20:30","minDurationHours":"0","minDurationMinutes":"10","minDurationSeconds":0,"minDuration":"600","maxDurationHours":"1","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"6600","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":880,"y":480,"wires":[["3579cf70db501432","cbedafe89a3d3f9c"]]},{"id":"ed399f0b9367285e","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Family Room Chandelier","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.family_room_main_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.family_room_main_lights","windowBegin":"08:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"15","minDurationSeconds":0,"minDuration":"900","maxDurationHours":"2","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"7800","minCount":1,"maxCount":"3","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":770,"y":580,"wires":[[]]},{"id":"f94b2ab8ae85119e","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Garage Light","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.garage_flourescent_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.garage_flourescent_lights","windowBegin":"17:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"2","minDurationSeconds":0,"minDuration":"120","maxDurationHours":"0","maxDurationMinutes":"4","maxDurationSeconds":0,"maxDuration":"240","minCount":1,"maxCount":"8","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":730,"y":660,"wires":[["3579cf70db501432"]]},{"id":"3cff8395c3fcf285","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Matthew Light","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.matthews_overhead_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.matthews_overhead_lights","windowBegin":"11:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"5","minDurationSeconds":0,"minDuration":"300","maxDurationHours":"1","maxDurationMinutes":"2","maxDurationSeconds":0,"maxDuration":"3720","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":740,"y":700,"wires":[["3579cf70db501432"]]},{"id":"6a3c7b75d1b806a9","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"LIving Room Light","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.living_room_main_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.living_room_main_lights","windowBegin":"09:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"15","minDurationSeconds":0,"minDuration":"900","maxDurationHours":"0","maxDurationMinutes":"50","maxDurationSeconds":0,"maxDuration":"3000","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":750,"y":740,"wires":[["3579cf70db501432"]]},{"id":"6866f2a42e7067b7","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Master Bathroom","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.master_bathroom","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.master_bathroom","windowBegin":"10:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"5","minDurationSeconds":0,"minDuration":"300","maxDurationHours":"1","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"4200","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":770,"y":900,"wires":[[]]},{"id":"50393b11cc4e52dd","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Jonathan's Room","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.jonathans_room_main_lights","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.jonathans_room_main_lights","windowBegin":"09:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"15","minDurationSeconds":0,"minDuration":"900","maxDurationHours":"2","maxDurationMinutes":"10","maxDurationSeconds":0,"maxDuration":"7800","minCount":1,"maxCount":"3","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":770,"y":860,"wires":[["3579cf70db501432"]]},{"id":"4ab76bf10974bef2","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Master Bedroom","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.master_bedroom","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.master_bedroom","windowBegin":"11:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"2","minDurationSeconds":0,"minDuration":"120","maxDurationHours":"0","maxDurationMinutes":"4","maxDurationSeconds":0,"maxDuration":"240","minCount":1,"maxCount":"8","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":770,"y":940,"wires":[["3579cf70db501432"]]},{"id":"0401a6d3fce16e89","type":"presence-faker","z":"3dec4f5f10a1bb49","name":"Olivias Room","onPayload":"turn_on","onPayloadType":"str","onTopic":"light.olivias_overhead_light","offPayload":"turn_off","offPayloadType":"str","offTopic":"light.olivias_overhead_light","windowBegin":"10:00","windowEnd":"21:30","minDurationHours":"0","minDurationMinutes":"5","minDurationSeconds":0,"minDuration":"300","maxDurationHours":"1","maxDurationMinutes":"2","maxDurationSeconds":0,"maxDuration":"3720","minCount":1,"maxCount":"4","startupBehavior":"onMsg","actionOnDisable":"off","firstBlockType":"off","lastBlockType":"off","isLoggingEnabled":false,"x":750,"y":980,"wires":[["3579cf70db501432"]]},{"id":"cd962343eebc344e","type":"api-call-service","z":"3dec4f5f10a1bb49","name":"What went on and off","server":"6e751b1b.8f17c4","version":5,"debugenabled":false,"domain":"notify","service":"all_iphones","areaId":[],"deviceId":[],"entityId":[],"data":"{\t   \"message\":\"{{topic}} is {{payload}}\"\t}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1288,"y":559,"wires":[["403976750098ad79"]]},{"id":"30f384d50fbb3a48","type":"server-state-changed","z":"3dec4f5f10a1bb49","name":"Vacation Mode","server":"6e751b1b.8f17c4","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"input_select.mode","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"Vacation","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":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":180,"y":140,"wires":[["a89967a256e7dc57"],[]]},{"id":"3b77f3cf9f4b9a8b","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 78","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":360,"wires":[]},{"id":"28ab98ad27b547ee","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 79","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":440,"wires":[]},{"id":"cbedafe89a3d3f9c","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 80","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":440,"wires":[]},{"id":"8b7fc858299e6688","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 81","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":500,"wires":[]},{"id":"9f432d9334f0289c","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 82","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1100,"y":620,"wires":[]},{"id":"403976750098ad79","type":"debug","z":"3dec4f5f10a1bb49","name":"debug 83","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1400,"y":500,"wires":[]},{"id":"351a7ec124030c5b","type":"inject","z":"3dec4f5f10a1bb49","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":130,"y":260,"wires":[["576c7ea5ccadcbe8"]]},{"id":"6e751b1b.8f17c4","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}]

The challenge I have is that I see no logs other than the suncron log telling me it is after sunrise. I would expect other logs.

Also, the presence faker node shows ā€˜inactive upon loadā€™.

I would think just because I am at WindowBegin or Window end, I would still need to send ā€˜Trueā€™ to the Presence Faker Node.