JKnight
(Keeping SmartThings limping along since 2013.)
489
Thanks for sticking with me. Using Chrome’s developer tools, I am not sure what I am looking at or should be looking for. I don’t see the base64 converted key to sanity check:
Yup. You won’t be able to do what you want to; Digest authentication can’t be done through webrequestor. This is something I’d have to look at adding in the future.
JKnight
(Keeping SmartThings limping along since 2013.)
493
Thanks for your hard work on all of these great tools, they have saved my bacon several times and kept me out of trouble with the wife lately as I make the transition.
I apologize for taking your time on this, I assumed that if I could hit the ip and port with Basic auth, that every other sub-url would be the same. My bad. Thanks for guiding me through it.
Any plan to add the ability for “login:password@ip:port” in the ip address field for this tool down the line? Or do you know if rules engin, or rules api, or whatever it is, can handle Digest auth?
It’s on my list of potential enhancements but can’t say right now when I’ll get it done. I have the Digest code from my ONVIF driver which has to support it, so at least I wouldn’t be starting from scratch. I think I’d want to provide both basic and digest and possibly ws-security.
Rules engine has nothing related to LAN-related authentication.
JKnight
(Keeping SmartThings limping along since 2013.)
495
Sounds good… standing by. Let me know if I can beta test anything.
i tried just pasting this url into a web request #1 but it didnt work . should i use POST or GET or Put or what am i doing wrong ?
JKnight
(Keeping SmartThings limping along since 2013.)
497
From my experience, as long as entering those into a browser works without needing to enter a login and password for the device, you should be able to use GET:
So if for example i need to turn on light number 97 then i need to make web request # the GET command for on and then make web request # 2 the Get command for off ?
stupid question , is there anyway to know the status of the light with this ?
sorry for the dumb questions , im a bit slow since the stroke last year.
JKnight
(Keeping SmartThings limping along since 2013.)
499
For your first question. You can use Web Requestor to create individual debices for on and off separately using just web request #1, which may help you keep track, or you can have web request #1 and web request #2 used in the same one. With Web Req Multi Master open and after setting up your settings, scroll all the way to the bottom and use the Create New Device button to create the device.
For your second question. I think the easiest way would be to create a virtual switch in SmartThings that turns on and off with the routine(s) you are using to control your light. That way you can watch the virtual switch to see current state of the light. I am using Virtual Devices V2, also from @TAustin, for similar setup. This only works if your only method for controlling the light is via SmartThings.
The harder way would be if your light api has a method of checking the status, you could use Web Requestor to get the status periodically.
I am still learning all this stuff myself, so am interested in how others here might recommend doing it.
Another option, if you prefer to have separate devices, is to use my HTTP Devices driver. Instead of having one device where you can configure multiple requests, or even creating multiple webrequestor devices, with the HTTP Devices driver, you create a distinct device for each ‘thing’ you want to control. So for example if ‘light’ is one of your things, you could create a switch device under HTTP Devices driver and then configure the distinct ON and OFF HTTP requests in that device’s settings. It accomplishes the same thing, but sometimes due to the way your automations may be set up, it can be handy to have this alternative. This also kills two birds with one stone, as you wouldn’t need to create a separate virtual switch. The HTTP Device itself is a ‘virtual switch’ that happens to emit HTTP requests based on the switch value.
Getting the current status of the light would require an HTTP endpoint that allows you to retrieve it. In webrequestor, you can extract a value from the response data and have it put in a field that you could test. You can also choose to have it displayed on the dashboard card.
Otherwise if you really want two-way control of an external device, you might also consider MQTT. It requires you run a broker on your LAN, but if your KNX gateway supported it, it would make it easier to both get status and send commands via MQTT messaging from SmartThings.
I have a web based light dimmer which is can be controlled through HTTP POST. I would like to have the virtual dimmer switch from SmartThings to HTTP POST its current “level” to the URL specified.
I wonder if something mentioned by @TAustin for the HTTP Devices V1 ([ST Edge] Web Requestor: a driver to issue local POST and GET HTTP requests - #340 by TAustin) is possible or not with SmartThings rules:create where a {“level”=${level}} would get replaced with the actual “level” from SmartThings virtual dimmer. I couldn’t seem to find a way to achieve it. Can anyone advise me on a possible solutions?
Can a LAN computer get the “level” value through SmartThings RESTful API? Is there any guidance available on how to use SmartThings RESTful API to get get attributes like “level”?
You want to use my HTTP Devices driver. If you create a dimmer device with that driver, it has exactly what you are looking for. You can include a ${level} either as part of the HTTP request header, or in the body of the HTTP message. See the examples in the readme file.
In my HTTP Devices driver I’ve provided a “more” field for the URL field, so if you can accomplish what you want with that driver that would be your best solution for now. One of these days I will also add a similar “more” field in web requestor as well.
I can. I’ll look at including that in my next driver update. How would you want to see the two different state values sent out? Would a JSON formatted message with both values work for you?