I don’t think it’s as easy as it seems to be. Power can keep going up and down during that 10 seconds and it seems like what you want is to only turn off the switch if power remains below 1000 for 10 seconds.
Here’s my take. I’m using a trigger to check if power is < 1000 for 10 seconds. If it becomes >= 1000 during the 10 seconds, it triggers the timer to reset. I have not run it so I’m not sure if it’s bug free. As with most programs, there can be several ways to do it and I might be complicating things.
[
{
"id":"fec74566.96bb68",
"type":"tab",
"label":"Fersi",
"disabled":false,
"info":""
},
{
"id":"470e5d3a.99835c",
"type":"server-state-changed",
"z":"fec74566.96bb68",
"name":"Fersi Power",
"server":"9b0e1469.366258",
"entityidfilter":"sensor.fresi_power",
"entityidfiltertype":"exact",
"haltifstate":"",
"x":70,
"y":160,
"wires":[
[
"6e66cc5c.870b64"
]
],
"outputLabels":[
"states.sensor.fresi_power.state"
]
},
{
"id":"c2a84a4f.d16f48",
"type":"trigger",
"z":"fec74566.96bb68",
"op1":"",
"op2":"OFF",
"op1type":"nul",
"op2type":"str",
"duration":"10",
"extend":false,
"units":"s",
"reset":"ON",
"bytopic":"all",
"name":"",
"x":430,
"y":120,
"wires":[
[
"b198ad3c.0521f"
]
]
},
{
"id":"6e66cc5c.870b64",
"type":"switch",
"z":"fec74566.96bb68",
"name":"< 1000",
"property":"payload",
"propertyType":"msg",
"rules":[
{
"t":"lt",
"v":"1000",
"vt":"num"
},
{
"t":"gte",
"v":"1000",
"vt":"num"
}
],
"checkall":"true",
"repair":false,
"outputs":2,
"x":230,
"y":160,
"wires":[
[
"c2a84a4f.d16f48"
],
[
"ebd13d76.282bf",
"c2a84a4f.d16f48"
]
],
"outputLabels":[
"OFF",
"ON"
]
},
{
"id":"e5236dfc.90ac38",
"type":"api-call-service",
"z":"fec74566.96bb68",
"name":"Switch Off",
"server":"9b0e1469.366258",
"service_domain":"switch",
"service":"turn_off",
"data":"{ \"entity_id\": \"switch.fresi\" }",
"mergecontext":"",
"x":890,
"y":120,
"wires":[
[
]
]
},
{
"id":"ebd13d76.282bf",
"type":"rbe",
"z":"fec74566.96bb68",
"name":"",
"func":"rbe",
"gap":"",
"start":"",
"inout":"out",
"property":"payload",
"x":590,
"y":200,
"wires":[
[
"8ff66e91.89a088"
]
]
},
{
"id":"8ff66e91.89a088",
"type":"api-call-service",
"z":"fec74566.96bb68",
"name":"Switch On",
"server":"9b0e1469.366258",
"service_domain":"switch",
"service":"turn_on",
"data":"{ \"entity_id\": \"switch.fresi\" }",
"mergecontext":"",
"x":890,
"y":200,
"wires":[
[
]
]
},
{
"id":"b198ad3c.0521f",
"type":"rbe",
"z":"fec74566.96bb68",
"name":"",
"func":"rbe",
"gap":"",
"start":"",
"inout":"out",
"property":"payload",
"x":590,
"y":120,
"wires":[
[
"9e85430e.0c891"
]
]
},
{
"id":"9e85430e.0c891",
"type":"switch",
"z":"fec74566.96bb68",
"name":"Off",
"property":"payload",
"propertyType":"msg",
"rules":[
{
"t":"eq",
"v":"OFF",
"vt":"str"
}
],
"checkall":"true",
"repair":false,
"outputs":1,
"x":730,
"y":120,
"wires":[
[
"e5236dfc.90ac38"
]
]
}
]