Hi everybody,
I installed ad-ench
(github), hoping to finally manage my battery devices, or rather, be notified when batteries are running low.
However, when I change something in apps.yaml
(to trigger reloading ench
), I get this
2020-05-19 15:55:00.319878 INFO AppDaemon: Initializing app ench using class EnCh from module ench
2020-05-19 15:55:00.322201 WARNING AppDaemon: ------------------------------------------------------------
2020-05-19 15:55:00.322325 WARNING AppDaemon: Unexpected error initializing app: ench:
2020-05-19 15:55:00.322416 WARNING AppDaemon: ------------------------------------------------------------
2020-05-19 15:55:00.322669 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 2051, in check_app_updates
self.init_object(app)
File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1567, in init_object
modname = __import__(app_args["module"])
File "<fstring>", line 1
(await self._name(entity))
^
SyntaxError: invalid syntax
I am using the official appdaemon docker container; since I couldn’t figure out what did this, I already tried the following
-
looked through
ench.py
; in line 37, there isAPP_REQUIREMENTS = {"adutils~=0.4.9"}
; if I understand correctly, the other file in the folderpkg_helper.py
is supposed to install this package for us, but I still createdrequirements.txt
in the appdaemon root folder and inserted the lineadutils~=0.4.9
. Then I restarted the docker container and immediately started log output, where I could see that adutils was installed (so it had probably not been installed by thispkg_helper.py
file. -
line 57 states
LEVEL_ATTRIBUTES = ["battery_level", "Battery Level"]
, however, some of my devices have the attributebattery
only, so I modified the line toLEVEL_ATTRIBUTES = ["battery_level, Battery Level", "battery"]
; I did this because the particular sensor that I manually change to trigger ench does not have abattery_level
attribute but abattery
attribute.
It still does not work.
The part about ench in apps.yaml
ench:
module: ench
class: EnCh
notify: notify.me
show_friendly_name: false
exclude:
- sensor.arbeitszimmer_tuer_battery
battery:
interval_min: 1
min_level: 20
unavailable:
interval_min: 30
notify: notify.me
stale:
max_stale_min: 15
entities:
- sensor.arbeitszimmer_tuer_battery
I realized that when I change notify.me
to "notify.me"
, there will not be an error in the appdaemon logs; however, there will not be any notification, either. I don’t have any low batteries at the moment as far as I can tell, but manually changing the value in developer settings ought to trigger this as well, right?
What do you suggest I try/change to make this work? Low/dead batteries are one of the few problems I haven’t found a decent solution for yet, and I was really hoping that this appdaemon script would change that.
Thank you for your ideas