1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<!doctype html>
<html lang="fr">
<head>
<style>
button {
background-color:#383838;
border:none;
}
</style>
<meta charset="UTF-8">
<title>Controlling hue</title>
</head>
<body>
<script type="text/javascript">
// See API documentation to retrieve your own ID
// https://www.developers.meethue.com/documentation/getting-started
var hueIP = "XXX" // Your hue bridge IP
var hueID = "XXX" // Get your ID from the hue bridge
var hueIP1 = "XXX" // Your hue bridge IP
var hueID1 = "XXX" // Get your ID from the hue bridge
var grouplamp = "1" // the group to comtrol
var grouplamp1 = "17" // the group to comtrol
function turnOn() {
send({"on":true})
}
function turnOff() {
send({"on":false})
}
function turnOn1() {
send({"on":true})
}
function turnOff1() {
send({"on":false})
}
</script>
<div align="center">
<table>
<thead>
<tr>
<th colspan="2">Lumières</th>
</tr>
</thead>
<tbody>
<tr><td>
<script>
function callback() {}
function send(obj) {
var xmlhttp = new XMLHttpRequest();
var url = "http://"+ hueIP +"/api/"+ hueID +"/groups/"+ grouplamp +"/action/" ;
xmlhttp.open("PUT", url, true, callback);
xmlhttp.setRequestHeader("Content-type", "application/json");
var parameters = JSON.stringify(obj);
xmlhttp.send(parameters);
}</script>
<div align="center"
<span style="font-family:Helvetica, Arial, sans-serif; font-size:16px; text-align:center; color:#99cc00">Plafond TV
<br><br></body></html></div>
<button onclick="javascript:turnOn()"><img src="/js-perso/images/on.png"></button>
<button onclick="javascript:turnOff()"><img src="/js-perso/images/off.png"></button>
</td>
<td>
<script>
function callback() {}
function send(obj) {
var xmlhttp = new XMLHttpRequest();
var url = "http://"+ hueIP1 +"/api/"+ hueID1 +"/groups/"+ grouplamp1 +"/action/" ;
xmlhttp.open("PUT", url, true, callback);
xmlhttp.setRequestHeader("Content-type", "application/json");
var parameters = JSON.stringify(obj);
xmlhttp.send(parameters);
}</script>
<div align="center"
<span style="font-family:Helvetica, Arial, sans-serif; font-size:16px; text-align:center; color:#99cc00">Plafond TV
<br><br></body></html></div>
<button onclick="javascript:turnOn1()"><img src="/js-perso/images/on.png"></button>
<button onclick="javascript:turnOff1()"><img src="/js-perso/images/off.png"></button>
</td></tr>
</div>
</table>
</html>
</body>
</html> |
Partager