I am using the Philips Hue lights in a room in my house, and I wrote a simple HTML page that is running on a local server in my house, and uses Javascript to turn the lights on and off when a page is loaded. For example, when the lightson.html page is loaded, the lights turn on, and when the lightsoff.html page is loaded the lights turn off. The code is sent to the Hue system with a Javascript command using the OnLoad action on the HTML pages. I use this with an iBeacon app for my phone so that when I enter the rooms the lights come on, and when I leave the room the lights turn off. I wanted to create a physical switch with an Arduino for when I don't have my phone though. Basically all I need it to do is load the html page for on and off and trigger the Javascript OnLoad action when a button connected to the Arduino is pressed. Any ideas how to accomplish this? I have the Arduino connected to my network using the ethernet shield.
Basically all I need it to do is load the html page for on and off and trigger the Javascript OnLoad action when a button connected to the Arduino is pressed. Any ideas how to accomplish this? I have the Arduino connected to my network using the ethernet shield.
I would not recommend this way to solve your problem because that would mean that your Arduino needs to execute JavaScript and this little computer is not able to do that.
It's better that you look at the code that is executed in that onLoad action and do the same but using the program on your Arduino.
We cannot help you at the moment because you haven't provided the script or HTML page that is delivered by your server.
You also didn't specify which hardware you plan to use on the Arduino side.