Support for getting if an alarm is enabled and the time of the alarm would be a great addition to the Device API. It is now only possible to set the times which allows the LaMetric to be controlled, but my use case is the inverse, where I would like to be able to set the alarm on the LaMetric and use that information to create a wake-up light.
That's fast! Thanks! So no real output on the set Alarm, assuming you've set an alarm time?
Probably not going anywhere, but could you try this one:
$ curl -X GET -u "dev" -H "Accept: application/json" -k \ https://<device ip address>:4343/api/v2/device/apps/com.lametric.clock/08b8eac21074f8f7e5a29f2855ba8060 $ Enter host password for user 'dev': <device api key>
Actually I curl-ed it twice, first with 3 alarms (all of them set but disabled), then added another enabled alarm... with the same result as posted.
As for the 2nd curl, it returns
"message":"Authorization is required"
after entering my api key. A while ago, I actually ordered an ALFA wifi adapter in order to "MITM" my lametric, but didn't have the time yet to setup a "sniffing" AP... another one for the "home projects" backlog ;-)
Allright, too bad I couldn't help out. Sweet on the ALFA, I'd be all ears to see what you'l get out of it!
I'm going to do some more reading, still think the solution is somewhere obvious.. Maybe create an own app and use it as an alarm?
Thinking a bit more about it, mweb previously mentioned that he thinks that the undocumented v1 api is used by the LaMetric app. Did you install the LaMetric app, and made use of a username/password for that app?
After you have the LaMetric app installed on a phone/tablet and established a connection to you LaMetric with the app, could you try the v1 version of that cURL that mweb posted earlier?
Piotr, looking at your post where you changed the output: "[some-string-i-changed]". That's your UUID right?
Could you try:
$ curl -X GET -u "dev" -H "Accept: application/json" -k \ https://<device ip address>:4343/api/v2/device/apps/com.lametric.clock/YOUR-UUID $ Enter host password for user 'dev': <device api key>