Let’s say we have something like this:
[
{
"id":"4cc8580d.e4c528",
"type":"tab",
"label":"Flow 2",
"disabled":false,
"info":""
},
{
"id":"553aeb15.6cc8b4",
"type":"trigger-state",
"z":"4cc8580d.e4c528",
"name":"",
"server":"4bbca37b.1700ec",
"exposeToHomeAssistant":false,
"haConfig":[
{
"property":"name",
"value":""
},
{
"property":"icon",
"value":""
}
],
"entityid":"light.sonoff_1000a2f786",
"entityidfiltertype":"exact",
"debugenabled":false,
"constraints":[
{
"id":"qrda6lya809",
"targetType":"this_entity",
"targetValue":"",
"propertyType":"current_state",
"propertyValue":"new_state.state",
"comparatorType":"is",
"comparatorValueDatatype":"str",
"comparatorValue":"on"
}
],
"constraintsmustmatch":"all",
"outputs":2,
"customoutputs":[
],
"outputinitially":false,
"state_type":"str",
"x":190,
"y":120,
"wires":[
[
"1a6d6956.8a2457"
],
[
"1a6d6956.8a2457"
]
]
},
{
"id":"1a6d6956.8a2457",
"type":"delay",
"z":"4cc8580d.e4c528",
"name":"",
"pauseType":"delay",
"timeout":"2",
"timeoutUnits":"seconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":440,
"y":140,
"wires":[
[
"68c61b29.e1f914"
]
]
},
{
"id":"68c61b29.e1f914",
"type":"api-call-service",
"z":"4cc8580d.e4c528",
"name":"",
"server":"4bbca37b.1700ec",
"version":1,
"debugenabled":false,
"service_domain":"light",
"service":"turn_off",
"entityId":"light.sonoff_1000a2f786",
"data":"",
"dataType":"json",
"mergecontext":"",
"output_location":"",
"output_location_type":"none",
"mustacheAltTags":false,
"x":610,
"y":140,
"wires":[
[
"4f67dc9c.8b2f54"
]
]
},
{
"id":"4f67dc9c.8b2f54",
"type":"delay",
"z":"4cc8580d.e4c528",
"name":"",
"pauseType":"delay",
"timeout":"2",
"timeoutUnits":"seconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":780,
"y":140,
"wires":[
[
"f338f501.4e65d8"
]
]
},
{
"id":"f338f501.4e65d8",
"type":"api-call-service",
"z":"4cc8580d.e4c528",
"name":"",
"server":"4bbca37b.1700ec",
"version":1,
"debugenabled":false,
"service_domain":"light",
"service":"turn_on",
"entityId":"light.sonoff_1000a2f786",
"data":"",
"dataType":"json",
"mergecontext":"",
"output_location":"",
"output_location_type":"none",
"mustacheAltTags":false,
"x":950,
"y":140,
"wires":[
[
]
]
},
{
"id":"70c8d0c3.ce3e",
"type":"inject",
"z":"4cc8580d.e4c528",
"name":"",
"topic":"",
"payload":"",
"payloadType":"date",
"repeat":"",
"crontab":"",
"once":false,
"onceDelay":0.1,
"x":260,
"y":180,
"wires":[
[
"1a6d6956.8a2457"
]
]
},
{
"id":"4bbca37b.1700ec",
"type":"server",
"z":"",
"name":"Home Assistant",
"addon":true
}
]
So it’s triggered on the light state change, and in the flow it changes the state.
This becomes a never ending flickering of the light on and off. The only way out is to deploy a new flow without the connection to the service calls.
But what would be the method to have this kind of setup but limit the flow to only run once at the same time?
Meaning it will do the flow and not repeat itself. But the next time I flick the switch one minute later it will do the flow again.
So it can run several times a day but not more than once at the same time.