HTTP get command for sensor value

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
HeinrichB
Normal user
Posts: 6
Joined: 08 Mar 2020, 17:59

HTTP get command for sensor value

#1 Post by HeinrichB » 07 Apr 2020, 18:19

Hello

how can i get a specific sensor value by the generic

http://<espeasyip>/control?cmd=<command>

espeasy is clear so far, but what is the specific command ?

Thank

TD-er
Core team member
Posts: 2635
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTTP get command for sensor value

#2 Post by TD-er » 07 Apr 2020, 22:29

You can get the data as JSON.
All sensor data: http://<ip>/json?view=sensorupdate
Specific for a single task: http://<ip>/json?view=sensorupdate&tasknr=2 (tasknr 2)

HeinrichB
Normal user
Posts: 6
Joined: 08 Mar 2020, 17:59

Re: HTTP get command for sensor value

#3 Post by HeinrichB » 08 Apr 2020, 07:09

Thank you very much. Exactly what i need :)

fury0
Normal user
Posts: 3
Joined: 26 Feb 2017, 19:56

Re: HTTP get command for sensor value

#4 Post by fury0 » 23 May 2020, 19:48

Hi,
Thanks for the answer.
But it looks like we get the latest taskX record value, not the actual value.
Is there any command to trigger to read the value of the device?
As I do not speak very well english I'm not sure you'll understand me :-( . So, here is what I would like:
I've configured a task which work on a ADS1115 to measure a voltage. The voltage is measured every 300 seconds and sended to domoticz through an MQTT broker.
Sometime Domoticz need to have the actual value (not the latest measured), so it will be nice to send a request to the ESP to measure immediatly the device and send the value to the controller(s).
Is it possible ?
Thank you very much.

User avatar
grovkillen
Core team member
Posts: 3584
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: HTTP get command for sensor value

#5 Post by grovkillen » 23 May 2020, 19:52

First run a "taskrun" command and you will have the latest value.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

fury0
Normal user
Posts: 3
Joined: 26 Feb 2017, 19:56

Re: HTTP get command for sensor value

#6 Post by fury0 » 23 May 2020, 20:09

Hi,
Thank you very much for this so quick answer !!!
I did'nt knew this command, I will give it a try.
Thank's again.
[EDIT] Yes!! It works as expected! :P Thank you:

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests