Open Roachforlife opened 9 months ago
Hey @Roachforlife yes you are correct, there is support for this using 'state_triggers' feature. There's more info here:
https://github.com/b0mbays/continuously_casting_dashboards#-entity-changed-dashboard-casting
You should be able to use this with your button if you have it setup and connected to home assistant. It should be recording the entities and it's probably either simply 'off' or 'on'. Try testing it out and check what the states are called then follow the setup doc.
Let me know if you have any issues 👍
Sorry for the delay getting back to you. I am finally getting around to testing this and still having issues. Basically, for now, I set up a virtual button via the helper section of HA. I then set it so when the button is set to 'On' it should cast, however it does nothing. In all honesty Ive never made a virtual button before but the premise seems very simple and I am manually turning it on/off in the phone app. When I check the log viewer nothing fires and of course, nothing casts to the screen. Wondering if I am just missing something in my yaml. I also posted a handful of other questions, sorry they are a hodgepodge of things surrounding this integration. Definitely appreciate the assistance!!
Helper button
YAML
continuously_casting_dashboards:
logging_level: debug
cast_delay: 30
state_triggers:
"Giuseppe":
- entity_id: input_boolean.turn_dashcast_on_off
to_state: "On"
dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk"
time_out: 1200
force_cast: false
NOTE - you had helped me earlier and everything was working on a timer based system so I know the dashboard is good as well as the http and access, etc
Some general questions if you dont mind assisting (thank you again for the helpful and quick responses!)
Okay that was a lot, and I know some are not entirely linked to your integration but any help is much appreciated. Also one more thing to add, on the other thread you helped me and one of the things we discussed was adding 'admin' rights to the dashboard user in HA. Im realizing that I probably needed it since I was using my out of the box overview dashboard which I noticed requires admin by default. My subsequent ones I made after do not. So I wanted to let you know for if you want to update your page maybe a notice about checking the dashboard properties to see if admin rights are needed when setting up the user account.
Hello, quick update. Still hoping to pick your brain on those 7 questions however to update I have made a little progress
My new config file
continuously_casting_dashboards:
logging_level: debug
cast_delay: 45
start_time: "00:00"
end_time: "23:59"
devices:
"Giuseppe":
- dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk"
volume: 3
#...
state_triggers:
"Giuseppe":
- entity_id: "input_boolean.turn_dashcast_on_off"
to_state: "on"
dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk"
time_out: 1200
force_cast: true
As mentioend before I made a toggle called dashcast on/off and referenced it with a state of on. I noticed that in the logviewer it said 'on' in lowercase instead of 'On' so I thought maybe that might make a difference but no dice. I also thought it was interesting that when I restart HA it does cast it, but then I guess hits the time out. Changing the toggle status makes no difference after that.
Checking the logs I now see timeout errors
2024-03-06 13:52:20.257 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is NOT playing on Giuseppe!
2024-03-06 13:52:20.257 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Casting dashboard to Giuseppe
2024-03-06 13:52:20.334 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing stop command...
2024-03-06 13:52:30.710 ERROR (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Timeout casting dashboard to Giuseppe:
2024-03-06 13:52:33.989 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Stopping casting dashboard on Giuseppe after 1200 seconds timeout
2024-03-06 13:53:15.715 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] All device map: {'Giuseppe': {'instances': [{'dashboard_url': 'http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk', 'dashboard_state_name': 'Dummy', 'media_state_name': 'PLAYING', 'volume': 3, 'start_time': datetime.time(0, 0), 'end_time': datetime.time(23, 59), 'instance_change': False}], 'current_instance': 0}}
Current device map: {'Giuseppe': {'dashboard_url': 'http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk', 'dashboard_state_name': 'Dummy', 'media_state_name': 'PLAYING', 'volume': 3, 'start_time': datetime.time(0, 0), 'end_time': datetime.time(23, 59), 'instance_change': False}}
2024-03-06 13:53:15.716 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Current local time: 13:53:15.715048
2024-03-06 13:53:15.716 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Local time is inside the allowed casting time for Giuseppe. Start time: 00:00:00 - End time: 23:59:00
2024-03-06 13:53:40.270 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.samsung_qn90b_2 is taking over 10 seconds
2024-03-06 13:53:42.114 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Giuseppe when checking for dashboard state 'Dummy': Volume: 0
Volume muted: False
2024-03-06 13:53:58.787 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Status output for Giuseppe when checking for dashboard state 'Dummy': Volume: 0
Volume muted: False
2024-03-06 13:53:58.790 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] HA Dashboard (or media) is NOT playing on Giuseppe!
2024-03-06 13:53:58.790 INFO (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Casting dashboard to Giuseppe
2024-03-06 13:53:58.982 DEBUG (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Executing stop command...
2024-03-06 13:54:12.545 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.samsung_qn90b_2 is taking over 10 seconds
2024-03-06 13:54:12.873 ERROR (MainThread) [custom_components.continuously_casting_dashboards.dashboard_caster] Timeout casting dashboard to Giuseppe:
Question, and this is probably a dumb one, but when using the STATE feature, I still need to list the DEVICES section, is that correct? The way the code example is written it omits the device section but I presume the "#..." is to signify an addition to the devices section above it. I have tried both ways and still not getting to work but trying to make sure I am on the right path.
Hey @Roachforlife going to answer your questions below:
The parameters for the integration knowing whether it is showing media is a message that is logged when the integration checks in with the Hub, and asks what the status is. The only two I have added are in this code shown below:
is_media_state = "PLAYING" in status_output or "Netflix" in status_output
So, this only accounts for things that give a 'PLAYING' or 'Netflix' status. Your casted camera might not report the same status. You can check what the status is if you install 'catt' locally on a computer on your network, and do a call to your hub whilst the casted camera is active on your hub.
The repo is here: https://github.com/skorokithakis/catt
Once you have it installed run:
catt -d Giuseppe status
Then check the status message and report back. I could then add this to the code above.
Then select your Hub as the target. This will stop the casted dashboard on the device on demand.
I haven't tried this myself but that should work? If it doesn't let me know and I'll try it myself.
That's by design. I set the volume to 1 before the casting because the casting process creates an annoying sound so we mute that this way, and then set the volume to how it was before (if possible) or the default volume (or user set volume).
You are correct! There was a bug introduced in 2024.2.x that caused issues with live cameras so I remained on 2023.2.x. This is fixed in 2024.3.0 so update to this and you'll have no issues.
I'm not too sure. After a quick google it looks like you might be able to do this with Browser Mod so maybe try that?
Yep unfortunately after changing the configuration.yaml a full restart is required. Annoying I know! I must have restarted HA 500 times when working on this integration 😆
Good spot with the admin rights. I'll get that added 👍
I'm confused about what you intend to do with your hub? You have it set to cast all day and night and also a state trigger to start the same dashboard on the same device? 🤔 Apologies If I have misunderstood!
Thanks for the feedback. In between meetings so I will need to circle back on some but thanks for the feedback. I actually installed catt to test this along the way thinking I might need it so I will give the status call a shot and let you know. Thank you for being open to adding more.
As for how I plan to use it, I have basically been doing baby steps along the way since I couldnt get the state process working from the jump, which is why my questions seem a bit all over the place. For my usage, I do enjoy using the Lenovo display, its perfect (relatively) at casting my Wyze camera while my 2yr old sleeps, so I may want to turn it off for then (unless the feeds are more reliable in HA Dashboard which I will do more testing on). I also have times where she wants to watch something on Youtube in particular so I want to turn off the dashboard during those times. I think either of the following scenarios could work for me
Going back to the idea with CATT, that is done more like a service you call as needed. Is there anyway to do this with CC Dash? So rather than the listening or based on static times, its something I can call when I want it? As i mentioned above I tried this with catt but didnt seem to like kiosk mode and I didnt go back and further test it. Since CC Dash uses catt I wonder if that might be something thats possible and that youd consider for a future enhancement?
Anyhow I will loop back on the others. Thanks again man I really appreciate you taking the time on this. I also will upgrade to latest HA from yesterday before I do to check the camera stuff :)
Here is a screenshot of running both status and info (catt) when playing something on YOUTUBE
Here is another running status and info when I called the WYZE CAM via Google Home on the device
Last one, a screenshot of status/info when casting my NEST 1stgen Doorbell (Nest Hello) via Google Home to the display
Sorry just kidding, figured would be helpful 2 more. So this is a screenshot of the lenovo display doing nothing other than cycling pictures via google photos
Last one, here is when its casting the dashboard via your integration (sorry I have the info and status backwards on this one)
Just to circle back to a question posted sort in between the previous posts. Assuming I am using the 'state' method of getting this to work, should I ALSO be including the 'devices' section in the yaml? Below is what I have now. It seems like it wants to run at all times (although other times not running at all, very weird) Definitely does not seem like it cares about my virtual toggle I made as turning it on or off doesnt seem to go anything. The way the code is listed on the github I wasnt sure if the "#..." signified I should be including the top portion of the code for 'devices'. Hopefully when you see my code below youll know what i mean.
continuously_casting_dashboards:
logging_level: debug
cast_delay: 45
start_time: "00:00"
end_time: "23:59"
devices: <<----- UNSURE IF THIS SECTION SHOULD BE EXCLUDED WHEN USING STATE TRIGGERS
"Giuseppe":
- dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk"
volume: 3
#...
state_triggers:
"Giuseppe":
- entity_id: "input_boolean.turn_dashcast_on_off"
to_state: "on"
dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk"
time_out: 1200
force_cast: true
Just to circle back to a question posted sort in between the previous posts. Assuming I am using the 'state' method of getting this to work, should I ALSO be including the 'devices' section in the yaml? Below is what I have now. It seems like it wants to run at all times (although other times not running at all, very weird) Definitely does not seem like it cares about my virtual toggle I made as turning it on or off doesnt seem to go anything. The way the code is listed on the github I wasnt sure if the "#..." signified I should be including the top portion of the code for 'devices'. Hopefully when you see my code below youll know what i mean.
continuously_casting_dashboards: logging_level: debug cast_delay: 45 start_time: "00:00" end_time: "23:59" devices: <<----- UNSURE IF THIS SECTION SHOULD BE EXCLUDED WHEN USING STATE TRIGGERS "Giuseppe": - dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk" volume: 3 #... state_triggers: "Giuseppe": - entity_id: "input_boolean.turn_dashcast_on_off" to_state: "on" dashboard_url: "http://192.168.19.50:8123/dashboard-dashcast/default_view/default_view?kiosk" time_out: 1200 force_cast: true
Did you ever figure this out? I cant get state_triggers to work and am wondering the same as you
Unfortunately not. Hoping to hear from b0mbays soon
I'm in the same boat. Without the devices, I don't even get logs. Trying to make an input_boolean to turn the cast on. An option to end cast on state would be nice to.
Can I ask, did you have a yaml similar to mine, with BOTH the devices section AND state_triggers section? Or just the state triggers section? I think the devices part may be required but I wasnt sure based on the wiki if its just additive. This may be standard in HA world but I am just learning everyday.
Havent heard from the dev in a bit. I did start exploring DashCast which this is based on i bellieve. Seems to work in a more purposely push way (ie I press a button on a, well, button, and it casts at that moment) so not as good as something always listening like the state triggers but hopefully soon we'll hear back and can make cont casting work!
I assumed I could use just the state_triggers since I didn't want the devices. No luck, no logs nothing seems to fire that way. With devices, it didn't test much other then my state_triggers. I had 1 devices, 3 state triggers for 3 different sensors/devices to see if I could get it to load and then trigger the other two state devices, nothing happens when the states change on the two sensors that were not also listed under the devices section.
UPDATE: I actually do see the logs of the state change on the sensor listed under state triggers firing, but it doesn't actually cast.
On Thu, Mar 28, 2024, 1:26 PM Roachforlife @.***> wrote:
Can I ask, did you have a yaml similar to mine, with BOTH the devices section AND state_triggers section? Or just the state triggers section? I think the devices part may be required but I wasnt sure based on the wiki if its just additive. This may be standard in HA world but I am just learning everyday.
Havent heard from the dev in a bit. I did start exploring DashCast which this is based on i bellieve. Seems to work in a more purposely push way (ie I press a button on a, well, button, and it casts at that moment) so not as good as something always listening like the state triggers but hopefully soon we'll hear back and can make cont casting work!
— Reply to this email directly, view it on GitHub https://github.com/b0mbays/continuously_casting_dashboards/issues/48#issuecomment-2026055033, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQFDKDX2LNEJQFXWGPRVALY2R4HVAVCNFSM6AAAAABD6LIHFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRWGA2TKMBTGM . You are receiving this because you commented.Message ID: @.***>
I see that Google Cast exists and I can call it to push to my Lenovo Display, however for some reason it doesnt like my Mushroom Cards. I also see you can base things based on state. Was hoping to make a simple automation for a Button I have that when I press it will use dashcast to push to my screen so I can manually turn on and off. Is this possible? Thanks
Works for me with this: https://github.com/AlexxIT/DashCast
service: dash_cast.load_url
data:
url: http://192.168.1.4:8123/g-home/vader
entity_id: media_player.boxen
force: force
I see that Google Cast exists and I can call it to push to my Lenovo Display, however for some reason it doesnt like my Mushroom Cards. I also see you can base things based on state. Was hoping to make a simple automation for a Button I have that when I press it will use dashcast to push to my screen so I can manually turn on and off. Is this possible? Thanks
Works for me with this: https://github.com/AlexxIT/DashCast
service: dash_cast.load_url data: url: http://192.168.1.4:8123/g-home/vader entity_id: media_player.boxen force: force
Thanks. I have, for the moment, gone to DashCast as well which seems to be working okay. I do like the idea of this always listening though so I hope it is further supported/enhanced.
I'm in the same boat. Without the devices, I don't even get logs. Trying to make an input_boolean to turn the cast on. An option to end cast on state would be nice to.
Hey all, apologies I missed many of these messages. I have just added a new feature to control the casting globally with a boolean entity state. Could that resolve your issue?
The setup is explained here - ensure you have updated to 1.3.2
I'm in the same boat. Without the devices, I don't even get logs. Trying to make an input_boolean to turn the cast on. An option to end cast on state would be nice to.
Hey all, apologies I missed many of these messages. I have just added a new feature to control the casting globally with a boolean entity state. Could that resolve your issue?
The setup is explained here - ensure you have updated to 1.3.2
I will plan some time over the next few days to check, thanks! Going to back further up in the thread I think you were going to look into adding some items to change what was considered 'in use' such as the youtube app for example. (when not using the force command). And equally as important, and sorry I may just be dumb but I still never understand if using the state method if you still need the beginning part of the yaml. Not sure if the examples are meant to be an extension of the yaml or the full yaml. (I saw the ... and thought maybe its an addon but I didnt know). Since I couldnt get it working I just assumed I was doing it wrong but some clarity would help this noob :) Thanks again for checking on us!
I see that Google Cast exists and I can call it to push to my Lenovo Display, however for some reason it doesnt like my Mushroom Cards. I also see you can base things based on state. Was hoping to make a simple automation for a Button I have that when I press it will use dashcast to push to my screen so I can manually turn on and off. Is this possible? Thanks