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

Cast on demand #33

Closed donparlor closed 7 months ago

donparlor commented 10 months ago

Hello @b0mbays,

Look on this thread for better visualisation: https://community.home-assistant.io/t/cast-and-re-cast-a-lovelace-view-to-a-google-hub/259631/158?u=donparlor

Wonderful work with this HACS. I went through the setup process easily but I am wondering if instead of casting through a defined timeframe I could simply cast on demand. I mean, I want to cast a specific dashboard in my garage TV with a Chromecast (Google TV) on request for a project and time will vary depending on when I start the project and how fast the project is completed. Based on your configuration it seems we must set a defined start and end time or it will default to 7:00 AM.

continuously_casting_dashboards: logging_level: warning #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging) cast_delay: 45 #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: "": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app. dashboard_url: "" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local) volume: 5 #Optional: Volume to set the display. (If you remove this, the device will remain the same volume) start_time: "07:00" #Optional: Set the start time for this device end_time: "01:00" #Optional: Set the end time for this device Before discovering your HACS, I had created a button in my garage dashboard to cast on my Garage Google TV, but it would stop after 10min and go into Photo Mode. The only way to go back to displaying my dashboard is to click the BACK button on the physical remote of the Google TV,

Here is my button code:

type: custom:button-card name: Caster Distillation icon: mdi:cast tap_action: action: call-service service: script.1692141275657 hold_action: action: call-service service: media_player.turn_off service_data: entity_id: media_player.google_tv_garage show_name: true show_icon: true And here is the script it is referring to:

alias: Cast Garage sequence:

b0mbays commented 10 months ago

Hey @donparlor thanks for the kind words. You could try using the Entity based dashboard casting feature to cast your dashboard when an entity changes? This entity could be the same button you used previously or something else that you want to use as your 'on demand switch'.

I created a 'dummy' switch to replicate the state of my TV being 'turned on' and it will cast the dashboard when I set this switch to 'on'

Screenshot 2023-08-21 at 11 04 31

donparlor commented 10 months ago

Brilliant! Yes you are correct, I can easily have a boolean to trigger the casting. I'll try it and it should be good to go! Thanks!

donparlor commented 10 months ago

If I use the entity based trigger, do I need to configure the basic configuration described here? Capture d’écran, le 2023-08-21 à 10 56 42

I would guess not...

And I guess only that portion needs to be configured: Capture d’écran, le 2023-08-21 à 10 56 48

b0mbays commented 10 months ago

Good question... I'm actually not sure. It could be required. Could you try it with and without? I'm not at home right now to test it unfortunately

donparlor commented 10 months ago

Ok I will

donparlor commented 10 months ago

From the Home Assistant Core logs:

Logger: homeassistant.setup Source: custom_components/continuously_casting_dashboards/dashboard_caster.py:16 Integration: continuously_casting_dashboards First occurred: 16:36:58 (1 occurrences) Last logged: 16:36:58

Error during setup of component continuously_casting_dashboards Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 288, 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 16, in init self.cast_delay = self.config['cast_delay']


KeyError: 'cast_delay'
donparlor commented 10 months ago

Here is my configuration.yaml Capture d’écran, le 2023-08-21 à 16 56 57

donparlor commented 10 months ago

I did try the same with an external HTTPS url using my own domain with Cloudflare.

donparlor commented 10 months ago

Is it possible that there is missing a 'cast_delay' value? Or that continuously_casting_dashboards expects a cast_delay value? Look at the log 3 messages above

Referring to: KeyError: 'cast_delay' Capture d’écran, le 2023-08-21 à 21 00 32

donparlor commented 10 months ago

I got it, logging_level and cast_delay are #Required in your configuration.

b0mbays commented 10 months ago

Glad you sorted it out! Does that new trigger work well for you?

donparlor commented 10 months ago

In fact it is not working. The basic configuration code with its default value forces display of the dashboard even without the trigger being activated. So the continuously_casting_dashboards HACS is presently built to always display within its basic configuration. So with this basic setup user should be able to turn off the basic default and only use the trigger entity base.

Here is my setup, but I was forced to put it on # pause because I didn't want my garage Google TV to always try to display my dashboard.

Capture d’écran, le 2023-08-22 à 07 50 54

If you know how to update the basic default configuration to not always push a dashboard and only let the entity trigger work, that would be wonderful.

donparlor commented 10 months ago

Have a look, the HACS does not work. It tries to display the local URL which work from my computer but it goes into a loop on the Google TV Screen.

https://github.com/b0mbays/continuously_casting_dashboards/assets/97048708/8345500b-a4c8-476a-9d0f-8625ab955fa6

donparlor commented 10 months ago

And for your information, my dashboard URL is working in my browser

Capture d’écran, le 2023-08-22 à 11 02 50
b0mbays commented 10 months ago

Hey @donparlor - apologies I have been away. I've assumed that this integration works with Chromecast devices on TV's but that doesn't seem to be the case after doing a test with mine. It looks like this only works with Google Display Hub devices unfortunately 😞

donparlor commented 10 months ago

Since your HACS is based on CATT's created by @skorokithakis, could skorokithakis take into account the Google TV requirements for CATT to work with it?

donparlor commented 10 months ago

@b0mbays, here is skorokithakis's answer, creator of the CATT component

Capture d’écran, le 2023-09-04 à 10 03 23
Tokn59 commented 7 months ago

Did anyone finally get the triggers working ? Can you please post your FULL working yaml for CCD ? Thank You !!!

b0mbays commented 7 months ago

Closing ticket as the original issue was casting to a TV which wasn't originally supported. If anyone has a fix, please post it 👍