Start a new topic
Answered

Start and stop screensaver mode via local API?

Hi,


is it possible to start (and stop) the LaMetric screensaver mode (where only the clock is shown) via a local http API call?


My idea is to activate the screensaver when my home switches to "night mode" (I have a button for that next to my bed) and vice versa in the morning. The same would apply for an away mode. Both would be better suited for me than fixed times.


I am grateful for every hint!




Best Answer

In the meantime I had contact with LaMetric support and they explained how to do this. I integrated this into my routines and it works great.


API call to turn screensaver on:


PUT https://<device ip address>:4343/api/v2/device/display

Content-Type: application/json
Accept: application/json

{
    "screensaver": {
        "enabled" : true,
        "mode": "time_based",
        "mode_params": {
            "enabled": true,
            "start_time": "21:00:00",
            "end_time": "20:59:59"
        },
        "widget":"08b8eac21074f8f7e5a29f2855ba8060"
} }

API call to turn screensaver off:

PUT https://<device ip address>:4343/api/v2/device/display

Content-Type: application/json
Accept: application/json

{
    "screensaver": {
        "enabled" : false
    }
}

I would also be interested in this functionality.

Answer

In the meantime I had contact with LaMetric support and they explained how to do this. I integrated this into my routines and it works great.


API call to turn screensaver on:


PUT https://<device ip address>:4343/api/v2/device/display

Content-Type: application/json
Accept: application/json

{
    "screensaver": {
        "enabled" : true,
        "mode": "time_based",
        "mode_params": {
            "enabled": true,
            "start_time": "21:00:00",
            "end_time": "20:59:59"
        },
        "widget":"08b8eac21074f8f7e5a29f2855ba8060"
} }

API call to turn screensaver off:

PUT https://<device ip address>:4343/api/v2/device/display

Content-Type: application/json
Accept: application/json

{
    "screensaver": {
        "enabled" : false
    }
}

1 person likes this
Login or Signup to post a comment