Scheduled tasks not running or at least not shutting down

So setting aside the Time Zone issue, I have the RTC reporting what I believe is the correct time:

RTC Time: time.struct_time(tm_year=2020, tm_mon=6, tm_mday=5, tm_hour=15, tm_min=43, tm_sec=40, tm_wday=4, tm_yday=157, tm_isdst=1)
Result get all Scheduled Event: bytearray(b’\x08’)
/opt/sixfab/pms/api/example# date
Fri 05 Jun 2020 03:43:41 PM EDT

This matches my timezone. I have a one-time scheduled task set to shutdown the system. I’ve tried both software and hardware shutdown. When the prescribed time arrives - nothing happens.

I made API calls to clear them all then recreated the task ID above via the interface and saved it. Still no change.

Any thoughts on what I’m doing wrong?


For future referenc this was related to the Time Zone issue - events would run but hours later than expected. I’ll wait for the time zone fix and reevaluate.

Hi Zach,
Sorry for the late reply.
Could you please update me on the progress made?

Thank you.

You mentioned in a different post that there was a known timezone issue waiting to be fixed in a firmware update. I’ve been waiting for that before I beat my head against the wall any further. My last working theory was that the power agent assumes that the system timezone is set to UTC-0. Then it tries to do some clever math based on what you select in the power portal dropdown to set the RTC to the local device timezone. If like me you already have your timezone set to US Eastern in the device OS, the clever math sets the RTC time wrong.

That might be the root of a lot of folks frustration over scheduled tasks not running or at least not running at the expected times.

EDIT: I just ran another set of tests. Scheduled soft shutdown, hard shutdown 5 minutes later, start 5 minutes later. It did not run. But I expect it will sometime a few hours from now when it thinks it’s the correct time. Bottom line though is that I think the scheduling problems are related to timezone mismatch.

EDIT2: The power agent installs its own older? version of the api called pms_api, when I use that I get different results from the get_rtc_time function than if I update to the latest API. The difference is four hours which is my timezone offset. When I update the to the latest API it removes the old one and breaks the power agent. Is the whole issue here possibly with the old API that the power agent uses?


Hi Zach,
Time zone problem is fixed with firmware 0.3.0 version. RTC time is set according to the time zone selected on the power portal. Try to set the time zone so that it works properly.

If you are having such a problem, try installing the API using virtualenv.

Initial testing with firmware 0.3.0 has the device shutting down at the correct time. Thanks. I think that will help a lot of people.

It would seem to me if the agent is going to package a different/private/conflicting version of the API should probably use library paths to reference it rather than the system default. Also there really needs to be some locking between the PMS agent and anything else using the API otherwise you get conflicts… Once the PMS agent experiences a conflict, it often never recovers and then continues to log failures forever.

I’m betting there are plenty of cases where folks will want to run the PMS agent and access the API.


Thank you for your suggestion. The conflict you mentioned will be fixed in the new software version.