Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Field Value via HTTP
#1
I am playing with FauxMo and there is an option to get the status of the field to keep it in sync.

How can I send a HTTP request to CQC to reply with the fields current value?
Mykel Koblenz
Illawarra Smart Home
Reply
#2
You could to do it by just embedding a field reference in a page. If you create an html file like this:

<html><body>$Device.Field</body></html>

And hit it from a browser, it will come back with the value of that field. If you aren't actually talking to a browser, then you can return whatever you want, so you could embed that value in a JSON object or some such and that text will be returned.
Dean Roddey
Explorans limites defectum
Reply
#3
its not with a browser, its using FauxMo, so as i understand it there are two ways to do it.

One is to have the reply body to the command have the new state in the body (currently i thin we get "Done" and the other is to poll by sending a GET url and the reply will have the current state in the body.

I think I need to for the first option is have an action command that can send the current state and for the second its probably the same unless I can point it the the CQC web server and get it to respond somehow with the requested field - I dont thing creating a html file for every field is going to be a good solution.
Mykel Koblenz
Illawarra Smart Home
Reply
#4
If you control the URL that will be sent, do a CGI-Bin type CML macro and just send it the field you want. It can just get the value and format the response.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HTTP Trigger and Parameters znelbok 1 147 06-11-2020, 03:41 PM
Last Post: Dean Roddey
  Timers Driver / Field Time Image / Seconds gReatAutomation 1 273 03-16-2020, 05:48 PM
Last Post: Dean Roddey
  If statement to check field value simplextech 10 1,286 01-27-2020, 01:32 PM
Last Post: Dean Roddey
  HTTP SendPUT simplextech 3 571 01-21-2020, 03:05 PM
Last Post: simplextech
  CQC HTTP Events? bjkiller 26 4,104 01-11-2020, 07:27 AM
Last Post: simplextech
  Set value via HTTP Call simplextech 2 419 01-07-2020, 04:39 PM
Last Post: simplextech
  HTTP Trigger Driver - see trained URL's? Shaky 1 535 09-15-2019, 12:25 PM
Last Post: Dean Roddey
  Zwave lock battery level indicator on Field Checkbox kfly 4 1,181 09-07-2019, 05:34 AM
Last Post: kfly
  Stupid question: How can I read a motion or other field state change ghurty 10 2,343 01-10-2019, 10:10 AM
Last Post: Dean Roddey
  HTTP Get driver not working znelbok 10 3,436 08-28-2018, 10:10 AM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)