Page 1 of 1

updating 2 variables in one url

Posted: Tuesday 31 January 2017 16:28
by krommetje3108
Hi all,

I want to update 2 variables but I only can put the 2 vars into 1 url. How do I make domoticz understand this?

these are the 2 url's:

/json.htm?type=command&param=updateuservariable&vname=lat&vtype=2&vvalue=%LAT
/json.htm?type=command&param=updateuservariable&vname=long&vtype=2&vvalue=%LONG

Just putting the 2 together with %2b or with & or with + results only in the update of the first var...

Re: updating 2 variables in one url

Posted: Tuesday 31 January 2017 16:52
by gerardvs
Good and understandable question but to my knowledge this is unfortunately not possible. I'm also looking for a solution to update multiple sensors in one http call. For now I have to do 6 calls in a row resulting in a degrading performance while doing so.

Although /json.htm suggests you can do something with json only the response of the call looks like json.
What we all wish for is to call the service with a real json request to do multiple things in one call. Something for the future I hope.

--Gerard

Re: updating 2 variables in one url

Posted: Tuesday 31 January 2017 17:28
by krommetje3108
So i could place the %LAT and the %LONG into one var with e.g. a - in between?

Like this?

json.htm?type=command&param=updateuservariable&vname=ploc&vtype=2&vvalue=%LAT-%LONG

or what is the best way to seperate the 2?