dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 502 forks source link

Schedule created via API does not run after reboot #3175

Open EpicLPer opened 4 years ago

EpicLPer commented 4 years ago

Describe the bug

Using the REST API to set up a schedule which sets the duration of a Motion Sensor (Aqara Hacked one) to a lower second value every 5 seconds doesn't automatically run after restarting deCONZ.

Steps to reproduce the behavior

  1. Create a schedule by sending a POST request with the following JSON body to <deconz>/api/<key>/schdules:
    {
    "2": {
        "activation": "start",
        "autodelete": false,
        "command": {
            "address": "/api/<your-key>/sensors/3/config",
            "body": {
                "duration": 10
            },
            "method": "PUT"
        },
        "created": "2020-08-20T11:35:00",
        "description": "Sets Aqara Motion Sensor to a lower Duration",
        "etag": "xxx",
        "name": "aqara duration set",
        "starttime": "2020-08-20T17:55:36",
        "status": "enabled",
        "time": "R/PT00:00:05"
    }
    }
  2. The sensor duration will now be set to "10" every 5 seconds. Reboot deCONZ
  3. The sensor value won't be updated anymore and will only start updating after a few hours again where it seems like the schedule suddenly remembers it should be triggering :)

Expected behavior

The schedule should immediately run after deCONZ has been started.

Environment

deCONZ Logs

Not exactly sure which ones you guys specifically need for this problem but I'm happy to include them once you tell me which ones I have to send :)

Additional context

I have to do this workaround since I hacked my Aqara sensors to send motion values every 5 seconds instead of the default 90 which deCONZ has set for this sensor by default. Modifying this value only once won't make it stick and it resets itself every other minute, so by sending the above API call I set this value to 10 seconds every 5 seconds just in case. Currently I've solved this by running a cURL script in a while true loop, however I want to try and get this self-contained as much as possible which the scheduled API call is perfect for.

stale[bot] commented 4 years ago

As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

EpicLPer commented 4 years ago

Reply just to make Stale Bot go away...