benleb / ad-automoli

💡 Fully automatic light management based on conditions like motion, illuminance, humidity, and other clever features
https://github.com/benleb/ad-automoli
MIT License
110 stars 29 forks source link

Natural time error #67

Closed gogui63 closed 3 years ago

gogui63 commented 3 years ago

Hello,

I've many error related to attribute "natural_time" I don't use time like sunset , all my time are absolute

  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 798, in async_worker
    await funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 375, in switch_daytime
    f"{action_done} daytime {hl(daytime['daytime'])} → "
AttributeError: module 'adutils' has no attribute 'natural_time'

2021-02-04 23:30:02.027810 WARNING auto_lights_cuisine: ------------------------------------------------------------
2021-02-04 23:30:03.021039 WARNING auto_lights_hall: ------------------------------------------------------------
2021-02-04 23:30:03.021710 WARNING auto_lights_hall: Unexpected error in worker for App auto_lights_hall:
2021-02-04 23:30:03.022418 WARNING auto_lights_hall: Worker Ags: {'id': '0313b4cd4a1542d28e46a28cb7857d54', 'name': 'auto_lights_hall', 'objectid': 'c893f74b698742f59fef64076c03404b', 'type': 'scheduler', 'function': <bound method AutoMoLi.switch_daytime of <automoli.AutoMoLi object at 0x7f4bbdf63ee0>>, 'pin_app': True, 'pin_thread': 3, 'kwargs': {'interval': 86400, 'random_start': -5, 'random_end': 5, 'daytime': {'daytime': 'late', 'delay': 120, 'starttime': '23:30:00', 'light_setting': 20, 'is_hue_group': False}, '__thread_id': 'MainThread'}}
2021-02-04 23:30:03.023059 WARNING auto_lights_hall: ------------------------------------------------------------
2021-02-04 23:30:03.023943 WARNING auto_lights_hall: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 798, in async_worker
    await funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 375, in switch_daytime
    f"{action_done} daytime {hl(daytime['daytime'])} → "
AttributeError: module 'adutils' has no attribute 'natural_time'

2021-02-04 23:30:03.024551 WARNING auto_lights_hall: ------------------------------------------------------------
2021-02-05 00:00:55.020679 WARNING auto_lights_hall: ------------------------------------------------------------
2021-02-05 00:00:55.021206 WARNING auto_lights_hall: Unexpected error in worker for App auto_lights_hall:
2021-02-05 00:00:55.021628 WARNING auto_lights_hall: Worker Ags: {'id': 'b36bb79e5c214e6c88b4e4b2ab0afbe2', 'name': 'auto_lights_hall', 'objectid': 'c893f74b698742f59fef64076c03404b', 'type': 'scheduler', 'function': <bound method AutoMoLi.switch_daytime of <automoli.AutoMoLi object at 0x7f4bbdf63ee0>>, 'pin_app': True, 'pin_thread': 3, 'kwargs': {'interval': 86400, 'random_start': -5, 'random_end': 5, 'daytime': {'daytime': 'night', 'delay': 120, 'starttime': '00:01:00', 'light_setting': 1, 'is_hue_group': False}, '__thread_id': 'MainThread'}}
2021-02-05 00:00:55.022017 WARNING auto_lights_hall: ------------------------------------------------------------
2021-02-05 00:00:55.022566 WARNING auto_lights_hall: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 798, in async_worker
    await funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 375, in switch_daytime
    f"{action_done} daytime {hl(daytime['daytime'])} → "
AttributeError: module 'adutils' has no attribute 'natural_time'

My config :

  module: automoli
  class: AutoMoLi
  room: hall
  motion_state_on: "on"
  motion_state_off: "off"
  disable_switch_entities: input_boolean.is_jour
  delay: 120
  daytimes:
    - { starttime: "00:01", name: night, light: 1 }
    - { starttime: "05:30", name: morning, light: 20 }
    - { starttime: "07:30", name: day, light: 100 }
    - { starttime: "22:30", name: evening, light: 50 }
    - { starttime: "23:30", name: late, light: 20 }
  illuminance: 
    - sensor.illumination_couloir
  illuminance_threshold: 100
  lights:
    - light.hall_couloir
  motion:
    - binary_sensor.motion_sensor_hall_couloir

Do you have an Idea how to fix it ?

Thanks :) !

benleb commented 3 years ago

seems like my fault ;) fix in progress :)

benleb commented 3 years ago

@gogui63 pushed a commit to master seconds ago, could you please check if that's resolving the issue? :) thanks!

gogui63 commented 3 years ago

I didn't see your commit on master yet Last commit : 26 jan https://github.com/benleb/ad-automoli/commit/df74903a7007ffe70a517a45a0f6597d4d4fbf35

benleb commented 3 years ago

sorry, forgot to push :D it's there now

gogui63 commented 3 years ago

Yep , seems to be fixed ! Thanks 👍