Thanks for the hints - I got it
[
{
"id": "53cced74b780fcb4",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "eb7c7c249d2898a9",
"type": "inject",
"z": "53cced74b780fcb4",
"name": "payload.state true",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"state\":true}",
"payloadType": "json",
"x": 110,
"y": 120,
"wires": [
[
"543b215811e151fa"
]
]
},
{
"id": "543b215811e151fa",
"type": "switch",
"z": "53cced74b780fcb4",
"name": "on",
"property": "payload.state",
"propertyType": "msg",
"rules": [
{
"t": "true"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 270,
"y": 120,
"wires": [
[
"e7be4cf3f7bd52f8",
"cdcda5a07694a91b"
]
]
},
{
"id": "e7be4cf3f7bd52f8",
"type": "trigger",
"z": "53cced74b780fcb4",
"name": "",
"op1": "",
"op2": "on",
"op1type": "nul",
"op2type": "str",
"duration": "5",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "off",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 600,
"y": 160,
"wires": [
[
"ab9874d19f6059b0"
]
]
},
{
"id": "bd2fd95a53a25016",
"type": "trigger",
"z": "53cced74b780fcb4",
"name": "",
"op1": "",
"op2": "off",
"op1type": "nul",
"op2type": "str",
"duration": "20",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "on",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 790,
"y": 100,
"wires": [
[
"65c1bc330a7e6b11"
]
]
},
{
"id": "ab9874d19f6059b0",
"type": "change",
"z": "53cced74b780fcb4",
"name": "start fan WC",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"src\": \"shellyplus2pm-a8032ab7151c\",\t \"method\": \"Switch.Set\",\t \"params\": { \"id\": 1, \"on\": true } \t}",
"tot": "jsonata"
},
{
"t": "delete",
"p": "reset",
"pt": "msg"
},
{
"t": "set",
"p": "fanstate",
"pt": "flow",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 160,
"wires": [
[
"bd2fd95a53a25016",
"a494d7f9ea6b8776"
]
]
},
{
"id": "65c1bc330a7e6b11",
"type": "change",
"z": "53cced74b780fcb4",
"name": "stop fan WC",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"src\": \"shellyplus2pm-a8032ab7151c\",\t \"method\": \"Switch.Set\",\t \"params\": { \"id\": 1, \"on\": false } \t}",
"tot": "jsonata"
},
{
"t": "set",
"p": "fanstate",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 100,
"wires": [
[
"a494d7f9ea6b8776"
]
]
},
{
"id": "567df74e222420d4",
"type": "switch",
"z": "53cced74b780fcb4",
"name": "off",
"property": "payload.state",
"propertyType": "msg",
"rules": [
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 270,
"y": 180,
"wires": [
[
"7dd2479e9c6c06e5"
]
]
},
{
"id": "c38d88575e4fb04c",
"type": "inject",
"z": "53cced74b780fcb4",
"name": "payload.state false",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"state\":false}",
"payloadType": "json",
"x": 110,
"y": 180,
"wires": [
[
"567df74e222420d4"
]
]
},
{
"id": "7dd2479e9c6c06e5",
"type": "change",
"z": "53cced74b780fcb4",
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 420,
"y": 180,
"wires": [
[
"e7be4cf3f7bd52f8"
]
]
},
{
"id": "723ba6b6f451acbe",
"type": "change",
"z": "53cced74b780fcb4",
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 100,
"wires": [
[
"bd2fd95a53a25016"
]
]
},
{
"id": "cdcda5a07694a91b",
"type": "switch",
"z": "53cced74b780fcb4",
"name": "Fan_state_true",
"property": "fanstate",
"propertyType": "flow",
"rules": [
{
"t": "true"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 420,
"y": 100,
"wires": [
[
"723ba6b6f451acbe"
]
]
},
{
"id": "a494d7f9ea6b8776",
"type": "debug",
"z": "53cced74b780fcb4",
"name": "Debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1070,
"y": 160,
"wires": []
}
]
THANKS!