updating 2 variables in one url

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
krommetje3108
Posts: 12
Joined: Saturday 05 November 2016 7:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: netherlands
Contact:

updating 2 variables in one url

Post 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...
gerardvs
Posts: 81
Joined: Sunday 04 January 2015 0:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest-1
Location: /dev/null
Contact:

Re: updating 2 variables in one url

Post 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
krommetje3108
Posts: 12
Joined: Saturday 05 November 2016 7:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: netherlands
Contact:

Re: updating 2 variables in one url

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest