Closed Chrominator closed 4 years ago
The correct verb is POST
, not PUT
. Check out the documentation here:
Sorry. Was refering to a page : https://blog.christophermullins.com/2017/02/11/milight-wifi-gateway-emulator-on-an-esp8266/ on "Using the REST API" section.
Now with the right POST as a verb, got the following : `* Trying 192.168.1.11...
POST /transitions HTTP/1.1 Host: milight-hub.local Authorization: Basic QXJ0aWdlOkNlbnR1cnkyMQ== User-Agent: curl/7.58.0 Accept: / Content-Type: application/json Content-Length: 204
Error message is refering to remote_type, documentation refers to device_type, or am i wrong ? However I was expecting some help on posting the request to create a transition, I'm still stuck.
Thank you again.
Ah, I'm sorry. It's possible the API docs are broken. I'll take a look later.
The easiest way to schedule a transition is probably just by including the "transition"
key in a command, so:
curl -X PUT -H 'Content-Type: application/json' -d '{"brightness":255,"transition":60}' 192.168.1.11/gateways/0x8B6C/cct/1
This one works fine, thank you so much.
Really good job, thank you again ! I like this improvement.
When issuing :
got the following :
I§ don't understand what's wrong in my syntax, the device is working well with the web based interface or with other REST APs. Thank you for your help.
http://milight-hub.local/transitions
is producing the following output :{"transitions":[]}
About :
{ "firmware": "milight-hub", "version": "1.10.3", "ip_address": "192.168.1.11", "reset_reason": "Software/System restart", "variant": "nodemcuv2", "free_heap": 16312, "arduino_version": "2_4_2", "queue_stats": { "length": 0, "dropped_packets": 0 }
Settings :