Why is my run_minutely() only running once ever?

I’ve got a weird issue. Everywhere on here I see people saying that run_minutely() should set a scheduler that keeps running every minute, but that is not what I’m seeing. My function is only run once and then forgotten it seems.

What am I doing wrong?

import appdaemon.plugins.hass.hassapi as hass
import datetime


class AzizLight(hass.Hass):

    def initialize(self):
        self.run_minutely(self.do_it(), datetime.time(0, 0, 0))

    def do_it(self):
        self.log('This happened!')

I only get a single “This happened!” follow by the “AppDaemon: App initialization complete” message in my appdaemon.log, and nothing in my error.log.

I’ve tried a lot of different things for the time argument, including datetime.time(0, 0, 1) and None. Nothing seems to have any change on its behavior. It runs once and calls it quits. I double-checked that the AppDaemon service on my Ubuntu box is still going, so I’m not killing it!

that command is wrong causing your trouble.

a callback is without ()
with () it is a function that gets called once.

so your command needs to be:

self.run_minutely(self.do_it, datetime.time(0, 0, 0))
1 Like

Ohhhhh! Thank you! I’m off and running now. Thank you so much! I spent all afternoon on the real code and was pretty bummed when I couldn’t get it to trigger properly. Now it is all working perfectly! Thank you for taking the time to help me!

1 Like