b0mbays / continuously_casting_dashboards

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

Falsely detecting HA Dashboard not playing & keep recasting over and over again #25

Closed chimeng62 closed 1 year ago

chimeng62 commented 1 year ago

Continuously Casting Dashboards falsely detects that HA dashboard is not playing and stop the current cast to recast. (refer to log). This leads to CC recasting the HA dashboard after 1 or 2 cast_delay check.

I have ha-catt-fix installed. No Kiosk Mode & no HTTPS access to my HA (don't think that matter as I have my own .sh script running catt before using Continuously Casting Dashboards)

Log:

2023-07-03 00:10:01.233 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is NOT playing on Family room display!
2023-07-03 00:10:01.233 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Casting dashboard to Family room display
2023-07-03 00:10:01.234 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing stop command...
2023-07-03 00:10:12.098 WARNING (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Failed to extract volume information from status_output for Family room display. Using default volume 5.
2023-07-03 00:10:12.099 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Setting volume to 0...
2023-07-03 00:10:13.605 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing the dashboard cast command...
2023-07-03 00:10:23.606 ERROR (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Timeout casting dashboard to Family room display: 
2023-07-03 00:10:43.608 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 00:10:43.608555
2023-07-03 00:10:43.608 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Family room display. Start time: 00:00:00 - End time: 23:59:00
2023-07-03 00:10:45.166 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:09:44 GMT+1000 (Australian Eastern Standard Time)
Volume: 0
Volume muted: True

2023-07-03 00:10:46.678 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:09:44 GMT+1000 (Australian Eastern Standard Time)
Volume: 0
Volume muted: True

2023-07-03 00:10:46.679 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is playing on Family room display...
2023-07-03 00:11:06.680 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 00:11:06.680757
2023-07-03 00:11:06.681 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Family room display. Start time: 00:00:00 - End time: 23:59:00
2023-07-03 00:11:08.223 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:09:44 GMT+1000 (Australian Eastern Standard Time)
Volume: 0
Volume muted: True

2023-07-03 00:11:11.734 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:09:44 GMT+1000 (Australian Eastern Standard Time)
Volume: 0
Volume muted: True

2023-07-03 00:11:11.734 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is playing on Family room display...
2023-07-03 00:11:31.736 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 00:11:31.735931
2023-07-03 00:11:31.736 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Family room display. Start time: 00:00:00 - End time: 23:59:00
2023-07-03 00:11:38.666 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:09:44 GMT+1000 (Australian Eastern Standard Time)
Volume: 0
Volume muted: True

2023-07-03 00:11:38.666 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is playing on Family room display...
2023-07-03 00:11:58.668 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 00:11:58.668044
2023-07-03 00:11:58.668 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Family room display. Start time: 00:00:00 - End time: 23:59:00
2023-07-03 00:12:09.497 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is NOT playing on Family room display!
2023-07-03 00:12:09.497 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Casting dashboard to Family room display
2023-07-03 00:12:09.498 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing stop command...
2023-07-03 00:12:16.066 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Setting volume to 0...
2023-07-03 00:12:19.554 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing the dashboard cast command...
2023-07-03 00:12:24.041 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Setting volume to 0...
2023-07-03 00:12:46.109 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 00:12:46.109463
2023-07-03 00:12:46.109 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Family room display. Start time: 00:00:00 - End time: 23:59:00
2023-07-03 00:12:47.666 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Family room display when checking for dashboard state 'Dummy': Title: Dummy 00:12:38 GMT+1000 (Australian Eastern Standard Time)

My config:

continuously_casting_dashboards:
  logging_level: debug #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
  cast_delay: 20 #Required: Time (in seconds) for casting checks between each device.
  start_time: "00: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: "23:59" #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:
    "Family room display": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
        dashboard_url: "http://10.0.0.114:8123/lovelace/c" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local)
        volume: 0 #Optional: Volume to set the display. (If you remove this, the device will remain the same volume)
FlexxFR commented 1 year ago

HI, I'm not sure but maybe this is an issue?

end_time: "23:59" #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.

It's also confusing to me, every time (except 00:00) is after 00:00.

chimeng62 commented 1 year ago

Upon further testing, I found that this doesn't happen when I have my camera live stream from Frigate NVR playing on the dashboard.

When I removed the Camera live stream card, the bug occurs.

The start & end time doesn't seem to affect it.

b0mbays commented 1 year ago

Hey, that is annoying.. This must be something to do with the ha-catt-fix. That fix creates an invisilble element on your dashboard that resembles 'live media' to trick the Home Hubs into thinking they are playing something. Could you try removing that completely and then re-installing it?

b0mbays commented 1 year ago

Did you get anywhere with this?

b0mbays commented 1 year ago

I'll close this issue for now but feel free to open it back up if you have another problem 👍