Philips Hue API

Suivi du tuto d'utilisation de l'API

https://developers.meethue.com/develop/get-started-2/

https://discovery.meethue.com ==> http://192.168.1.63/debug/clip.html

Création d'une clef d'API

POST /api

{"devicetype":"my_hue_api#macOS Arnaud"}

Response

[
    {
        "success": {
            "username": "CNDeCln2YqPZWJP-Qbvcpf8sZc0DcEVRrBzazopH"
        }
    }
]

Utilisation de l'API

Récupération des lumières

GET /api/CNDeCln2YqPZWJP-Qbvcpf8sZc0DcEVRrBzazopH/lights

Response

lights.json

Allumer une lumière

PUT /api/CNDeCln2YqPZWJP-Qbvcpf8sZc0DcEVRrBzazopH/lights/12/state

{"on":false} {"on":true}

curl -X PUT -d '{\"on\":true}' 192.168.1.63/api/CNDeCln2YqPZWJP-Qbvcpf8sZc0DcEVRrBzazopH/lights/12/state

Récupération des pièces