Thanks @Colin for help. Perhaps I did a mistake exporting the flow. I'm very new to Node-Red. - sorry.
[
{
"id": "7a39b022.77cea8",
"type": "finite-state-machine",
"z": "1e09c961.5837b7",
"name": "FSM",
"fsmDefinition": "{\"state\":{\"status\":\"OFF\",\"data\":{\"power\":0}},\"transitions\":{\"OFF\":{\"power > 0\":\"RUNNING\",\"set\":\"OFF\"},\"RUNNING\":{\"power < 5\":\"OFF\",\"power > 20 \":\"WASHING\"},\"WASHING\":{\"power < 5\":\"OFF\"}}}",
"sendInitialState": false,
"sendStateWithoutChange": true,
"showTransitionErrors": true,
"x": 530,
"y": 320,
"wires": [
[
"cf078cc4.8ecfa"
]
]
},
{
"id": "c13a5258.ece828",
"type": "ui_numeric",
"z": "1e09c961.5837b7",
"name": "",
"label": "Power",
"tooltip": "User power of washer",
"group": "ac2c8e97.2a413",
"order": 1,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "",
"format": "{{msg.payload}}",
"min": 0,
"max": "100",
"step": 1,
"x": 90,
"y": 220,
"wires": [
[
"ee347cf6.74787"
]
]
},
{
"id": "faefa1f5.ffc038",
"type": "ui_slider",
"z": "1e09c961.5837b7",
"name": "",
"label": "PowerSlider",
"tooltip": "",
"group": "ac2c8e97.2a413",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "",
"min": 0,
"max": "100",
"step": 1,
"x": 110,
"y": 320,
"wires": [
[
"3b5e0363.c8d7bc"
]
]
},
{
"id": "cf078cc4.8ecfa",
"type": "debug",
"z": "1e09c961.5837b7",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 690,
"y": 320,
"wires": []
},
{
"id": "ee347cf6.74787",
"type": "change",
"z": "1e09c961.5837b7",
"name": "",
"rules": [
{
"t": "set",
"p": "{power}",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 220,
"wires": [
[
"7a39b022.77cea8",
"3729d8ff.30db9"
]
]
},
{
"id": "3b5e0363.c8d7bc",
"type": "change",
"z": "1e09c961.5837b7",
"name": "",
"rules": [
{
"t": "set",
"p": "power",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "set",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 320,
"wires": [
[
"7a39b022.77cea8",
"cf6e77b3.0767b8"
]
]
},
{
"id": "cf6e77b3.0767b8",
"type": "debug",
"z": "1e09c961.5837b7",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 530,
"y": 420,
"wires": []
},
{
"id": "3729d8ff.30db9",
"type": "function",
"z": "1e09c961.5837b7",
"name": "Debug",
"func": "// Debug V2.0, by Thorsten Willert\n// added: BigInt, JSON and Array (+ length) as \"data-types\".\n// changed: limited message-display to 50 chars.\n// changed: removed \"debug\" topic and added msg.topic to the node.status\n\nconst dtNow = new Date().toLocaleString();\n\nlet Type = typeof(msg.payload);\n\nlet sMsg = msg.payload;\n\nif (msg.payload.isArray) {\n Type = 'array';\n sMsg += ' (' + msg.payload.length + ')';\n}\n\nif (Type == \"string\") sMsg = msg.payload.substring(0, 50) + ' ...'; \n\n\nif (Type == 'string' && IsJsonString(msg.payload) ) {\n Type = 'JSON';\n}\n\nlet sColor = typeToColor(Type);\nlet sShape = typeToShape(Type);\nlet Topic = '';\n\nif (msg.topic !== '') {\n Topic = msg.topic + \" | \";\n}\n\nnode.status({\n fill: sColor ,\n shape: sShape,\n text: dtNow + \" | \" + Topic + Type + \" | \" + sMsg\n});\n\nreturn msg;\n\n// -------------------------------------------------------\n\nfunction typeToColor(value) {\n switch(value){\n case \"boolean\":\n return \"red\";\n case \"string\":\n case \"JSON\":\n return \"blue\";\n case \"number\":\n return \"yellow\";\n case \"object\":\n case \"array\":\n return \"green\";\n default:\n return \"grey\";\n }\n}\n\nfunction typeToShape(value) {\n switch(value){\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"object\":\n return \"dot\";\n case \"bigint\":\n case \"JSON\":\n case \"array\":\n return \"ring\";\n default:\n return \"dot\";\n }\n}\n\nfunction IsJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 530,
"y": 180,
"wires": [
[]
],
"inputLabels": [
"msg.payload"
],
"outputLabels": [
"msg.payload"
],
"info": "# Debug\n\nFunction node for easy debugging.\n\nSimply insert it into a connection:\n\n![screenshot](http://www.thorsten-willert.de//images/Software/Node-RED/Thorsten_H_Willert_-_Node-RED_Debug.png)\n\nThe following is displayed as the status text:\n\n- \"Data-type\" as color / shape:\n - Boolean: Red (dot)\n - String: Blue (dot)\n - JSON: Blue (ring)\n - Number: Yellow (dot)\n - BigInt: Yellow (ring)\n - Array: Green (ring)\n - Object: Green (dot)\n - Everything else: Grey (dot)\n- Date and time of the last message\n- Topic (msg.topic)\n- Data-type\n- Payload (msg.payload) limited to 50 chars"
},
{
"id": "1e9abaa0.cf207d",
"type": "inject",
"z": "1e09c961.5837b7",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "set",
"payload": "{\"power\" : 10}",
"payloadType": "json",
"x": 300,
"y": 380,
"wires": [
[
"7a39b022.77cea8"
]
]
},
{
"id": "ac2c8e97.2a413",
"type": "ui_group",
"name": "test",
"tab": "d92ab4b4.55f5c8",
"order": 3,
"disp": true,
"width": 5,
"collapse": true
},
{
"id": "d92ab4b4.55f5c8",
"type": "ui_tab",
"name": "test",
"icon": "fa-television",
"order": 2
}
]
Perhaps I understood the FSM wrong. That's the point I think I programmed/parametrized the state change: