Quantifier le temps écoulé suite à un évènement

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.

image

[
    {
        "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
    }
]

Bonjour,
dans ce cas, juste après ton délais, tu reteste si ton événement est toujours a true ou false étant donné que tu ne peux pas arrêter un node delay…

Il y a le noeud trigger qui fait ça… Une sorte de « délai » avec la possibilité d’arrêter ce temps.

Ce serait tellement plus simple et standard avec une automatisation Home Assistant… :innocent:

@Argonaute
Merci pour ta réponse, oui en effet, mais je me dit que si je fais des automatisation dans tous les environnements, à terme, j’ai peur de ne plus rien y trouver…

Je vais essayer comme dit @LeLapinFou et m’amuser à voir également comme dit @Argonaute
Merci à vous, je vous tiens au courant !

Je suis preneur de ta solution pour chronomètrer le temps de douches des enfants :rofl:

@tikismoke oui, et comme tout le monde le sais, sous la douche le temps s’écoule :smiley:

Je viens de regarder le node « trigger » et en fait ce nœud répète à une intervalle régulière le message .

La suite au prochain épisode…

Je ne crois pas…
Ca envoie un 1er message (ou pas) et au bout d’un certain temps (paramétrable) ça envoie un autre message. On peut annuler ce second envoi avec un reset.

@golfvert , merci pour ta réponse, je viens de tester à nouveau le trigger et, après ton explication, j’ai compris comment annuler la temporisation. Merci!

[
    {
        "id": "1240cebdc22fda91",
        "type": "group",
        "z": "0f0bc6be16894600",
        "name": "ECS t° Safty",
        "style": {
            "label": true,
            "color": "#000000"
        },
        "nodes": [
            "d9d7d37acb5d151a",
            "836d92813baee816",
            "46a5083905981733",
            "d2e6b5f5c599a4c9",
            "74fee2cc4d80ee85"
        ],
        "x": 142,
        "y": 773,
        "w": 804,
        "h": 300
    },
    {
        "id": "d9d7d37acb5d151a",
        "type": "api-call-service",
        "z": "0f0bc6be16894600",
        "g": "1240cebdc22fda91",
        "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": 840,
        "y": 860,
        "wires": [
            []
        ]
    },
    {
        "id": "836d92813baee816",
        "type": "api-call-service",
        "z": "0f0bc6be16894600",
        "g": "1240cebdc22fda91",
        "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": 840,
        "y": 940,
        "wires": [
            []
        ]
    },
    {
        "id": "46a5083905981733",
        "type": "switch",
        "z": "0f0bc6be16894600",
        "g": "1240cebdc22fda91",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 510,
        "y": 940,
        "wires": [
            [
                "d2e6b5f5c599a4c9"
            ],
            [
                "836d92813baee816"
            ]
        ]
    },
    {
        "id": "d2e6b5f5c599a4c9",
        "type": "trigger",
        "z": "0f0bc6be16894600",
        "g": "1240cebdc22fda91",
        "name": "hystérésis",
        "op1": "",
        "op2": "true",
        "op1type": "nul",
        "op2type": "bool",
        "duration": "4",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 660,
        "y": 880,
        "wires": [
            [
                "d9d7d37acb5d151a"
            ]
        ]
    },
    {
        "id": "74fee2cc4d80ee85",
        "type": "group",
        "z": "0f0bc6be16894600",
        "g": "1240cebdc22fda91",
        "name": "ECS",
        "style": {
            "label": true,
            "color": "#000000"
        },
        "nodes": [
            "c0b735202a68d627",
            "d19ad98b621a2de2"
        ],
        "x": 168,
        "y": 799,
        "w": 258,
        "h": 248
    },
    {
        "id": "c0b735202a68d627",
        "type": "inject",
        "z": "0f0bc6be16894600",
        "g": "74fee2cc4d80ee85",
        "name": "ECS en chauffe",
        "props": [
            {
                "p": "reset",
                "v": "true",
                "vt": "bool"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 320,
        "y": 840,
        "wires": [
            [
                "d2e6b5f5c599a4c9"
            ]
        ]
    },
    {
        "id": "d19ad98b621a2de2",
        "type": "group",
        "z": "0f0bc6be16894600",
        "g": "74fee2cc4d80ee85",
        "name": "Simule la sonde dallas",
        "style": {
            "label": true,
            "color": "#000000"
        },
        "nodes": [
            "51ab1089e1a80594",
            "19510e1964597099"
        ],
        "x": 194,
        "y": 879,
        "w": 172,
        "h": 142
    },
    {
        "id": "51ab1089e1a80594",
        "type": "inject",
        "z": "0f0bc6be16894600",
        "g": "d19ad98b621a2de2",
        "name": "true",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 290,
        "y": 920,
        "wires": [
            [
                "46a5083905981733"
            ]
        ]
    },
    {
        "id": "19510e1964597099",
        "type": "inject",
        "z": "0f0bc6be16894600",
        "g": "d19ad98b621a2de2",
        "name": "false",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 290,
        "y": 980,
        "wires": [
            [
                "46a5083905981733"
            ]
        ]
    },
    {
        "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
    }
]