From 96e5b494fad8755f5f6b3c55a46b5eb8b55ef088 Mon Sep 17 00:00:00 2001
From: Correl Roush
My wake-up is scheduled for 7:00 to gradually brighten the lights with a half-hour fade-in each weekday. I also toggled on the setting to @@ -39,24 +39,24 @@ automatically turn the lights off at 9:00.
- +
The most natural starting point is to check the schedules. Right off the bat, I find what I'm after:
GET http://bridge/api/${username}/schedules/1@@ -67,7 +67,7 @@ the bat, I find what I'm after: "name": "Wake up", "description": "L_04_fidlv_start wake up", "command": { - "address": "/api/oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8/sensors/2/state", + "address": "/api/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sensors/2/state", "body": { "flag": true }, @@ -114,9 +114,9 @@ flag to true.
GET http://bridge/api/${username}/sensors/2@@ -135,7 +135,7 @@ flag to true. "name": "Sensor for wakeup", "type": "CLIPGenericFlag", "modelid": "WAKEUP", - "manufacturername": "oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG", + "manufacturername": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "swversion": "A_1801260942", "uniqueid": "L_04_fidlv", "recycle": true @@ -152,9 +152,9 @@ sensor.
GET http://bridge/api/${username}/rules/1@@ -163,7 +163,7 @@ sensor.
{ "name": "L_04_fidlv_Start", - "owner": "oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8", + "owner": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "created": "2018-03-11T19:46:51", "lasttriggered": "2018-03-13T10:30:00", "timestriggered": 2, @@ -206,9 +206,9 @@ each of the actions.
The bedroom group (/groups/1
in the rule's action list) is set to
the following scene, which turns on the lights at minimum brightness:
@@ -227,7 +227,7 @@ the following scene, which turns on the lights at minimum brightness:
"3",
"5"
],
- "owner": "oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8",
+ "owner": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"recycle": true,
"locked": true,
"appdata": {},
@@ -257,9 +257,9 @@ the following scene, which turns on the lights at minimum brightness:
Another schedule (/schedules/2
in the rule's action list) is enabled
by the rule.
@@ -275,7 +275,7 @@ by the rule.
"name": "L_04_fidlv",
"description": "L_04_fidlv_trigger end scene",
"command": {
- "address": "/api/oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8/groups/0/action",
+ "address": "/api/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/groups/0/action",
"body": {
"scene": "gXdkB1um68N1sZL"
},
@@ -310,9 +310,9 @@ applies, there's no real problem with it.
GET http://bridge/api/${username}/scenes/gXdkB1um68N1sZL@@ -326,7 +326,7 @@ applies, there's no real problem with it. "3", "5" ], - "owner": "oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8", + "owner": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "recycle": true, "locked": true, "appdata": {}, @@ -365,9 +365,9 @@ specified in deciseconds).
Finally, an additional rule takes care of turning the lights off and the wake-up sensor at 9:00 (Two and a half hours after the initial @@ -382,7 +382,7 @@ triggering of the sensor).
{
"name": "Wake up 1.end",
- "owner": "oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8",
+ "owner": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created": "2018-03-11T19:46:51",
"lasttriggered": "2018-03-13T13:00:00",
"timestriggered": 2,
@@ -432,9 +432,9 @@ the bedroom, and set the sensor's flag to false
.
The wake-up config in the phone app touched on pretty much every major
aspect of the Hue bridge API. Given the insight I now have into how it
diff --git a/_drafts/2018-03-13-hue-wake-up.org b/_drafts/2018-03-13-hue-wake-up.org
index b945976..43d9c80 100644
--- a/_drafts/2018-03-13-hue-wake-up.org
+++ b/_drafts/2018-03-13-hue-wake-up.org
@@ -1,8 +1,8 @@
#+TITLE: How Does The Phillips Hue Wake-Up Feature Work?
#+STARTUP: indent
#+OPTIONS: toc:nil num:nil
-#+PROPERTY: header-args :cache yes
-#+PROPERTY: header-args:http :post anonymize(json=*this*) :proxy socks5://localhost:1214 :resolve bridge:80:192.168.1.199 :var username="uCpPPhYlWIJdOvGuyrsM2EtmaeiVvcTX0WEdAn0P" :pretty :exports both :wrap SRC js
+#+PROPERTY: header-args :cache yes :eval never-export
+#+PROPERTY: header-args:http :post anonymize(json=*this*) :resolve bridge:80:192.168.1.199 :var username="uCpPPhYlWIJdOvGuyrsM2EtmaeiVvcTX0WEdAn0P" :pretty :exports both :wrap SRC js
#+name: anonymize
#+BEGIN_SRC emacs-lisp :var json="" :exports none :results silent
@@ -41,7 +41,7 @@ a half-hour fade-in each weekday. I also toggled on the setting to
automatically turn the lights off at 9:00.
#+BEGIN_CENTER
-[[img:Screenshot_20180313-131855.png]] [[img:Screenshot_20180313-131858.png]]
+[[img:Screenshot_20180313-182434.png]] [[img:Screenshot_20180313-182438.png]]
#+END_CENTER
* Finding things on the bridge
@@ -49,14 +49,14 @@ automatically turn the lights off at 9:00.
The most natural starting point is to check the schedules. Right off
the bat, I find what I'm after:
-** The schedule
+** The schedule ...
#+BEGIN_SRC http
GET http://bridge/api/${username}/schedules/1
#+END_SRC
-#+RESULTS[d969a24ceb98afc9fdf55b6fe0e69bf8e9841a7b]:
-#+begin_example
+#+RESULTS[185c8bd9c6da61034cb699944dfb1827d2d08282]:
+#+BEGIN_SRC js
{
"name": "Wake up",
"description": "L_04_fidlv_start wake up",
@@ -73,7 +73,7 @@ the bat, I find what I'm after:
"status": "enabled",
"recycle": true
}
-#+end_example
+#+END_SRC
This is a recurring schedule item that runs every weekday at 6:30. We
can tell this by looking at the =localtime= field. From the
@@ -88,13 +88,13 @@ Since this schedule is enabled, we can be assured that it will run,
and in doing so, will issue a =PUT= to a sensors endpoint, setting a
flag to true.
-** ... triggers the sensor
+** ... triggers the sensor ...
#+BEGIN_SRC http
GET http://bridge/api/${username}/sensors/2
#+END_SRC
-#+RESULTS[f4396e8f480506f7dd144f7819d649dc4b462e57]:
+#+RESULTS[6660e5539302c8863c2d7cd9417e3996c35b2b87]:
#+BEGIN_SRC js
{
"state": {
@@ -120,13 +120,13 @@ a [[https://www.developers.meethue.com/documentation/supported-sensors#clipSenso
schedule. Essentially, by updating the flag state, we trigger the
sensor.
-** ... triggers a rule
+** ... triggers a rule ...
#+BEGIN_SRC http
GET http://bridge/api/${username}/rules/1
#+END_SRC
-#+RESULTS[9a4476721e61544936c6c613d4cb3520cfa99b61]:
+#+RESULTS[449d90a31c32d4630701c75e4655ccb6378d8655]:
#+BEGIN_SRC js
{
"name": "L_04_fidlv_Start",
@@ -168,7 +168,7 @@ to =true=. When that happens, the bridge will iterate through its
rules, find that the above condition has been met, and iterate through
each of the actions.
-** ... which sets the scene
+** ... which sets the scene ...
The bedroom group (=/groups/1= in the rule's action list) is set to
the following scene, which turns on the lights at minimum brightness:
@@ -177,7 +177,7 @@ the following scene, which turns on the lights at minimum brightness:
GET http://bridge/api/${username}/scenes/7GJer2-5ahGIqz6
#+END_SRC
-#+RESULTS[bc401edc5343c578204809ec1c80c4ea33747537]:
+#+RESULTS[acf0f0fd18efd18cdf94d2c1175f148f9cd85733]:
#+BEGIN_SRC js
{
"name": "Wake Up init",
@@ -213,7 +213,7 @@ the following scene, which turns on the lights at minimum brightness:
}
#+END_SRC
-** ... and schedules the transition
+** ... and schedules the transition ...
Another schedule (=/schedules/2= in the rule's action list) is enabled
by the rule.
@@ -221,13 +221,13 @@ by the rule.
GET http://bridge/api/${username}/schedules/2
#+END_SRC
-#+RESULTS[e77df321ae45bf4714293b29f3893dc4c9f60317]:
+#+RESULTS[b408558373a001cc2354c960171b21df2669ab85]:
#+BEGIN_SRC js
{
"name": "L_04_fidlv",
"description": "L_04_fidlv_trigger end scene",
"command": {
- "address": "/api/oV5vUaXuBwEAA6sjnvqr8n6fBLlzWLjG4x4SIyD8/groups/0/action",
+ "address": "/api/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/groups/0/action",
"body": {
"scene": "gXdkB1um68N1sZL"
},
@@ -255,13 +255,13 @@ This one, strangely, is applied to group =0=, the meta-group including
all lights, but since the scene itself specifies to which lights it
applies, there's no real problem with it.
-** ... to a fully lit room
+** ... to a fully lit room ...
#+BEGIN_SRC http
GET http://bridge/api/${username}/scenes/gXdkB1um68N1sZL
#+END_SRC
-#+RESULTS[aebfa5482ad6b3a13ccdfc1135c028f97bfcb965]:
+#+RESULTS[d73d2de48bbff9ac73185999ff3671ddf159dc0d]:
#+BEGIN_SRC js
{
"name": "Wake Up end",
@@ -313,7 +313,7 @@ triggering of the sensor).
GET http://bridge/api/${username}/rules/2
#+END_SRC
-#+RESULTS[42d351c0d43cbf15dec13438ff53997cab22d177]:
+#+RESULTS[68cbdf0c611d00ec6d86daa820d2dbe672f1d452]:
#+BEGIN_SRC js
{
"name": "Wake up 1.end",
diff --git a/images/Screenshot_20180313-131855.png b/images/Screenshot_20180313-131855.png
deleted file mode 100644
index 016e8fef932331d24dddca77d4db4fce544b8f33..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 42162
zcmZUb1yCDZw19&LEAH;@6ligGhvLPdxD>bG#ogU0?(PnyK!M_3+_kv8?LYHo-pt!f
zlXM}QyZ0Wu=X{576(wm@Btj$*2!tvtBcTSou7E&LAz*0W-4iATHShv!DXJ(60@cML
zKO4gV|0g$W7hUN<}J6U69!^6X$s`ZyvSAEXA?l|4*L=USRe2)WQ5QHwnl?84W
zO=AUb7a#u~FVq+cb91}gUl?m@N=r#qxBiK6@Vm}jvYr1##xXo*cD4F-iiDKZqOFc2
zE_!@F$NTK&a2AbBC~In8Q}ewdSGvMvIu|e&T%-^)&ZUiw-0@uv&Eh2Mj9XwF&zZn2
z$g_1d`aa$MTOch1*E!b(1NVbp`PuyLxRFEu1Q
vY8|x)x8dDb`?AK6iQcMj>uzFU`~&)
zd2>H~3wtWjn?@M=#(OL)lD*AxI3==3CG$N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