first lets see if we get it to work as i expect
my garbage collection calender we had way before i automated.
every collection is put in there 1 day before it gets collected as a whole day event, so that my wife always knows it gets collected tommorow.
in the message text it say garbage gets collected tommorow.
in the app i take out the text tommorow and set the date 1 day later so it shows the real date and says: garbage gets collected.
and because i have a sound app that lets me use TTS from apps, i let on the day before, every hour the TTS say that garbage gets collected tommorow, untill my wife flips a boolean (through the dashboard) telling HASS that the garbage is out.
you see its quite specific, so i made a var to disable that part. i could take it out, but then i would have 2 seperate apps to maintain.
As I wasn’t running apps before, and then my calendar.yaml these are the only settings I changed,
calendarid: xxxx@xxxxxxxxxxx
amount: '5'
htmlfile: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/calendar.html # the file that you show in the dashboard
client_secret_file: client_secret_xxxxxxx-xxxxxxxxx.apps.googleusercontent.com.json # the name from the secret_file
credential_dir: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/ # the dir where the secret file is
Not sure if the full path’s is a problem ?
Randomly, also all my background css colours have stopped working as well.
I was getting the same error then created the calendar.html file in the folder I wanted generated and error went away, however now I am getting the following one:
2018-06-03 10:39:26.719138 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/calendar.py
2018-06-03 10:39:26.722605 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 10:39:26.722743 WARNING AppDaemon: Unexpected error loading module: /config/appdaemon/apps/calendar.py:
2018-06-03 10:39:26.722813 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 10:39:26.730663 WARNING AppDaemon: Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 2015, in check_app_updates
self.read_app(mod[“name”], mod[“reload”])
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 1789, in read_app
importlib.reload(self.modules[module_name])
File “/usr/lib/python3.6/importlib/init.py”, line 166, in reload
_bootstrap._exec(spec, module)
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/appdaemon/apps/calendar.py”, line 2, in
import httplib2
ModuleNotFoundError: No module named ‘httplib2’
Home Assistant (Hass.io image running on CentOS 7): 0.70
App Daemon: latest
Not sure how can I get extra modules of python installed in Hass.io image.
I read somewhere to have the sources of the modules in the app folder, but I believe that can be a tedious work cause of dependencies, I am new to python and somehow lost with this. But as I understand hass.io is a docker self contained image. So not sure adding extra modules is possible.
did you restart appdaemon after you did edit appdaemon.yaml?
please clear the logs an then restart appdaemon and show me the log from the start.
i want to see if there is another problem, and maybe with filerights.
the appdaemon user needs full rights on all files in the config directory.
did you check if all the new created files and directories have the right rights?
@claudiopi you didnt install google api client in the appdaemon environment.
and without that you cant connect to google.
i thought that they already made it possible to install other libs in the hassio appdaemon addon, but i dont know how.
i really cant support such hassio problems, because i dont have access to hassio and no knowledge how its setup or works (other then what i come accross on the forum)
so to solve the problem from installing the api client inside the appdaemon addon i refer you to the hassio section from the forum.
sorry.
2018-06-03 16:10:39.107865 INFO AppDaemon Version 3.0.1 starting
2018-06-03 16:10:39.108641 INFO Configuration read from: /home/homeassistant/.homeassistant/appdaemon/appdaemon.yaml
2018-06-03 16:10:39.114027 INFO AppDaemon: Starting Apps
2018-06-03 16:10:39.115867 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-06-03 16:10:39.124581 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-06-03 16:10:39.162071 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-06-03 16:10:39.163400 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-06-03 16:10:39.164401 INFO Starting Dashboards
2018-06-03 16:10:39.167827 WARNING css: /home exists, but is not writeable, owner: root
2018-06-03 16:10:39.170975 WARNING javascript: /home exists, but is not writeable, owner: root
2018-06-03 16:10:39.184756 INFO API is disabled
2018-06-03 16:10:39.200949 INFO AppDaemon: HASS: Connected to Home Assistant 0.70.0
2018-06-03 16:10:39.250760 INFO AppDaemon: Got initial state from namespace default
2018-06-03 16:10:40.734199 INFO HADashboard: New dashboard connected: Music
2018-06-03 16:10:41.372373 INFO AppDaemon: Reading config
2018-06-03 16:10:41.476602 INFO AppDaemon: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/calendar.yaml added or modified
2018-06-03 16:10:41.478362 INFO AppDaemon: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/calendar.yaml added or modified
2018-06-03 16:10:41.479678 INFO AppDaemon: App 'hoofdagenda' added
2018-06-03 16:10:41.481176 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/appdaemon/apps to module import path
2018-06-03 16:10:41.482986 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app to module import path
2018-06-03 16:10:41.485314 INFO AppDaemon: Loading App Module: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/calendar.py
2018-06-03 16:10:41.487116 INFO AppDaemon: Initializing app hoofdagenda using class calendar from module calendar
2018-06-03 16:10:41.503717 INFO AppDaemon: App initialization complete
2018-06-03 16:11:45.269336 INFO HADashboard: New dashboard connected: Music
Error file,
2018-06-03 16:10:41.488685 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 16:10:41.490043 WARNING AppDaemon: Unexpected error initializing app: hoofdagenda:
2018-06-03 16:10:41.491248 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 16:10:41.498164 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/appdaemon/appdaemon.py", line 2040, in check_app_updates
self.init_object(app)
File "/usr/local/lib/python3.5/dist-packages/appdaemon/appdaemon.py", line 1565, in init_object
self, name, self.logger, self.error, app_args, self.config, self.app_config, self.global_vars
TypeError: formatyear() takes from 2 to 6 positional arguments but 9 were given
2018-06-03 16:10:41.499881 WARNING AppDaemon: ------------------------------------------------------------
no there are no permission errors.
only the base dir gives a warning but thats expected, so we can ignore that.
the app is initialised allright, so all we need to worry about is the error.
which is an error i have never seen before and i have no clue about, so i need to dig deep into AD.
to bad that @aimc isnt available at the moment, he could give me a clue why this happens.
you could help me with 1 thing.
clear the log and restart AD with -D in the command, so i will get debug info.
after starting then post the logs again, in the hope i see what goes wrong.
i have no idea where the formatyear() comes from.
so i googled and i think it must be somthing in the google api client.
ill add some debugging to the app to see how far it goes before the error appears.
we have diner soon, so it could be a few hours before i get back to you.
No rush sir, its all good. I should be doing work anyway, so i will give me a chance to get back on with that for a bit And also to try and work out why my background colour stopped working too.
Redownloaded the two files, changed the config to match mine for the calendar, and added debug:true, but still seem to be getting the same output,
hoofdagenda:
class: calendar
module: calendar
debug: True # use debug only if neccesary
calendarid: xxxxxi@xxxxxx # the calender id you found in google_calendars.yaml
amount: '5' # the amount of events you want to see
htmlfile: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/calendar.html # the file that you show in the dashboard
client_secret_file: client_secret_xxxxxx-xxxxxxxx.apps.googleusercontent.com.json # the name from the secret_file
credential_dir: /home/homeassistant/.homeassistant/appdaemon/apps/google-calendar-app/ # the dir where the secret file is
refreshtime: 3600 # defaults to once every hour
got through the import issue by adding the following imports to the AppDaemon addon:
“python_packages”: [
“httplib2”,
“google-api-python-client”,
“oauth2client”
]
Now I am getting the following error:
(I changed Debug to info, if not appdaemon shows tons of messages):
2018-06-03 19:06:07.004286 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 19:07:05.372756 INFO AppDaemon: Terminating hoofdagenda
2018-06-03 19:07:05.372934 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/calendar.py
2018-06-03 19:07:05.375324 INFO AppDaemon: Initializing app hoofdagenda using class calendar from module calendar
2018-06-03 19:07:05.376269 INFO hoofdagenda: debug: True
2018-06-03 19:07:05.376873 INFO hoofdagenda: init untill run_every done
2018-06-03 19:07:05.377489 INFO hoofdagenda: run_every initialised
2018-06-03 19:07:05.378093 INFO hoofdagenda: starting credential check
2018-06-03 19:07:05.378719 INFO hoofdagenda: credentialpath: /config/appdaemon/apps/calendar_client_secret.json
2018-06-03 19:07:05.378944 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 19:07:05.379024 WARNING AppDaemon: Unexpected error running initialize() for hoofdagenda
2018-06-03 19:07:05.379071 WARNING AppDaemon: ------------------------------------------------------------
2018-06-03 19:07:05.379226 WARNING AppDaemon: Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 1575, in init_object
init()
File “/config/appdaemon/apps/calendar.py”, line 35, in initialize
self.controleer_agenda(self)
File “/config/appdaemon/apps/calendar.py”, line 44, in controleer_agenda
credentials = self.get_credentials()
File “/config/appdaemon/apps/calendar.py”, line 251, in get_credentials
credentials = store.get()
File “/usr/lib/python3.6/site-packages/oauth2client/client.py”, line 407, in get
return self.locked_get()
File “/usr/lib/python3.6/site-packages/oauth2client/file.py”, line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File “/usr/lib/python3.6/site-packages/oauth2client/client.py”, line 302, in new_from_json
module_name = data[’_module’]
KeyError: ‘_module’
My Json file exists in folder /config/appdaemon/apps/calendar_client_secret.json and this is its content: