Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration fails with error! #44

Open
WhiteLionATX opened this issue Sep 9, 2024 · 2 comments
Open

migration fails with error! #44

WhiteLionATX opened this issue Sep 9, 2024 · 2 comments
Labels
needs-triage Needs looking at to decide what to do

Comments

@WhiteLionATX
Copy link

Current Behavior

SyntaxError: Expected ',' or '}' after property value in JSON at position 21138
at JSON.parse ()
at Object.migrate (/home/pi/migration/node-red-dashboard-2-migration/index.js:55:21)
at /home/pi/migration/node-red-dashboard-2-migration/migrate.js:24:43
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)

Expected Behavior

Migration success

Steps To Reproduce

migrate my flows exported from DB 1.

Environment

  • FlowFuse version:
  • Node.js version: 20.x
  • npm version:
  • Platform/OS: docker
  • Browser:

Linked Customers

  • Customer name and/or link to HubSpot contact
@WhiteLionATX WhiteLionATX added the needs-triage Needs looking at to decide what to do label Sep 9, 2024
@hardillb
Copy link
Contributor

hardillb commented Sep 9, 2024

@WhiteLionATX can you attach the flow file you uploaded to the issue please?

There will be no credentials in the exported flows, but please double check it doesn't contain anything confidential before posting.

@WhiteLionATX
Copy link
Author

WhiteLionATX commented Sep 12, 2024

I tried all my flows at once and the flow file was 7.5 Mb of size. It would take very long to get out all passwords and private information. Since I only try one flow I can at lease provide you with the following that will not be converted too:

    {
        "id": "573059bc.c13d98",
        "type": "group",
        "z": "65d1d0fe.3c4c08",
        "name": "Reinigen",
        "style": {
            "fill": "#ffffbf",
            "label": true
        },
        "nodes": [
            "d5a074ac.fff99",
            "17444550.b88443",
            "24521227.baa61e",
            "5d93df04.bc206",
            "e62aabb9.e8a918",
            "3c9880a.173aa",
            "195a436c.264265",
            "662f64d2.fcc76c",
            "ca69b85.126d948",
            "98f3bb2c.90798",
            "54543b62.ebf9f4",
            "74b66d6e.d3ee1c",
            "76eacc05.1e934c",
            "d07a8def.bd4ae8",
            "6ba7ad40.813f4c",
            "f02a2e49.cf0948",
            "47302e91.c63db",
            "3017b5f.78b524a",
            "85bd8833.b65a98",
            "e9ac8655.59113",
            "294c860d.8c798a",
            "f9589ba2.3d76a",
            "20e54eec.b60d0a",
            "648f7e7c.0aff1",
            "2c610dd9.81de52",
            "eea387aa.c90cc",
            "508b77ec.8ad8c",
            "842dc3f0.13bd68",
            "79d54dbd.293a34",
            "172f455f.15f7c3",
            "7901cf95.97f8e",
            "f17ebd77.4a276",
            "d5911ee0.e80f5",
            "b9ffdddb.114b7",
            "2c69757c.e4edba",
            "db41e078761925dc",
            "28725534a4350dd5",
            "062ae0e2351292b6",
            "5f9ab5a48a387ea6"
        ],
        "x": 774,
        "y": 139,
        "w": 1252,
        "h": 982
    },
    {
        "id": "d5a074ac.fff99",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": null,
        "command": "app_start",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": 100,
        "voice_pack": null,
        "homekit_stop_to_dock": false,
        "x": 1360,
        "y": 180,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "17444550.b88443",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": null,
        "command": "app_stop",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": 100,
        "voice_pack": null,
        "homekit_stop_to_dock": false,
        "x": 1360,
        "y": 280,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "24521227.baa61e",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Start alles",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 900,
        "y": 180,
        "wires": [
            [
                "98f3bb2c.90798"
            ]
        ]
    },
    {
        "id": "5d93df04.bc206",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Stop",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 910,
        "y": 280,
        "wires": [
            [
                "54543b62.ebf9f4"
            ]
        ]
    },
    {
        "id": "e62aabb9.e8a918",
        "type": "debug",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Status",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1750,
        "y": 400,
        "wires": []
    },
    {
        "id": "3c9880a.173aa",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": null,
        "command": "app_pause",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": 100,
        "voice_pack": null,
        "homekit_stop_to_dock": false,
        "x": 1360,
        "y": 520,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "195a436c.264265",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Pause",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 910,
        "y": 520,
        "wires": [
            [
                "74b66d6e.d3ee1c"
            ]
        ]
    },
    {
        "id": "662f64d2.fcc76c",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": null,
        "command": "app_stop_dock",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1360,
        "y": 380,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "ca69b85.126d948",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Stop & dock",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 890,
        "y": 380,
        "wires": [
            [
                "76eacc05.1e934c"
            ]
        ]
    },
    {
        "id": "98f3bb2c.90798",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Start alles",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#79c358",
        "className": "",
        "icon": "toys",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1060,
        "y": 180,
        "wires": [
            [
                "d5a074ac.fff99"
            ]
        ]
    },
    {
        "id": "54543b62.ebf9f4",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 5,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Stop",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9b19d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1050,
        "y": 280,
        "wires": [
            [
                "17444550.b88443"
            ]
        ]
    },
    {
        "id": "74b66d6e.d3ee1c",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 2,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Pause",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9f49d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1050,
        "y": 520,
        "wires": [
            [
                "3c9880a.173aa"
            ]
        ]
    },
    {
        "id": "76eacc05.1e934c",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 6,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Stop & zur Ladestation",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9b19d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1100,
        "y": 380,
        "wires": [
            [
                "662f64d2.fcc76c"
            ]
        ]
    },
    {
        "id": "d07a8def.bd4ae8",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Ladestation",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "num",
        "x": 890,
        "y": 640,
        "wires": [
            [
                "f02a2e49.cf0948"
            ]
        ]
    },
    {
        "id": "6ba7ad40.813f4c",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": null,
        "command": "app_charge",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1360,
        "y": 640,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "f02a2e49.cf0948",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Ladestation",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9f49d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1070,
        "y": 640,
        "wires": [
            [
                "6ba7ad40.813f4c"
            ]
        ]
    },
    {
        "id": "47302e91.c63db",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Ansage",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "num",
        "x": 910,
        "y": 740,
        "wires": [
            [
                "85bd8833.b65a98"
            ]
        ]
    },
    {
        "id": "3017b5f.78b524a",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": "Find me",
        "command": "find_me",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1320,
        "y": 740,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "85bd8833.b65a98",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 4,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Ansage",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9f49d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1060,
        "y": 740,
        "wires": [
            [
                "3017b5f.78b524a"
            ]
        ]
    },
    {
        "id": "e9ac8655.59113",
        "type": "miio-roborock-event",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "outputAtStartup": true,
        "x": 1920,
        "y": 1020,
        "wires": [
            []
        ]
    },
    {
        "id": "294c860d.8c798a",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Status",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 900,
        "y": 840,
        "wires": [
            [
                "f9589ba2.3d76a"
            ]
        ]
    },
    {
        "id": "f9589ba2.3d76a",
        "type": "ui_button",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "group": "86b9a6db.87a35",
        "order": 8,
        "width": 0,
        "height": 0,
        "passthru": true,
        "label": "Status aktuallisieren",
        "tooltip": "",
        "color": "black",
        "bgcolor": "#f9f49d",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 1100,
        "y": 840,
        "wires": [
            [
                "79d54dbd.293a34"
            ]
        ]
    },
    {
        "id": "20e54eec.b60d0a",
        "type": "ui_text",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "group": "86b9a6db.87a35",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Status",
        "format": "{{msg.state_text}}",
        "layout": "row-spread",
        "x": 1710,
        "y": 840,
        "wires": []
    },
    {
        "id": "648f7e7c.0aff1",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": "⚙ Fan Power",
        "command": "set_custom_mode",
        "commandType": "vacuum_cmd",
        "payload": "payload",
        "payloadType": "msg",
        "coordinates": "[\n   [26234,26042,27284,26642,1],\n   [26234,26042,27284,26642,1]\n]",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1330,
        "y": 960,
        "wires": [
            [
                "e62aabb9.e8a918",
                "f17ebd77.4a276"
            ]
        ]
    },
    {
        "id": "2c610dd9.81de52",
        "type": "ui_dropdown",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "label": "Leistung",
        "tooltip": "",
        "place": "Auswahl",
        "group": "86b9a6db.87a35",
        "order": 8,
        "width": 0,
        "height": 0,
        "passthru": true,
        "multiple": false,
        "options": [
            {
                "label": "Leise",
                "value": 10,
                "type": "num"
            },
            {
                "label": "Normal",
                "value": 25,
                "type": "num"
            },
            {
                "label": "Turbo",
                "value": "75",
                "type": "str"
            },
            {
                "label": "Maximal",
                "value": "100",
                "type": "str"
            }
        ],
        "payload": "",
        "topic": "topic",
        "topicType": "msg",
        "x": 1120,
        "y": 1000,
        "wires": [
            [
                "648f7e7c.0aff1"
            ]
        ]
    },
    {
        "id": "eea387aa.c90cc",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Normal",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "25",
        "payloadType": "num",
        "x": 1070,
        "y": 960,
        "wires": [
            [
                "648f7e7c.0aff1"
            ]
        ]
    },
    {
        "id": "508b77ec.8ad8c",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Leise",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "10",
        "payloadType": "num",
        "x": 910,
        "y": 920,
        "wires": [
            [
                "648f7e7c.0aff1"
            ]
        ]
    },
    {
        "id": "842dc3f0.13bd68",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Turbo",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "75",
        "payloadType": "num",
        "x": 910,
        "y": 960,
        "wires": [
            [
                "2c610dd9.81de52"
            ]
        ]
    },
    {
        "id": "79d54dbd.293a34",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": "ⓘ Get status",
        "command": "get_status",
        "commandType": "vacuum_cmd",
        "payload": "10",
        "payloadType": "str",
        "coordinates": "",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1330,
        "y": 840,
        "wires": [
            [
                "7901cf95.97f8e",
                "b9ffdddb.114b7"
            ]
        ]
    },
    {
        "id": "172f455f.15f7c3",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Maximal",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "100",
        "payloadType": "num",
        "x": 920,
        "y": 1000,
        "wires": [
            [
                "2c610dd9.81de52"
            ]
        ]
    },
    {
        "id": "7901cf95.97f8e",
        "type": "debug",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Status",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1490,
        "y": 800,
        "wires": []
    },
    {
        "id": "f17ebd77.4a276",
        "type": "delay",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "pauseType": "delay",
        "timeout": "2",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "outputs": 1,
        "x": 1800,
        "y": 740,
        "wires": [
            [
                "f9589ba2.3d76a"
            ]
        ]
    },
    {
        "id": "d5911ee0.e80f5",
        "type": "function",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "func": "msg.topic = \"\";\nmsg.payload = \"\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1500,
        "y": 1020,
        "wires": [
            [
                "e9ac8655.59113"
            ]
        ]
    },
    {
        "id": "b9ffdddb.114b7",
        "type": "function",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "func": "if(msg.hasOwnProperty(\"payload\") && msg.payload[0].hasOwnProperty(\"battery\") && msg.payload[0].hasOwnProperty(\"state\"))\n{\n    let status = \"\";\n    // let x = msg.payload[0].state;\n\n    let x = parseInt(msg.payload[0].state);\n    if (isNaN(x)) { x = 99; } \n\tswitch (x) \n\t{\n\t\t  \n        case 0:\n          status = \"Unknown\";\n          break;\n        \n        case 1:\n          status = \"Initiating\";\n          break;\n          \n        case 2:\n          status = \"Sleeping\";\n          break;\n        \n        case 3:\n          status = \"Idle\";\n          break;\n          \n        case 4:\n          status = \"Remote Control\";\n          break;\n        \n        case 5:\n          status = \"Cleaning\";\n          break;\n          \n        case 6:\n          status = \"Returning Dock\";\n          break;\n        \n        case 7:\n          status = \"Manual Mode\";\n          break;\n          \n        case 8:\n          status = \"Charging\";\n          break;\n        \n        case 9:\n          status = \"Charging Error\";\n          break;\n          \n        case 10:\n          status = \"Paused\";\n          break;\n        \n        case 11:\n          status = \"Spot Cleaning\";\n          break;\n          \n        case 12:\n          status = \"In Error\";\n          break;\n        \n        case 13:\n          status = \"Shutting Down\";\n          break;\n          \n        case 12:\n          status = \"Sleeping\";\n          break;\n        \n        case 14:\n          status = \"Updating\";\n          break;\n          \n        case 15:\n          status = \"Docking\";\n          break;\n        \n        case 16:\n          status = \"Go To\";\n          break;\n          \n        case 17:\n          status = \"Zone Clean\";\n          break;\n        \n        case 18:\n          status = \"Room Clean\";\n          break;\n        \n        case 99:\n          status = \"Status parsing error!\";\n          break;          \n          \n        case 100:\n          status = \"Fully Charged\";\n          break;          \n                 \n        default:\n          status = \"-\";\n          break;\t\n    }   \n    \n    let newPayload = {};\n    newPayload.state_text = status + \" - Batterie: \" + msg.payload[0].battery;\n    return newPayload;\n} \nreturn null;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1520,
        "y": 840,
        "wires": [
            [
                "20e54eec.b60d0a",
                "2c69757c.e4edba"
            ]
        ]
    },
    {
        "id": "2c69757c.e4edba",
        "type": "debug",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "Status",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1690,
        "y": 920,
        "wires": []
    },
    {
        "id": "db41e078761925dc",
        "type": "catch",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "scope": "group",
        "uncaught": false,
        "x": 1690,
        "y": 200,
        "wires": [
            [
                "28725534a4350dd5"
            ]
        ]
    },
    {
        "id": "28725534a4350dd5",
        "type": "debug",
        "z": "65d1d0fe.3c4c08",
        "g": "573059bc.c13d98",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1870,
        "y": 200,
        "wires": []
    },
    {
        "id": "062ae0e2351292b6",
        "type": "inject",
        "z": "65d1d0fe.3c4c08",
        "d": true,
        "g": "573059bc.c13d98",
        "name": "getMap Test",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 920,
        "y": 1080,
        "wires": [
            [
                "9f5f47074a543914"
            ]
        ]
    },
    {
        "id": "5f9ab5a48a387ea6",
        "type": "miio-roborock-command",
        "z": "65d1d0fe.3c4c08",
        "d": true,
        "g": "573059bc.c13d98",
        "name": "",
        "server": "6d0a0d3.24774f4",
        "command_name": "ⓘ Get room mapping",
        "command": "get_room_mapping",
        "commandType": "vacuum_cmd",
        "payload": "10",
        "payloadType": "str",
        "coordinates": "",
        "fan_speed": "",
        "homekit_stop_to_dock": true,
        "x": 1320,
        "y": 1080,
        "wires": [
            []
        ]
    },
    {
        "id": "6d0a0d3.24774f4",
        "type": "miio-roborock-server",
        "name": "Vacuum",
        "ip": "192.168.0.174",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "polling": "900"
    },
    {
        "id": "86b9a6db.87a35",
        "type": "ui_group",
        "name": "Staubsauger",
        "tab": "10f74434.26e3bc",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": true,
        "className": ""
    },
    {
        "id": "10f74434.26e3bc",
        "type": "ui_tab",
        "name": "Staubsauger",
        "icon": "toys",
        "order": 5,
        "disabled": false,
        "hidden": false
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs looking at to decide what to do
Projects
None yet
Development

No branches or pull requests

2 participants