Synthesis
(The Viking AKA "Holy Crap You're a Giant!")
61
Is there any way for this DTH to check state of a device that can respond via HTTP call?
If I run a GET against my projector with a specific string in the URL, it will give me a text string back to tell me the status.
This works for every function of the projector, power, display settings, keystone, etc… Basically everything the remote can do, I can do via HTTP as well. But, since the DTH is only a blind URL grabber, it doesn’t currently poll or update to show me status of whatever is running the HTTP server.
All HTTP requests would be GET commands, even for changing settings.
Thanks so much for this, this is a life saver! I’m switching from HomeSeer as much as I love it, just because unfortunately the mobile access isn’t that great so I love how ST is all operated by my phone. I have a bunch of Insteon devices and my DSC alarm which I’m having a ton of trouble getting working with ST (the alarm, not Insteon since it isn’t supported). With this plugin, now I just made a virtual switch for my Insteon devices with a URI and can now turn them on or off from ST like they are a normal device. Only issue is no dimming but hardly an issue.
On the flip side, is there any easy way to receive a URI and control something on ST? So have HomeSeer be the one sending the URI or HTTP call and have ST respond in the reverse?
I’m trying to edit this device handler to make ST turn off my Phillips Android TV when I leave my home. The problem is that I need to pass a username and a password to the TV.
Any possibility of adding the ability to have the virtual switch updated by a json callback URI? or at least adding another URI which would be polled at a specified time to retrieve device state and supply the value to parse?
You can see on page 9 there’s the ability for the Nuki bridge to report the status after each operation as a JSON load to an endpoint. OR on page 3, there’s a simple http request that could be parsed on a simple polling scheme.
Unfortunately, this device type I’ve created does not. What you’re talking about is the definition of a custom device handler. This is meant to be a little more universal. When you start adding in expected payloads and having those payloads change the status based on their response, that makes the device handler a lot more specific. You can, however, fork this code and use it as the base of your own custom device handler as it’s almost there.
These is in my log
1017b50e-9c54-4c21-baad-cc060949e929 11:58:01 PM: debug GET /2?A=4&p=1&x=4832 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: Http://192.168.86.197:80
1017b50e-9c54-4c21-baad-cc060949e929 11:58:01 PM: debug Executing OFF
1017b50e-9c54-4c21-baad-cc060949e929 11:57:31 PM: debug GET /2?A=4&p=1&x=4832 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: Http://192.168.86.197:80
1017b50e-9c54-4c21-baad-cc060949e929 11:57:31 PM: debug Executing OFF
1017b50e-9c54-4c21-baad-cc060949e929 11:57:25 PM: debug GET /2?A=3&p=1&x=4832 HTTP/1.1
I’m new to ST and not a programmer (so be gentle). Do I understand correctly that this would give me the ability to control (say) a switch from a regular browser and custom html page (even when not connected to the same LAN)?
If so, is there a simple/working example I could have a look at? Thanks!
I’m not sure you understand this one correctly. This allows you to control other devices that have a basic url you can query to toggle via smartthings (button or actions). What you’re talking about is exposing Smartthings devices via API. That is doable, but that’s not what this device handler is for.
I have the same question as a couple of folks above.
Is it possible to capture a status via URL so that device handler can decide whether to call open or close URL?
I also have a custom made Raspberry Pi garage door opener, but it also has door sensors so I have a real state I can serve via another URL.
Can you provide a way to modify this?
Hi there, I am not sure it will answer your question but have a look at my implementation [RELEASE] Honeywell HPA250B Air Puriifier integration (through Raspberry Pi) which polls requests to my Raspberry regarding the status of my air-purifier and then get the answer thanks to a JSON the pi builds and sends back to the DTH. Hope it helps
Hello there @Mark_deVane and @tguerena ,
So i have a USB UPB controller/interface that registers as a simple Human Interface Device / USB Input Device under Windows and a few UPB light switches and lamp modules and appliance modules from my older home automation system that it will be fantastic if i can get them to work with SmartThings.
I already connected all my X10 devices by using a Raspberry Pi and Mochad and following the instructions of other people (I a have a tech background but not a programmer) and i can tell you that they work better than with what they were originally controlled with i was wondering if i could do the same with the usb UPB interface and the Raspberry Pi in place of your RUC01 but have not idea how and what is required did you solve your UPB issue?? any pointers that might help me??
thank you for your time any help is appreciated.
Denis
It is dead simple to install and appears like a hue bridge on the local network, and you can define custom devices, and supports a variety of protocols including http:, tcp, udp etc. as well as command line scripts. As long as you have an internal endpoint for your UPB device, its pretty much point and click and adding a command for your device/controller - you can have a look at my post on using it with mochad and X-10 and google other implementations. The thing I like about this approach is that Hue support is natively built in so no setup is needed in ST beyond discovery. Here is the link to the afore-mentioned post.