Google Calendar custom widget

Hello. I would like to set this up on my HADashbaord, and have authorised my URL, set api key and oath2 correctly.

However, I am getting a 404 error:

Calendar Error

{“result”:{“error”:{“errors”:[{“domain”:“global”,“reason”:“notFound”,“message”:“Not Found”}],“code”:404,“message”:“Not Found”}},“body”:"{\n “error”: {\n “errors”: [\n {\n “domain”: “global”,\n “reason”: “notFound”,\n “message”: “Not Found”\n }\n ],\n “code”: 404,\n “message”: “Not Found”\n }\n}\n",“headers”:{“cache-control”:“private, max-age=0”,“content-encoding”:“gzip”,“content-length”:“120”,“content-type”:“application/json; charset=UTF-8”,“date”:“Tue, 19 Nov 2019 09:28:55 GMT”,“expires”:“Tue, 19 Nov 2019 09:28:55 GMT”,“server”:“GSE”,“vary”:“Origin, X-Origin”},“status”:404,“statusText”:null}

Here is the yaml from my dash file:

calendar:
  widget_type: gcal
  colorpast: "#555555"
  calendars: 
    [email protected]
  updateinterval: 120
  apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  clientid: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  days: 3

Seems there are some restrictions on my account: I cannot set and organisation linked to my HA Url, without creating another google account?

If anyone knows a bit about Google Developer console / accounts, please reach out. Thanks.

I’ve upgraded til appdaemon4 and have some issues getting the widget to start.
It worked flawlessly on AppDeamon3. Anyone got experiences with appdaemon4?

yes, but not with mind reading :wink:

so please describe your issues :wink:

I have the same issue as here, have anyone found a solution?

same issues here, @WazWaz no longer active?
alternatives for appdaemon4?

Sorry, I’ve not updated my Hassio. I guess that’s the trouble with home automation - why change it once it works for you? I’ll look into this when/if I update my system.

1 Like

no worries I can totally get that. I’ll try debug some more when I get a chance. I’ll post findings and maybe a pull request if i make progress more progress :slight_smile:

1 change for AD 4 opposed to AD 3 widgets is that in the yaml file everything that is like {{something}}
now should be in quotes like “{{something}}”

actually thats the only change i know about that makes older widgets fail.
this change is due to a change in yaml.

Thanks @ReneTode I got the quotes already. Its the rest of the troubleshooting I’m struggling with. I think I’ve done all the steps required but getting both similar 404 errors and theme errors. I’ll get a clean env/log to get further on it.

if you get a 404 error, then the dashboard doesnt exist.
that can be 3 things:

  1. its not compiled because of an error in a custom widget or skin.
  2. AD isnt running
  3. you made a typo in the url

make sure that AD is running correctly (check your logs)
create a basic dashboard with only 1 sensor, that works.
then add this widget to that dashboard and try again.

if its not working, check logs (set dashboard logging if not done already, see docs)
and check google chrome console for errors.

Hi Rene,
Just a dutch noob here…
I tried your widget but AD is reporting some errors

[22:39:41] INFO: Starting AppDaemon...
2020-11-07 22:39:43.421290 INFO AppDaemon: AppDaemon Version 4.0.5 starting
2020-11-07 22:39:43.422353 INFO AppDaemon: Python version is 3.8.5
2020-11-07 22:39:43.422970 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-11-07 22:39:43.423508 INFO AppDaemon: Added log: AppDaemon
2020-11-07 22:39:43.424127 INFO AppDaemon: Added log: Error
2020-11-07 22:39:43.424677 INFO AppDaemon: Added log: Access
2020-11-07 22:39:43.425167 INFO AppDaemon: Added log: Diag
2020-11-07 22:39:43.461444 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-11-07 22:39:43.506478 INFO HASS: HASS Plugin Initializing
2020-11-07 22:39:43.507293 INFO HASS: HASS Plugin initialization complete
2020-11-07 22:39:43.508352 INFO AppDaemon: Initializing HTTP
2020-11-07 22:39:43.509342 INFO AppDaemon: Using 'ws' for event stream
2020-11-07 22:39:43.515387 INFO AppDaemon: Starting API
2020-11-07 22:39:43.525494 INFO AppDaemon: Starting Admin Interface
2020-11-07 22:39:43.526830 INFO AppDaemon: Starting Dashboards
2020-11-07 22:39:43.555706 INFO HASS: Connected to Home Assistant 0.117.4
2020-11-07 22:39:43.650587 INFO AppDaemon: App 'hello_world' added
2020-11-07 22:39:43.652042 INFO AppDaemon: App 'hoofdagenda' added
2020-11-07 22:39:43.654632 INFO AppDaemon: Found 2 total apps
2020-11-07 22:39:43.656287 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2020-11-07 22:39:43.659326 INFO AppDaemon: Running on port 5050
2020-11-07 22:39:43.675772 INFO HASS: Evaluating startup conditions
2020-11-07 22:39:43.700257 INFO HASS: Startup condition met: hass state=RUNNING
2020-11-07 22:39:43.701320 INFO HASS: All startup conditions met
2020-11-07 22:39:43.737531 INFO AppDaemon: Got initial state from namespace default
2020-11-07 22:39:43.781774 INFO AppDaemon: New client Huiskamer connected
2020-11-07 22:39:45.677903 INFO AppDaemon: Scheduler running in realtime
2020-11-07 22:39:45.731523 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-11-07 22:39:45.733324 INFO AppDaemon: Adding /config/appdaemon/apps/google-calendar-app to module import path
2020-11-07 22:39:45.739831 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-11-07 22:39:45.750460 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/google-calendar-app/calendar.py
2020-11-07 22:39:45.753012 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/google-calendar-app/start_calendar.py - ignoring
2020-11-07 22:39:45.755137 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-11-07 22:39:45.758744 INFO AppDaemon: Initializing app hoofdagenda using class calendar from module calendar
2020-11-07 22:39:45.761254 WARNING hoofdagenda: ------------------------------------------------------------
2020-11-07 22:39:45.762133 WARNING hoofdagenda: Unexpected error initializing app: hoofdagenda:
2020-11-07 22:39:45.762850 WARNING hoofdagenda: ------------------------------------------------------------
2020-11-07 22:39:45.764921 WARNING hoofdagenda: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 907, in check_app_updates
    await self.init_object(app)
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 294, in init_object
    "object": app_class(
TypeError: formatyear() takes from 2 to 6 positional arguments but 8 were given
2020-11-07 22:39:45.766136 WARNING hoofdagenda: ------------------------------------------------------------
2020-11-07 22:39:45.944584 INFO hello_world: Hello from AppDaemon
2020-11-07 22:39:45.947004 INFO hello_world: You are now ready to run Apps!
2020-11-07 22:39:45.949770 WARNING AppDaemon: Unable to find module hoofdagenda - initialize() skipped
2020-11-07 22:39:45.951310 INFO AppDaemon: App initialization complete

Can you tell what;s going wrong ?
Best regards,
Jeffrey

sorry jeffrey, but i guess its all just to old stuff.

Okay I understand

@WazWaz
Hello,
Everything worked, but now I get an empty calendar on my dashboard, with the following warning, in logs
WARNING AppDaemon: Variable definition not found in CSS Skin variables: $ group_slider_style
What can I do about it?

Console shows

regards

thats a warning that a widget needs the variable in your skin files.
in every skin that you use (even the default skin) you need to have the needed variables.

@ReneTode
Thanks for your reply. Where can I find the skin files, and how do I enter a variable?

your skin files are in the subdir custom_css
if you dont have custom skins then you will need to create 1 called default and add the variable to the variables.yaml

https://appdaemon.readthedocs.io/en/latest/DASHBOARD_CREATION.html#skins

@ReneTode
Thank you for your response. I had already discovered that. I’m trying to edit the Default skin now, how should I add the missing $ group_slider_style variable in the skin?

look at the other variables there and make it simular.
if you dont know what it should contain, use an empty string. (2 double quotes)

normally that info should be provided by the creator from the widget.