AppDaemon 4 problem run_every now

Hello,

I am currently trying to get some script working and to have it run every 2 minutes. This is what I have:

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

class Test(hass.Hass):

  def initialize(self):
      self.log("Test appdaemon")
      self.run_every(self.run_every_c, "now", 2*60)

  def run_every_c(self):
      self.log("Test appdaemon 1")

According to the documentation, this should work:
Run every 10 minutes starting now.
>>> self.run_every(self.run_every_c, "now", 10 * 60)

So why am I getting this error?
AttributeError: 'str' object has no attribute 'tzinfo'

Thanks in advance!

see

Thanks for the reply.
But do you have a clue why “now” is not working? This is added in version 4.0.4 according to the documentation.

@rednas,

The official release is on 4.0.3. If wanting to use now, you have to switch to the dev version, which is on 4.0.4.

Regards

That explains a lot!
Where can I find this version information of the official release and of the dev version?

You can check your logs. When AD starts up, it will show the version you running within the first 3 lines, alongside the python version.

If running in Hassio, this might be different, buy you should still get the AD version, but it will be some lines below.

Regards