Get variable value via http?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
marcfon
Normal user
Posts: 11
Joined: 17 Sep 2016, 10:50

Get variable value via http?

#1 Post by marcfon » 17 Sep 2016, 10:56

This seems like something simple but I can't find the right command to do it and searching the forum hasn't resulted in the right clue.

Is it possible to read the value of a task+variable via a http command? My guess would be somehing like http://ESPEasy/control?cmd=status,task1,variableName but that doesn't work.

I know that http://ESPEasy/json returns all the values but it would be nice to just the one specific value instead of having the parse the json string.

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: Get variable value via http?

#2 Post by JR01 » 17 Sep 2016, 11:12

http://host/json?tasknr=2

If you want the areay of info for 2nd task, then navigate the array info
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

marcfon
Normal user
Posts: 11
Joined: 17 Sep 2016, 10:50

Re: Get variable value via http?

#3 Post by marcfon » 17 Sep 2016, 11:15

JR01 wrote:http://host/json?tasknr=2

If you want the areay of info for 2nd task, then navigate the areay info
Thanks this helps! But is it possible to narrow this even further down? Something like http://host/json?tasknr=2,variable1 ?

Monster Beat
New user
Posts: 4
Joined: 03 Nov 2016, 23:13

Re: Get variable value via http?

#4 Post by Monster Beat » 03 Nov 2016, 23:18

I also want to know how to do this.

I have a Sonoff and want to switch my light.
To see whats the status of the light is have a button in the Android App created with MIT App Inventor.
If the status of GPIO is "1" the button should tourn green and if "0" it should tourn grey.

But i don't know how to read the GPIO to the app :(

marcfon
Normal user
Posts: 11
Joined: 17 Sep 2016, 10:50

Re: Get variable value via http?

#5 Post by marcfon » 05 Nov 2016, 09:31


theone
Normal user
Posts: 11
Joined: 15 May 2016, 20:44

Re: Get variable value via http?

#6 Post by theone » 20 Nov 2016, 09:20

Is this documented on the Wiki?

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests