This object is in archive! 

How to use API to turn a switch ON/OFF?

Abdalrahman Hassanine shared this question 4 years ago
Need Answer

Hi everyone


Can anybody give me an example on how to use API to turn a switch ON/OFF?


I'm using Micro Module Switch Double

I want to control it from an external application using HTTP requests

and I don't want to use virtual switches


Thank you,

Comments (2)

photo
1

Well, im not sure how this can be done without using virtual devices. Virtual switch would not help anyway, you would need to use vitrual sensor as that has a direct http link where you only need to insert the status 1 or 0 manually at the end.

photo
1

Sorry, I meant Virtual Sensor ... Thanks

photo
photo
5

so, how to get the "ep" and "apiKey" numbers?


and what about local? is it available?


Thank you,

photo
1

Did you find out how to get the "ep" and "apiKey" numbers?

photo
1

It's not an easy find.


After you navigate to STATE, press Settings button, and in URL field you will find complete link with ep and apiKey filled in.

photo
1

Now I get it. It has to be a viritual switch. I tried with a z-wave switch. Now i created a viritual switch and it works.Thank you.

photo