b0mbays / continuously_casting_dashboards

HACS Integration for continuously casting a Home Assistant dashboard to your Google Chromecast Displays
MIT License
183 stars 9 forks source link

Error on update #42

Closed EljaTrum closed 6 months ago

EljaTrum commented 6 months ago

I'm getting this error after a recent update to version 1.3. It stopped casting my dashboard to the Hub too.

Logger: homeassistant.setup
Source: setup.py:332
First occurred: 13:31:44 (1 occurrences)
Last logged: 13:31:44

Error during setup of component continuously_casting_dashboards
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 332, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/continuously_casting_dashboards/__init__.py", line 20, in async_setup
    caster = ContinuouslyCastingDashboards(hass, conf)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/continuously_casting_dashboards/dashboard_caster.py", line 30, in __init__
    device_info.get("start_time", global_start_time), "%H:%M"
    ^^^^^^^^^^^^^^^
AttributeError: 'NodeStrClass' object has no attribute 'get'
b0mbays commented 6 months ago

Hi @EljaTrum i'm updating to the latest HA release now to see if something in the update broke something. I'll report back! Which HA version are you on?

EljaTrum commented 6 months ago

I'm on Core 2023.12.4, Supervisor 2023.12.0, OS 11.2, Frontend 20231208.2.

I tried returning to earlier versions of your integration, but that didn't help (back on v1.3.0 now). So it could indeed be something in an HA update.

b0mbays commented 6 months ago

@EljaTrum I'm on the same versions as you, and all is working fine... Could you post your config for the integration from your configuration.yaml?

Try and include the formatting too 😊

EljaTrum commented 6 months ago

Thanks for looking into this. :)

Here's the part from the configuration:

continuously_casting_dashboards:
  logging_level: warning #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
  cast_delay: 240 #Required: Time (in seconds) for casting checks between each device.
  start_time: "07:00" #Optional: Global start time of the casting window (format: "HH:MM") - Default is set to "07:00" and can be individually overwritten per device below.
  end_time: "01:00" #Optional: Global end time of the casting window (format: "HH:MM") and must be after "00:00". Default is set to "01:00" and can be individually overwritten per device below.
  devices:
    "Nesthub": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
        dashboard_url: "https://home.urlredacted.nl:8123/lovelace/nest-hub?kiosk" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local)      
b0mbays commented 6 months ago

Thanks for looking into this. :)

Here's the part from the configuration:

continuously_casting_dashboards:
  logging_level: warning #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
  cast_delay: 240 #Required: Time (in seconds) for casting checks between each device.
  start_time: "07:00" #Optional: Global start time of the casting window (format: "HH:MM") - Default is set to "07:00" and can be individually overwritten per device below.
  end_time: "01:00" #Optional: Global end time of the casting window (format: "HH:MM") and must be after "00:00". Default is set to "01:00" and can be individually overwritten per device below.
  devices:
    "Nesthub": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
        dashboard_url: "https://home.urlredacted.nl:8123/lovelace/nest-hub?kiosk" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local)      

Ah I think I see the issue. Can you try the following?

 continuously_casting_dashboards:
   logging_level: warning #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
   cast_delay: 240 #Required: Time (in seconds) for casting checks between each device.
   start_time: "07:00" #Optional: Global start time of the casting window (format: "HH:MM") - Default is set to "07:00" and can be individually overwritten per device below.
   end_time: "01:00" #Optional: Global end time of the casting window (format: "HH:MM") and must be after "00:00". Default is set to "01:00" and can be individually overwritten per device below.
   devices:
     "Nesthub": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
       - dashboard_url: "https://home.urlredacted.nl:8123/lovelace/nest-hub?kiosk" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local)      

I've added a '-' to the dashboard_url line. Apologies if this wasn't clear in the update notes 😬

b0mbays commented 6 months ago

Although if you tried an previous version then it should have worked without the '-'... So let's see if that works!

EljaTrum commented 6 months ago

Well, this helped. The error is gone. However, it is still not casting the dashboard. :(

Updates notes.. Yeah, I should have read those when it stopped working. Good reminder for the next time. :)

b0mbays commented 6 months ago

That's progress! Let's enable debug logging and see what the logs are saying.

Change the following:

logging_level: warning

to:

logging_level: debug

Then restart home assistant and head to your logs within settings. Open the full logs too and see if there's anything in there.

Also make sure you have your trusted user set up correctly and the name of your device is correct.

EljaTrum commented 6 months ago

Thanks, I managed to fix it. :/ My own error: I used the wrong url in the configuration when adding the dash.

Thanks for you great help with solving this issue! :)