Open khad opened 3 years ago
Hi @khad !
I am looking into this. Unfortunately, the Philips API is pretty limited and tailored to the app. I see no way (currently) to trigger a wakeup via API.
Currently, it looks like the best solution is to update the alarm to run X number of minutes from now (X being the duration you would set in the config file.
There's no documentation on the API so everything so far has been me piecing things together by calling something in the app and inspecting the GET response in the API.
If I look at:
https://SOMNEO_IP/di/v1/products/1/wualm/prfwu
I get the response
{
"prfnr": 1,
"prfen": false,
"prfvs": true,
"pname": "",
"ayear": 0,
"amnth": 0,
"alday": 0,
"daynm": 254,
"almhr": 7,
"almmn": 0,
"curve": 20,
"durat": 30,
"ctype": 0,
"snddv": "off",
"sndch": " ",
"sndlv": 12,
"sndss": 0,
"pwrsz": 0,
"pszhr": 0,
"pszmn": 0
}
From what I can tell,
prfnr
is the alarm ID (I'd just default to 1)
almhr
is the hour the alarm starts (7 for 7:30)
almmn
is the minute the alarm starts (30 for 7:30)
curve
is light intensity (1 - 25)
durat
is the wakeup program duration
ctype
is the Scene Type (Carribean Red etc)
snddv
is the sound source (an enumeration of sounds or FM or aux or Off)
sndch
is used if it's FM (1 - 5)
sndlv
is the volume
There's more settings to set I'm sure. I need some time to dig through. Things have been busy in my house.
Thank you for your continued interest in this plugin!
Currently, it looks like the best solution is to update the alarm to run X number of minutes from now (X being the duration you would set in the config file.
Smart! Yeah, I could make a setup like that work in some automations.
And I fully appreciate that this is a passion project. Home life comes first. 👍
At the moment, I don't see a way to use the wake-up light using this plugin. Would it be possible to add support for the alarms? Or even just the wake-up light that fades in over the course of a set amount of time?
Configuration could be similar to that of the Sunset Program. It would just require a bit of mental math depending on when you wanted it to be at its brightest.
For example, if I had a trigger in HomeKit to turn this on at 6:00 AM, it would fade in the light over 30 minutes to reach full brightness at 6:30 AM:
I'm still using the Philips app for alarms and would love to be rid of it if possible. :)