Hello,
i added to my dashboard a input_number slider. Now, i want to set the value from my modbus data. The data is there. The output of my modbus object is
by putting quotes it passes the variable as a string.
{"value": {{payload}} }
and also for simple testing
{"value": 1 }
The value is also not at payload, you’ll need the path to the specific number you are trying to pass. use the copy path option next to the value in the debug widow .
I believe the issue is that you have values in msg.payload that is used as input in the call service when it shouldn’t.
Can the node that sets the payload be configured to place the payload in say msg.load instead?
Then just change your call service to take the data from msg.load… instead.
I believe the issue is that you have values in msg.payload that is used as input in the call service when it shouldn’t.
thats possible and also my opinion. But i cannot change it. Because of this, i created a function node to delete the msg object and create a new object with the desired value.
But then, see above, its not working.
I know this is late, but I’ve only just saw this and it wasn’t answered, so here’s some reasons:
Looking at your original post, you had 2 objects being stored in the msg.
msg.payload = an array of 2 numbers (numbered 0-1)
msg.payload.buffer = an array of 4 values (numbered 0-3)
Most computer languages count starting at 0… so thats why 4 items will be numbered 0-3 (position 0, 1, 2, 3)
Arrays in Javascript are passed within square brackets, for example; payload[0] is the first item in the array called payload. payload[1] would get the 2nd item (the 0).
Wrapping the payload[0] in quotes means you were trying to pass the number as a string (text) instead of a number. As it was expecting a number and you tried passing it as a string… it spat out an error.