benleb / ad-notifreeze

❄️ AppDaemon app which reminds to close windows if temperature difference inside/outside exceeds a specified threshold
Apache License 2.0
18 stars 7 forks source link

Warnings in LOG and usage delay #15

Open jokerigno opened 2 years ago

jokerigno commented 2 years ago

Hi,

I created 2 instances of notifreeze to have 2 different timout:

When using it I see a lot of warning in AppDaemon log and it is working more slowly (disappeared after commented the notifreeze app).

2022-01-29 15:57:15.168776 WARNING AppDaemon: Excessive time spent in utility loop: 11196.0ms, 11196.0ms in check_app_updates(), 0.0ms in other 2022-01-29 15:57:22.823897 WARNING AppDaemon: Excessive time spent in utility loop: 6529.0ms, 6529.0ms in check_app_updates(), 0.0ms in other 2022-01-29 15:57:33.672640 WARNING AppDaemon: Excessive time spent in utility loop: 9709.0ms, 9709.0ms in check_app_updates(), 0.0ms in other 2022-01-29 15:57:42.585131 WARNING AppDaemon: Excessive time spent in utility loop: 7730.0ms, 7730.0ms in check_app_updates(), 0.0ms in other

Here are the config:


notifreeze1:
  module: notifreeze
  class: NotiFreeze
  notify_service: script.my_notify
  always_notify: true
  outdoor: sensor.dark_sky_apparent_temperature
  max_difference: 10
  #forked da fare pull request
  locale: it_IT
  delays:
    initial: 30
    reminder: 30
  messages:
    since: "La {entity_name} in {room_name} è aperta da {open_since}."
    change: "La {entity_name} in {room_name} è aperta da {open_since}: la temperatura è cambiata di ({indoor_difference}°C)."
  rooms:
    - name: Soggiorno
      door_window: binary_sensor.portafinestrasoggiorno
      indoor: sensor.temperatura_soggiorno
    - name: Studio
      door_window: binary_sensor.001558a99d4529_state
      indoor: sensor.temperatura_studio
    - name: Camera da Letto
      door_window: binary_sensor.001558a99d4a8d_state
      indoor: sensor.temperatura_camera_da_letto
    - name: Camera di Adele
      door_window:
        - binary_sensor.portafinestracameradiadele
        - binary_sensor.001558a99ef4be_state
      indoor: sensor.temperatura_camera_di_adele

notifreeze2:
  module: notifreeze
  class: NotiFreeze
  notify_service: script.my_notify
  always_notify: true
  outdoor: sensor.dark_sky_apparent_temperature
  max_difference: 10
  #forked da fare pull request
  locale: it_IT
  delays:
    initial: 60
    reminder: 45
  messages:
    since: "La {entity_name} in {room_name} è aperta da {open_since}."
    change: "La {entity_name} in {room_name} è aperta da {open_since}: la temperatura è cambiata di ({indoor_difference}°C)."
  rooms:
    - name: Cucina
      door_window:
        - binary_sensor.finestra_cucina
        - binary_sensor.portafinestracucina
      indoor: sensor.temperatura_cucina
    - name: Bagno Principale
      door_window: binary_sensor.001558a99d4e50_state
      indoor: sensor.temperatura_bagno_principale
    - name: Bagno Secondario
      door_window: binary_sensor.001558a99ef07a_state
      indoor: sensor.temperatura_bagno_secondario

any suggestion?

clipse2004 commented 2 years ago

Hey Joker i got it working

in the notifreeze.py search this:

            # create state listener for all door/window sensors
            if room.door_window and room.temperature:
                for entity in room.door_window:
                    if self.entity_exists(entity):
                        await self.listen_state(self.handler, entity=entity, room=room)

and change self.handler, entity=entity to self.handler, entity_id=entity

My notifreeze is now working Again :)