Re: Binding to Domoticz
Posted: Tue 01 Nov 2016, 20:57
I had some problems getting this binding to work. The solution for me was to change method from POST to PUT in the createDomoticzVariable function.
I also had problems with swedish charcters (å ä ö) in my user variables. I solved it by changing
path: '/json.htm?type=command¶m=updateuservariable&vname=' + globalVariableHC2 + '&vtype=2&vvalue=' + value and
path: '/json.htm?type=command¶m=saveuservariable&vname=' + globalVariableHC2 + '&vtype=2&vvalue=' + value
to
path: '/json.htm?type=command¶m=updateuservariable&vname=' + encodeURI(globalVariableHC2) + '&vtype=2&vvalue=' + value
and
path: '/json.htm?type=command¶m=saveuservariable&vname=' + encodeURI(globalVariableHC2) + '&vtype=2&vvalue=' + value
I also had problems with swedish charcters (å ä ö) in my user variables. I solved it by changing
path: '/json.htm?type=command¶m=updateuservariable&vname=' + globalVariableHC2 + '&vtype=2&vvalue=' + value and
path: '/json.htm?type=command¶m=saveuservariable&vname=' + globalVariableHC2 + '&vtype=2&vvalue=' + value
to
path: '/json.htm?type=command¶m=updateuservariable&vname=' + encodeURI(globalVariableHC2) + '&vtype=2&vvalue=' + value
and
path: '/json.htm?type=command¶m=saveuservariable&vname=' + encodeURI(globalVariableHC2) + '&vtype=2&vvalue=' + value