I am trying to get Occusim up and running and I can’t get it to fire the event. I don’t see anything in the logs that look like errors or point me in a direction. Below are my config files and logs.
editt: I can’t seem to get the formatting to show properly, sorry
date stream content
2017-08-23 10:35:32 stdout 2017-08-23 10:35:32.720823 INFO New dashboard connected: Main Panel
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.670849 INFO Connected to Home Assistant 0.51.2
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.655854 INFO Starting dashboard
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.655371 INFO App initialization complete
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.653632 INFO Loading Object Occupancy Simulator using class OccuSim from module occusim
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.652563 INFO Loading Module: /conf/apps/occusim.py
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.652262 INFO hello_world: You are now ready to run Apps!
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.650176 INFO hello_world: Hello from AppDaemon
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.476937 INFO Loading Object hello_world using class HelloWorld from module hello
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.474687 INFO Loading Module: /conf/apps/hello.py
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.473547 INFO Got initial state
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.289342 INFO Configuration read from: /conf/appdaemon.yaml
2017-08-23 10:35:28 stdout 2017-08-23 10:35:28.289008 INFO AppDaemon Version 2.0.3 starting
To format code paste it in the edit box, select it with a spare line either end and press the </> button on the editor menu i.e. just above where i’m writing this.
The reason it was “working” when you separated the files is because the OccuSim file was being ignored.
The problem is that when defining a random, you need to give it a fixed event as start and stop, not times. So you need to define 2 steps, one for the beginning of the period, one for the end - e.g.:
step_evening_name: Evening
step_evening_start: 16:00:00
step_evening_name: Night
step_evening_start: 23:59:59
Then use Evening and Night instead of 04:00:00 and 12:30:00.
Couple of other points, the app uses military time, so as you have the times it would come on at 4am and stop at 12:30 pm , I suspect that’s not what you want so I corrected the times above.
Also, there is a limitation in that you can;t schedule events for the next day,so I adjusted that above also.
I was able to get it working. Thank you. I have a few questions.
Can Occusim use switches or do I need to setup scenes instead?
Also when I look at the log times they are several hours in the future and this effects the timing that I have to put. If i use the local time that I want an event to fire I get an error message “Ignoring, event in the past.” For example, it currently is 1:48PMCST but my log shows 18:48. I’ve searched for additional TZ files on my server but they all show the correct timezone. I have added time_zone: America/Chicago but no effect, also the other containers I have running are not effect and show the correct time.
I was able to get everything working and it worked perfectly.
The only thing I noticed is that there were instances were the light would be on the next day. Normally it’s lights out around 11PM-12AM so having a light on all night could show someone that we are gone because it’s out of our normal schedule, if someone was paying close attention. Is there a way to make sure the lights are off by a certain time or at the end of the random schedule?
I am having some issues with Occusim. I finally got around to updating AppDaemon to 2.1.10 today (Previously I was using the .cfg files) so I may have some things missing. It appears that AppDaemon and Occusim are running from the log but when I used to have it up and working the times posted out in the Log File. So I am afraid it is not working correctly. Below is my Log File now:
2017-10-19 12:39:24.575698 INFO AppDaemon Version 2.1.10 starting
2017-10-19 12:39:24.575794 INFO Configuration read from: conf/appdaemon.yaml
2017-10-19 12:39:24.678636 INFO Starting Apps
2017-10-19 12:39:24.796213 INFO Got initial state
2017-10-19 12:39:24.796562 INFO Loading Module: conf/apps/occusim.py
2017-10-19 12:39:24.796880 INFO Loading Module: conf/apps/switch_reset.py
2017-10-19 12:39:24.797433 INFO App initialization complete
2017-10-19 12:39:24.797543 INFO Dashboards are disabled
2017-10-19 12:39:24.797586 INFO API is disabled
2017-10-19 12:39:24.841851 INFO Connected to Home Assistant 0.55.0
Also here is my configuration file which is now a .yaml file:
One of the recent changes in AD was to move all of the App configuration into a separate file called apps.yaml - you will need to move every thing in the occusim section to a new file with that name then you should be good to go.
Ok just one last question. So my times are now showing up in the log after I split the files. But I noticed that the reset time wouldn’t work unless I put them in single quotes and made it a string like ReneTode said. The question is do I have to make all my times strings because the others seem to show up in the log even though they are not strings?
if it works, it works
but to be sure, you can better keep in mind to use the times in quotes.
and to make sure you dont forget that when you edit in the future, you better change them all to quotes.
i havent looked at the code but i know andrew a bit, and i am sure that quoted times will work in all cases.
Actually, ther culprit here is YAML - it tries to interpret 0 or 1 as true and false unless you put quotes around it. One of YAML’s greatest misfeatures in my opinion!