Datetime.time -15 minutes

IOh… sorry guys out of town at kubeconf this week.

App works… well enough to get by. The issue seemed to be that one of the overlapping run_daily functions wasn’t going off but I’m not 100% certain of that and need to find time to design a test… or just punt and redo the app in the manner initially suggested by@ReneTode using a single run_daily containing multiple run_ ins. Haven’t decided either way.

Its not that critical right now given that the morning routine changes “mode” at the end and that turns the furnace on anyway. Basically 7 minutes later, so not the end of the world for me.

Again, my strategy here is to rough all functionality in then iterate later so I more or less just noted and moved on for now. Plenty of higher priority work to do.

Oh just saw this… I’ll try that when I get home.

you dont need to test.
you can have 100000 rundailys at exact the same time, thats how AD is designed.
thats why i asked you to look at the logs, because you have logging, and only the logs can tell if the rundaily did start or not, or if you have an error somewhere.
unless you did set threads to 1 in appdaemon.yaml thats another thing that could cause trouble.

Yeah my problem with the logs is that I’m running appDaemon from hass.io and the logs go to stdout, which are then captured and displayed in the gui with a rather short buffer. This automation fires in the morning and by the time… well, as you guys can probably tell I have an espresso first thing and by the time I’m done the logs are scrolled out by other automations firing.

I tried getting the logs from the container directly with docker but there is no access to the docker command from the ssh container… so… here they are from the console of my VirtualBox. This was the last run from monday morning. This app hasn’t run since because I’m out of town and it’s constrained by “mode”.

So it looks like the hvac function indeed never kicks off, it it had we’d see a log entry for it at 8:08:00:

So this?

 def run_lights(self, kwargs):
   self.log("Starting lights")
   self.fire_event("MODE_CHANGE", mode = "Morning")
   self.brightness = 1
   self.fade(None)

instead of self.fade(self)? What does this change? I understand why there would be no need to pass a copy of the entire app object to the fade function, but why would that have blocked the next run_daily?

I can guess how this ended up like this. I think I tried self.fade() and got back an error about argument counts so I stuck a “self” in there.

you can set your logs in appdaemon.yaml.
that way you can capture them over time.

did you ever restart appdaemon?
i wonder if the changes did take place at all, and if it is still running with some stuff from the past.

you could change the self.fade but i dont think it will do much.

the run_daily wont be blocked (unless you did set threads to 1 in appdaemon.yaml, you didnt did you??)
it didnt get initialised or it started with an error

i would first set your logs so you can see more. then restart appdaemon, then i need the app as it is once more. and we need to look at the logs. without logs you have nothing to go on.

I’m running hassio, this is what I use for the log in app daemon.yaml

log:
  errorfile: /config/appdaemon/errors.log
  logfile: /config/appdaemon/log.log
  log_generations: 3
  log_size: 1000000

Posting from phone if format isn’t good

Yeah logging is working. I have restared appDaemon. This app won’t run again until I’m home friday morning however. I’ll post the logs then.

1 Like
018-12-14 07:30:00.026619 INFO wakeup: Starting Espresso Machine
2018-12-14 08:00:00.008352 INFO wakeup: Starting lights
2018-12-14 08:10:00.056766 INFO wakeup: Starting HVAC
2018-12-14 08:10:00.182458 INFO wakeup: Spam Rheem Mode: Heating
2018-12-14 08:10:00.215926 INFO wakeup: Spam Rheem Mode: Heating
2018-12-14 08:10:00.245875 INFO wakeup: Spam Rheem Mode: Heating
2018-12-14 08:15:00.010495 INFO wakeup: Starting Wakeup

Hmm… well everything went off as it should this morning. Hard to tell what the fix was since I made several changes over the last few days, not the least of which was the “switch.hot_water_tank” below. Previously it was incorrectly “switch.hotwater_tank”. I also pushed the time back a couple of minutes. In any event, all working as it should.

  def run_hvac(self, kwargs):
    self.turn_on("switch.hot_water_tank")
    self.log("Starting HVAC")
    self.hvac_mode("Heating")
1 Like

if you had it in that order and the switch wasnt correct that could have stopped the function.
you would have noticed in the logs.

but now you have logs so you can better look at what is happening.

glad it works now.