Is it possible to change only the value of a variable via a JSON command?
Instead of:
/json.htm?type=command¶m=updateuservariable&idx=1&vname=VariableName&vtype=2&vvalue=NewValue
Use:
/json.htm?type=command¶m=updateuservariable&idx=1&vvalue=NewValue
or:
/json.htm?type=command¶m=updateuservariable&idx=1&vtype=2&vvalue=NewValue
for example?
It's very easy to change the variable name by accident when creating JSON commands on other devices
Change variable value only via JSON
Moderators: leecollings, remb0
-
- Posts: 36
- Joined: Thursday 06 November 2014 15:59
- Target OS: Linux
- Domoticz version: 2564
- Contact:
Re: Change variable value only via JSON
Not sure how this is solved?
Nobody ever answered me...
Nobody ever answered me...
-
- Posts: 12
- Joined: Wednesday 09 July 2014 14:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Change variable value only via JSON
Nor Me I've trying to change the thermostat setpoint on a device through JSON. I'm going to experiment, there is a page on this stuff but I sort of expected a bit more detail. its in my JSON Post
**********************************
Using Raspberry Pi,
Aeon S2
Stella Z's
TKB68's
Using Raspberry Pi,
Aeon S2
Stella Z's
TKB68's
-
- Posts: 12
- Joined: Wednesday 09 July 2014 14:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Change variable value only via JSON
the page is at http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
**********************************
Using Raspberry Pi,
Aeon S2
Stella Z's
TKB68's
Using Raspberry Pi,
Aeon S2
Stella Z's
TKB68's
-
- Posts: 625
- Joined: Thursday 02 October 2014 6:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Location: Geleen
- Contact:
Re: Change variable value only via JSON
Below how I change a uservariable of type string
http://ip:port/json.htm?type=command¶m=updateuservariable&idx=12&vname=test&vtype=0&vvalue=0
http://ip:port/json.htm?type=command¶m=updateuservariable&idx=12&vname=test&vtype=0&vvalue=0
-
- Posts: 12
- Joined: Monday 17 August 2015 22:15
- Target OS: Linux
- Domoticz version: 4.11605
- Location: The Netherlands
- Contact:
Re: Change variable value only via JSON
I can't set my setpoint.
This is what I have, I try to send;
http://192.168.178.25:8080/json.htm?typ ... e=SetPoint;
I send 33 degrees, Data and Setpoint changed to zero (0.0) degrees.
Do I something wrong?
To get the values works perfect with this script;
$json_string = file_get_contents("http://192.168.178.25:8080/json.htm?typ ... es&rid=$id");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$q = $parsed_json[$item];
This is what I have, I try to send;
http://192.168.178.25:8080/json.htm?typ ... e=SetPoint;
I send 33 degrees, Data and Setpoint changed to zero (0.0) degrees.
Do I something wrong?
To get the values works perfect with this script;
$json_string = file_get_contents("http://192.168.178.25:8080/json.htm?typ ... es&rid=$id");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$q = $parsed_json[$item];
Last edited by continent on Sunday 31 January 2016 23:32, edited 1 time in total.
Gigabyte with Debian, 4 Shelly's 2.5 (rollerblinds), 3 Shelly's dimmers, 3 Shelly plugs,
8 x DB1820, ESPeasy with 8 relay's, RFXcom, Enocean USB300, 2 x Enocean STM 330.
8 x DB1820, ESPeasy with 8 relay's, RFXcom, Enocean USB300, 2 x Enocean STM 330.
-
- Posts: 40
- Joined: Friday 29 January 2016 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Change variable value only via JSON
to the question from cjnicholl
According to the source code, you have to provide all the variables:
if (idx.empty() || variablename.empty() || variablevalue.empty() || variabletype.empty())
return;
According to the source code, you have to provide all the variables:
if (idx.empty() || variablename.empty() || variablevalue.empty() || variabletype.empty())
return;
Who is online
Users browsing this forum: No registered users and 0 guests