Made some test with Node-red.
1.
Out:
Code: Select all
postData = {
idx = 101,
status = Off,
level = 15,
param1 = qweqwe,
qwer = werewqr,
open = true
}
In:
Code: Select all
{"idx":101,"level":15,"open":true}
Lost some data
2.
Out:
Code: Select all
postData = {
idx = '101',
status = On,
level = '15',
param1 = 'qweqwe',
qwer = 'werewqr',
open = 'true'
}
In:
Code: Select all
{"idx":"101","level":"15","open":"true","param1":"qweqwe","qwer":"werewqr"}
Lost 1 param
3.
Out:
Code: Select all
postData = {
idx = tostring(btn.idx),
status = 'On',
level = '15',
param1 = 'qweqwe',
qwer = 'werewqr',
open = 'true'
}
In:
Code: Select all
{"idx":"101","level":"15","open":"true","param1":"qweqwe","qwer":"werewqr","status":"On"}
OK
4.
Out:
Code: Select all
postData = {
idx = tostring(btn.idx),
status = btn.state,
level = '15',
param1 = 'qweqwe',
qwer = 'werewqr',
open = 'true'
}
In:
Code: Select all
{"idx":"101","level":"15","open":"true","param1":"qweqwe","qwer":"werewqr","status":"On"}
OK
So.
Every param have to be a string value and everything works fine.
PS. The params in result JSON string automatically sorted in alphabetical order
PPS And dont add any headers params in domoticz.openUrl - it gives wrong output json format