Page 1 of 2

Phantom rules/apps

Posted: 05 Feb 2019 03:41
by cdogg76
Hello,

I have a couple Schedule app configurations to turn lights on/off at specified times that have become phantoms. Basically, I reconfigured those apps to change the times, but they are still running at previous times (and also at the newly configured time).

Where is this data stored in the file system on a Razberry setup? Or, is there some way to rebuild the rules (hopefully without me having to reenter all of my configurations)?

Thanks!

Re: Phantom rules/apps

Posted: 06 Feb 2019 13:03
by fez
It looks like the registered Cron events were not properly removed by the schedule app you were using.
Try report a bug by the app developer, whoever that night be.

Re: Phantom rules/apps

Posted: 06 Feb 2019 22:18
by piet66
And do a restart of zway server to remove the old cron tasks.

Re: Phantom rules/apps

Posted: 07 Feb 2019 02:38
by cdogg76
Thanks for the suggestions. It's the Schedule app that, I thought, came with the base install. I'm not sure how to submit a bug report to that.

Are these crons actually system crons i.e., via crontab, or are you referring to a proprietary scheduling system within the app? I don't see any actual crons from crontab for my scheduled items. Is there some way I can access those directly?

I'll try rebooting to see if that clears them. I can't remember if I've rebooted since I changed the schedules.

Thanks!

Re: Phantom rules/apps

Posted: 07 Feb 2019 03:25
by cdogg76
Unfortunately, the reboot didn't help.

Re: Phantom rules/apps

Posted: 07 Feb 2019 11:35
by piet66
cdogg76 wrote:
07 Feb 2019 03:25
Unfortunately, the reboot didn't help.
So it's caused by different reason than supposed.

zway cron jobs are different from Linux cron tasks. You can find them in storage/configjson.
Or via http://....ip...:8083/ZAutomation/api/v1/instances

Re: Phantom rules/apps

Posted: 09 Feb 2019 03:17
by cdogg76
Hello,

Thanks for the pointers. The file is automation/storage/configjson-... appended with a long string of what appears to be hex numbers. I'm assuming that's it.

But given the hex numbers in the filename, it makes me think this is a generated file. Is that correct? Is this what the z-way UI actually writes to for storage of schedules, or does it write to a db elsewhere, and this file gets generated from that and is what z-way actually executes? That is, is it possible that this file (configjson) might get corrupted, and I can do something to get it regenerated from the actual configurations?

Thanks!

Re: Phantom rules/apps

Posted: 09 Feb 2019 12:17
by piet66
Yes, that's the right file. config.json is an abbreviation for it. You can have a look in it to see if it's corrupted. It's not very likely.

You can do following:
1. http://<ip>:8083/ZAutomation/api/v1/instances/<your instance number> to get the stored configuration of your module instance.
Have a look in it to see whether it is what you have entered.
2. http://<ip>:8083/ZAutomation/api/v1/instances/2 to get the currently active cron jobs.
Search for the cron jobs your instance has created at runtime. Normally the cron task id has the instance number at end.
Look if the cron jobs are created correctly.

If both are correct it's not a cron problem. Perhaps other instance is running at that times? You can check all active cron jobs.

Another try: remove and recreate your instance.

Re: Phantom rules/apps

Posted: 26 Feb 2019 21:54
by cdogg76
Ok, I finally got a chance to dig into this. I had to figure out how to use Postman with cookies as the APIs you listed require authentication.

Anyway, that allowed me to see JSON of schedules, but the only reference to what was being scheduled were strings like "scheduledScene.run.40". I'm assuming those are references to the actual jobs that are stored elsewhere.

What I did was disabled all of my jobs and noticed that there were still some jobs listed. I poked around the Smarthome UI a bit and discovered that there are TWO DIFFERENT locations for scheduled actions. One is the one that I've always used under Apps -> Scheduled. What I didn't realize is that, if I click on the Settings cog at the top, I get a page with panel buttons for Scenes, Rules, Schedules, and others. I clicked on Schedules and found a whole other set of scheduled actions that are basically duplicates of what I had in Apps -> Scheduled EXCEPT they were copies--I had modified some and the old ones were here. So, I was able to disable all of these and just use the ones I'm used to in Apps -> Scheduled.

The question is, then, why do we have two separate ways of creating schedules? I'm assuming the Settings -> Schedules one is newer and, when it was introduced, a copy of my other schedules was made to this...?

Thanks!

Re: Phantom rules/apps

Posted: 03 Mar 2019 10:44
by PoltoS
Yes, this new system was introduced in v2.3.8 and apparently it messed up few things. We will check it