Page 1 of 1
HTTP Device Status
Posted: 25 Feb 2017 02:05
by sc-magnus
Hi.
I am using ESP ( nodemcu wifi chip ) to controll some relays. I can make a HTTP Device to turn on and off relays.
But cant get status polling to work.
What is the expected respons?
If Http://<IP_to_ESP>/status will return on or off in my web browser depending on the replay status.
How do i bind this to the HTTP device?
Do i need to put something in "Inline Javascript to parse incoming data to 'on'/'off' strings"
Re: HTTP Device Status
Posted: 27 Feb 2017 23:42
by PoltoS
if output is on/off, no need for inlne JS code.
Re: HTTP Device Status
Posted: 28 Feb 2017 14:40
by IgoriokLT
Hi, this is how I managed that with NodeMCU and ESP Easy firmware
Re: HTTP Device Status
Posted: 28 Feb 2017 14:56
by sc-magnus
But how should the response look like?
Simple text or XML response?
the z-way log :
[2017-02-28 12:48:26.581] [core] Can not make request: Server returned nothing (no headers, no data)
[2017-02-28 12:48:36.592] [core] Can not make request: Server returned nothing (no headers, no data)
[2017-02-28 12:48:46.610] [core] Can not make request: Server returned nothing (no headers, no data)
[2017-02-28 12:48:56.601] [core] Can not make request: Server returned nothing (no headers, no data)
How does your ESP code looks like for sending the status?
I have a simple "Send"
conn:on("connection",function(conn, payload)
conn:send("on"..
"HTTP/1.1\r\n"..
"Host: x.x.x.x\r\n"..
"Accept: */*\r\n"..
"Authorization: Basic xxxxxxxxxxxxx\r\nAccept: */*\r\n\r\n"..
"User-Agent: Mozilla/4.0 (compatible; esp8266 Lua;)"..
"\r\n\r\n")
end)
Re: HTTP Device Status
Posted: 28 Feb 2017 14:59
by IgoriokLT
I'm using ESP Easy firmware, and I've used their documentation. Request returns JSON-format responce, I can make some screenshots when I will get home later today
Re: HTTP Device Status
Posted: 28 Feb 2017 22:04
by IgoriokLT
There is the screenshot how does the request looks like. All you need is just to parse "state" value
Re: HTTP Device Status
Posted: 01 Mar 2017 00:40
by sc-magnus
I have tried all possible command and cant get it to work.
I have now access and communication to the z-way server.
But when it check for status it always turns the switch off.

Re: HTTP Device Status
Posted: 01 Mar 2017 01:07
by sc-magnus
WOW!! Now it is working.
Keep it simple and this is the settings that work: