Bonjour à tous,
Je souhaiterai faire un automatisme qui après l’apparition d’un évènement et un délais, fasse une action. Mais si avant la fin du délais, l’évènement est acquitté, alors, on exécute pas l’action.
[
{
"id": "e007dabf7f16b72e",
"type": "delay",
"z": "0f0bc6be16894600",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 520,
"y": 660,
"wires": [
[
"4bd26851dfefc06e"
]
]
},
{
"id": "3722250f845e1ba6",
"type": "inject",
"z": "0f0bc6be16894600",
"name": "true",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 210,
"y": 660,
"wires": [
[
"d5937576b2508b68"
]
]
},
{
"id": "20d63c98583c5e8d",
"type": "inject",
"z": "0f0bc6be16894600",
"name": "false",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "false",
"payloadType": "bool",
"x": 210,
"y": 780,
"wires": [
[
"d5937576b2508b68"
]
]
},
{
"id": "d5937576b2508b68",
"type": "switch",
"z": "0f0bc6be16894600",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 370,
"y": 720,
"wires": [
[
"e007dabf7f16b72e"
],
[
"c06f8d96ced1bb5d"
]
]
},
{
"id": "4bd26851dfefc06e",
"type": "api-call-service",
"z": "0f0bc6be16894600",
"name": "",
"server": "9bf5a907952a79de",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"switch.sortie_05"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 700,
"y": 660,
"wires": [
[]
]
},
{
"id": "c06f8d96ced1bb5d",
"type": "api-call-service",
"z": "0f0bc6be16894600",
"name": "",
"server": "9bf5a907952a79de",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_off",
"areaId": [],
"deviceId": [],
"entityId": [
"switch.sortie_05"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 700,
"y": 760,
"wires": [
[]
]
},
{
"id": "9bf5a907952a79de",
"type": "server",
"name": "Home Assistant",
"version": 5,
"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": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
}
]