Trying to pass a hex value to call-service

I’m trying to call a service that takes a hexadecimal address. For 0-9 just passing “0”, “1”, etc works but when I try to move on to 0x000a and pass just “a” or even “0x000a” I get an error:

Call-service API error. Error Message: expected int for dictionary value @ data['group']

Non working example:

Working example:

Sorry if this is a stupid question, but it wants an int. Hexadecimal strings are not integers. So what happens if you just pass 10 or 11 versus 0xA, 0xB? What error do you get?

Also ints do not need to be quoted in JSON or dictionaries so you might try leaving the quotes off the values. i.e. ‘group’:10 versus ‘group’:‘10’

2 Likes

integer values (10, 11, etc) work fine! Thank you so much!

I’d been doing everything with hex and YAML in the HA UI and I was stuck in that mindset in Node-RED too! Back to remedial data types for me again!

1 Like