I’m trying to build a set of hardware buttons/sliders that will be able to control various IOT-devices around my home. In my case I’m starting out with a volume-control and start/pause of my SONOS devices. To do this, I need to send out a simple http POST to my specific devices located in my WIFI. How do I do this?
Obviously my devices is not connected directly to the internet, but to my WIFI network where the Imp is connected as well, but all examples I can find, the server-code is making the HTTP POSTs.
So in short: My goal is to save user-settings etc. in my App and let the Agent know how a specific button works: But the communication to my devices and hardware around the house should be the Imp itself (as anything else is not possible due to network security).
The imp isn’t designed to make requests on the local network - so this isn’t possible out of the box. Communication always goes from the imp to the agent (running on Electric Imp servers), then out to the Internet from there (or vice versa).
To setup a system where this is possible, you need your local server to expose HTTP endpoints that the imp can interact with. If that’s not possible (sounds like it isn’t) - you’ll likely need to find some other hardware to get the job done.
Thanks for your reply.
My local “servers” (devices) do expose HTTP endpoints, but they are local so the Agent is not able to communicate it from the cloud - only through the Imp (is this possible and the way to go?).
Imps can only communicate with their agents, and agents can communicate with anything on the Internet with an HTTP end-point.
So this isn’t possible without a local server in the mix (with exposed HTTP endpoints).
The communication would look like this: imp -> Agent -> server running on your network -> sonos
Ok, damn. And there’s no way that will be supported in the future? It could be as basic as the Agent telling the Imp what IP the http POST should be directed and the IMP would be doing the work - I simply need the Agent to be able to take advantage of the Local Area Network instead of being locked out as an external source.
If not, I’ll have to find some other device for this task then.
Anyone want to buy a cheap EI dev kit?
The imp is not, and cannot be, the solution to every problem. You’ll have to find another device for the task.
I know people have setup solutions similar to what you’re looking at with RPis, Galileos, and other tiny linux computers.