One flow is working the other one isnt

I have these two flows that shall reinstate some input numbers in Home Assistant, I got the one with "High" to work, while the "Low"gives me error

[
    {
        "id": "489e97254938079a",
        "type": "server-state-changed",
        "z": "7b83b20cb732bf2a",
        "name": "Setverdi høy pris",
        "server": "12135e641a9670e0",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "input_number.multiplier_high",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 1,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 140,
        "y": 3260,
        "wires": [
            [
                "57f57d080cdb6a63"
            ]
        ]
    },
    {
        "id": "57f57d080cdb6a63",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "set memory",
        "rules": [
            {
                "t": "set",
                "p": "multiplier_high",
                "pt": "flow",
                "to": "payload",
                "tot": "msg",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 330,
        "y": 3260,
        "wires": [
            []
        ]
    },
    {
        "id": "c3376fda3e61f658",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "Get memory",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "multiplier_high",
                "tot": "flow",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 550,
        "y": 3260,
        "wires": [
            [
                "a658471e3def1aa4"
            ]
        ]
    },
    {
        "id": "cd3c86ce10cc8f46",
        "type": "link in",
        "z": "7b83b20cb732bf2a",
        "name": "link in 22",
        "links": [
            "692081b344ef1ccd"
        ],
        "x": 425,
        "y": 3220,
        "wires": [
            [
                "c3376fda3e61f658"
            ]
        ]
    },
    {
        "id": "19d7895a6011b722",
        "type": "debug",
        "z": "7b83b20cb732bf2a",
        "name": "debug 304",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1170,
        "y": 3260,
        "wires": []
    },
    {
        "id": "8205f47920efd81d",
        "type": "inject",
        "z": "7b83b20cb732bf2a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 380,
        "y": 3320,
        "wires": [
            [
                "c3376fda3e61f658"
            ]
        ]
    },
    {
        "id": "a658471e3def1aa4",
        "type": "function",
        "z": "7b83b20cb732bf2a",
        "name": "function 1",
        "func": "msg.payload = Number(msg.payload);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 740,
        "y": 3260,
        "wires": [
            [
                "3e32f318d96c8db5"
            ]
        ]
    },
    {
        "id": "3e32f318d96c8db5",
        "type": "api-call-service",
        "z": "7b83b20cb732bf2a",
        "name": "Multiplier high",
        "server": "12135e641a9670e0",
        "version": 5,
        "debugenabled": false,
        "domain": "input_number",
        "service": "set_value",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"entity_id\":\"input_number.multiplier_high\",\"value\":\"{{flow.multiplier_high}}\"}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "mergecontext": "",
        "x": 920,
        "y": 3260,
        "wires": [
            [
                "19d7895a6011b722"
            ]
        ]
    },
    {
        "id": "ef9e25776057db0d",
        "type": "server-state-changed",
        "z": "7b83b20cb732bf2a",
        "name": "Setverdi lav pris",
        "server": "12135e641a9670e0",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "input_number.multiplier_low",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 1,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 140,
        "y": 3080,
        "wires": [
            [
                "4570999eb497a792"
            ]
        ]
    },
    {
        "id": "4570999eb497a792",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "set memory",
        "rules": [
            {
                "t": "set",
                "p": "#:(file)::multiplier_low",
                "pt": "flow",
                "to": "payload",
                "tot": "msg",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 330,
        "y": 3080,
        "wires": [
            []
        ]
    },
    {
        "id": "6248af32760b93d5",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "Get memory",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "#:(file)::multiplier_low",
                "tot": "flow",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 550,
        "y": 3080,
        "wires": [
            [
                "900b0948afdc9787"
            ]
        ]
    },
    {
        "id": "78ad09ecb5d80d3f",
        "type": "link in",
        "z": "7b83b20cb732bf2a",
        "name": "link in 21",
        "links": [
            "692081b344ef1ccd"
        ],
        "x": 425,
        "y": 3040,
        "wires": [
            [
                "6248af32760b93d5"
            ]
        ]
    },
    {
        "id": "1e9a10334331fa17",
        "type": "debug",
        "z": "7b83b20cb732bf2a",
        "name": "debug 303",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1170,
        "y": 3140,
        "wires": []
    },
    {
        "id": "efec0a24b22f1c76",
        "type": "inject",
        "z": "7b83b20cb732bf2a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 380,
        "y": 3140,
        "wires": [
            [
                "6248af32760b93d5"
            ]
        ]
    },
    {
        "id": "900b0948afdc9787",
        "type": "function",
        "z": "7b83b20cb732bf2a",
        "name": "function 2",
        "func": "msg.payload = Number(msg.payload);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 740,
        "y": 3080,
        "wires": [
            [
                "a283ae636071d563",
                "da226fcd5ad51f13"
            ]
        ]
    },
    {
        "id": "a283ae636071d563",
        "type": "api-call-service",
        "z": "7b83b20cb732bf2a",
        "name": "Multiplier Low",
        "server": "12135e641a9670e0",
        "version": 5,
        "debugenabled": true,
        "domain": "input_number",
        "service": "set_value",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"entity_id\":\"input_number.multiplier_low\",\"value\":\"{{flow.multiplier_low}}\"}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "mergecontext": "",
        "x": 920,
        "y": 3080,
        "wires": [
            [
                "1e9a10334331fa17"
            ]
        ]
    },
    {
        "id": "da226fcd5ad51f13",
        "type": "debug",
        "z": "7b83b20cb732bf2a",
        "name": "debug 305",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 870,
        "y": 3180,
        "wires": []
    },
    {
        "id": "12135e641a9670e0",
        "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": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    }
]


Anyone see why?

Add another debug node showing what is coming out of the function 1. Set all debug nodes to output Complete Message. Make sure you expand all the objects in the debug pane, then the messages can be compared.

Like this?


Skjermbilde 2023-07-10 kl. 22.57.52

Add debug nodes to the Get Memory nodes to see what values you are writing the flow variables to. Also check in the Context window that they are correct

I find it strange if I in the Json paste in the text from the high, then it works but if I just change high with low, then h... is loose.

I think this may be better answered by someone on a Home Assistant forum.

Yes I think so, there must be a reason even if I cant see it at this point. Thanks for your effort though.

Not much activity on Home Assistant forum or in their discord channel. Solved the problem anyway. When working with codes and flow I often think to much, and do not keep things simple enough. anyway, this is how it ended up.

[
    {
        "id": "1e9a10334331fa17",
        "type": "debug",
        "z": "7b83b20cb732bf2a",
        "name": "debug 303",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1170,
        "y": 3060,
        "wires": []
    },
    {
        "id": "d5e1e7d856f50aa8",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "set memory",
        "rules": [
            {
                "t": "set",
                "p": "#:(file)::multiplier_low",
                "pt": "flow",
                "to": "payload",
                "tot": "msg",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 3040,
        "wires": [
            []
        ]
    },
    {
        "id": "e89cf3e1c29f0c8d",
        "type": "link in",
        "z": "7b83b20cb732bf2a",
        "name": "link in 21",
        "links": [
            "692081b344ef1ccd"
        ],
        "x": 425,
        "y": 2980,
        "wires": [
            [
                "4318117196b92849"
            ]
        ]
    },
    {
        "id": "7f70f393539079f7",
        "type": "inject",
        "z": "7b83b20cb732bf2a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 380,
        "y": 3100,
        "wires": [
            [
                "4318117196b92849"
            ]
        ]
    },
    {
        "id": "1a968f1197530b9d",
        "type": "api-call-service",
        "z": "7b83b20cb732bf2a",
        "name": "Multiplier low",
        "server": "12135e641a9670e0",
        "version": 5,
        "debugenabled": false,
        "domain": "input_number",
        "service": "set_value",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"entity_id\":\"input_number.multiplier_low\",\"value\":\"{{payload}}\"}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "mergecontext": "",
        "x": 910,
        "y": 3060,
        "wires": [
            [
                "1e9a10334331fa17"
            ]
        ]
    },
    {
        "id": "4318117196b92849",
        "type": "change",
        "z": "7b83b20cb732bf2a",
        "name": "Get memory",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "#:(file)::multiplier_low",
                "tot": "flow",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 570,
        "y": 3060,
        "wires": [
            [
                "1a968f1197530b9d"
            ]
        ]
    },
    {
        "id": "cf771aec22acaa95",
        "type": "server-state-changed",
        "z": "7b83b20cb732bf2a",
        "name": "Setverdi lav pris",
        "server": "12135e641a9670e0",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "input_number.multiplier_low",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "num",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 1,
        "output_only_on_state_change": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 140,
        "y": 3040,
        "wires": [
            [
                "d5e1e7d856f50aa8"
            ]
        ]
    },
    {
        "id": "12135e641a9670e0",
        "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": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    }
]
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.