Thanks for feedback. I am somehow loosing my schedules. They are still correctly in the automation section, but don't get fired anymore after a while.
This behaviour started after I played with Daylight. For that reason I went through your code, but could not fine a clue there. It seemed a correlation. I have some suspician towards logical rules, but would know why. Anyhow I removed all of them as well. See what happens next.
I wonder where the CRON module stores it settings so I could see if those had disappeared....
[userModule] Daylight (updated 2015-07-05)
Re: [userModule] Daylight (updated 2015-01-01)
Since 29-12-2016 I am no longer a moderator for this forum
Re: [userModule] Daylight (updated 2015-01-01)
Yes, I can't find anything obvious in the Daylight module either. I looked at the cron module, as far as I can tell it does not store any settings. I think the idea is that all modules register their events when they are (re-)started.
What you could try is to change the following line in the Cron module:
I changed it to:
This will make the cron module log the registration of events from other modules.
Also, after the line:
I added the line:
So that the module also logs when an event is removed.
With such logging you might be able to see whether all events are registered in case of a re-start. Or there is some time when the events are removed.
What you could try is to change the following line in the Cron module:
Code: Select all
// console.log(JSON.stringify(self.renderSchedule(schedule))); // debug !
Code: Select all
console.log("Cron:" + eventName + ";" + JSON.stringify(self.renderSchedule(schedule)));
Also, after the line:
Code: Select all
delete self.schedules[eventName];
Code: Select all
console.log("Cron:" + eventName + " removed");
With such logging you might be able to see whether all events are registered in case of a re-start. Or there is some time when the events are removed.
Re: [userModule] Daylight (updated 2015-01-01)
I'll try it in a couple of days when I have finished my test to see if the system is stable on scenes and schedules only
Since 29-12-2016 I am no longer a moderator for this forum
Re: [userModule] Daylight (updated 2015-01-01)
I updated to v2.0.1-rc12 and now it looks like the sensor no longer updates automatically. Unfortunately the update also removed the logging I added to the cron module. So I don't have good logging yet, but I will look into it.
EDIT:
Hmmm, it looks like the modules are loaded in a random order. If daylight is loaded before the cron module, then the events it needs are not registered.
Also, I found that z-way triggers events based on the sensor even if the code sets sensor to the same value it already has.
That last bit is easy to solve, but I don't know if I can influence the order in which modules are loaded.
EDIT2:
Actually I can just add a dependency to module.json.
Ok, I think it should work better now. Version 0.3.0 is available in the first post of this thread.
EDIT:
Hmmm, it looks like the modules are loaded in a random order. If daylight is loaded before the cron module, then the events it needs are not registered.
Also, I found that z-way triggers events based on the sensor even if the code sets sensor to the same value it already has.
That last bit is easy to solve, but I don't know if I can influence the order in which modules are loaded.
EDIT2:
Actually I can just add a dependency to module.json.
Ok, I think it should work better now. Version 0.3.0 is available in the first post of this thread.
Re: [userModule] Daylight (updated 2015-02-09)
Well that is nicely timed. I was about to reinstantiate Daylight. (I now have only the scenes and schedules running. It is stable for about a week)
Re: [userModule] Daylight (updated 2015-01-01)
module.json needs update to this numbermhorst wrote:Version 0.3.0 is available in the first post of this thread.
-
- Posts: 100
- Joined: 31 Jan 2015 21:09
Re: [userModule] Daylight (updated 2015-02-09)
how do I install user modules?
Re: [userModule] Daylight (updated 2015-02-09)
RottenMutt wrote:how do I install user modules?
- Copy the package files to folder:
Code: Select all
/opt/z-way-server/automation/userModules
- Restart z-way-server
- Via HA interface -Preferences/Modules/Environment select Daylight modules
Re: [userModule] Daylight (updated 2015-02-09)
can somebody explain in one sentence the difference between this modul (daylight) and the module SunriseSunset?
thanks!!
thanks!!
Re: [userModule] Daylight (updated 2015-02-09)
Daylight creates a sensor which is on during the day and off at night. To be used with LogicalRules. These rules can trigger scenes
SunriseSunset is yet an other Scheduler where you can activate a scene. IIRC with this module you can specify positive/negative time offsets with sunrise/sunset.
Daylight via a LogicalRule combined with DelayedScene, can activate only after the sunset/rise event.
(If you cheat with the Longitude setting in DayLight you fire events earlier. Daylight seems to allow multiple instances, but I havent tested that)
Sorry that it is a bit more than one sentence
SunriseSunset is yet an other Scheduler where you can activate a scene. IIRC with this module you can specify positive/negative time offsets with sunrise/sunset.
Daylight via a LogicalRule combined with DelayedScene, can activate only after the sunset/rise event.
(If you cheat with the Longitude setting in DayLight you fire events earlier. Daylight seems to allow multiple instances, but I havent tested that)
Sorry that it is a bit more than one sentence