Simple Input_Number Flow not working

Hello everybody,

I’m trying since some hours now to simply write a value into a home assistant input_number with this flow - but it won’t work.

The error now is "“Call-service error. expected float for dictionary value @ data[‘value’]”

Does someone know, whats the problem here?

[{"id":"f63df944120c7e28","type":"api-call-service","z":"2c2d757b46c66047","name":"CallService","server":"6f93cefd.a282a","version":3,"debugenabled":true,"service_domain":"input_number","service":"set_value","entityId":"input_number.nodered","data":"{\"value\":\"{{payload}}\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":690,"y":420,"wires":[["a61283553acf1c32"]]},{"id":"6f93cefd.a282a","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

I haven’t imported it since I use my phone now, but looking at the JSON it seems you have ... : "{{payload}}" }

The " " makes it string. So you try to send a string to an input number.

I usually forget which way it is but either ... : payload } or ... : msg.payload }

One of them should work.

I tried all four different methods, but none of them seem to work.

{“value”: “{{ msg.payload }}” } => Error: Expected Float
{“value”: “{{ payload }}” } => Error: Expected Float
{“value”: {{ msg.payload }} } => Error: “Expected “:”, got “}””
{“value”: {{ payload }} } => Error: “Expected “:”, got “}””

Is there a problem with the Change-Node or do I need to convert the injected number in any other way before sending it to the CallService-Node?

You do realize that the examples I wrote did not have {{ }}?

It works! Thank you so much - you made my day! :grinning:

Bring this up again as I have a similar problem. But I got two flows and the one with “high” works while the one with “low” do not.

[
   {
       "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": "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": 3260,
       "wires": [
           [
               "57f57d080cdb6a63"
           ]
       ]
   },
   {
       "id": "57f57d080cdb6a63",
       "type": "change",
       "z": "7b83b20cb732bf2a",
       "name": "set memory",
       "rules": [
           {
               "t": "set",
               "p": "#:(file)::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": "#:(file)::multiplier_high",
               "tot": "flow",
               "dc": true
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 550,
       "y": 3260,
       "wires": [
           [
               "be382dd05c53d6a5",
               "3e32f318d96c8db5"
           ]
       ]
   },
   {
       "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": true,
       "tostatus": true,
       "complete": "true",
       "targetType": "full",
       "statusVal": "payload",
       "statusType": "auto",
       "x": 1170,
       "y": 3240,
       "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": "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": "1e9a10334331fa17",
       "type": "debug",
       "z": "7b83b20cb732bf2a",
       "name": "debug 303",
       "active": true,
       "tosidebar": true,
       "console": true,
       "tostatus": true,
       "complete": "true",
       "targetType": "full",
       "statusVal": "payload",
       "statusType": "auto",
       "x": 1170,
       "y": 3040,
       "wires": []
   },
   {
       "id": "35d9efda6a46b7bb",
       "type": "debug",
       "z": "7b83b20cb732bf2a",
       "name": "debug 307",
       "active": true,
       "tosidebar": true,
       "console": true,
       "tostatus": true,
       "complete": "true",
       "targetType": "full",
       "statusVal": "payload",
       "statusType": "auto",
       "x": 650,
       "y": 3180,
       "wires": []
   },
   {
       "id": "be382dd05c53d6a5",
       "type": "debug",
       "z": "7b83b20cb732bf2a",
       "name": "debug 308",
       "active": false,
       "tosidebar": true,
       "console": true,
       "tostatus": true,
       "complete": "true",
       "targetType": "full",
       "statusVal": "payload",
       "statusType": "auto",
       "x": 630,
       "y": 3420,
       "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": 330,
       "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\":\"{{flow.multiplier_low}}\"}",
       "dataType": "json",
       "mergeContext": "",
       "mustacheAltTags": false,
       "outputProperties": [],
       "queue": "none",
       "mergecontext": "",
       "x": 930,
       "y": 3040,
       "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": 550,
       "y": 3040,
       "wires": [
           [
               "1a968f1197530b9d",
               "35d9efda6a46b7bb"
           ]
       ]
   },
   {
       "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
   }
]

If anyone else ever will wonder, I solved it and 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
    }
]