Open vv01f opened 2 years ago
Something like this should work for the status:
HTTP method
: GET
Status URL
: http://192.168.0.1:8000/door.json
Reply Pattern (locked)
: "locked":true
Reply Pattern (unlocked)
: "locked":false
The Open URL
could be something like http://192.168.0.1:8000/door.json&action=open
. But that really depends on your implementation.
yep, that actually works for status with method GET, just then open/close needs the POST method and there is just a single setting for it – which is sensible when thinking about e.g. iterating over simple links for open/close but not for status.
although I proposed to fix the method constraint on the other project, maybe it might be a more general solution if the method was customizable also per command.
Yes, this is a limitation, I will change it in the future. When I find a good way to make in configurable without an overload of options.
You also might want to return <tag "door"="open" />
instead of JSON, if you do not want a message to be displayed. HTML tags are stripped after matching.
I use your Trigger App from f-droid with https://github.com/astro/spacemsg/tree/master/schalterd/ and unfortunately the answer for the commands
lock
andunlock
(POST method) are both simply{}
with HTTP Status Code 200. But there also is the "Status URL"/door.json
(GET method) and that is either{"locked":true}
or{"locked":false}
… just the App answers "Not Found" only, I guess is uses POST method for all requests and thus does not get the expected response.