I’m pretty new to lovelace, and a bit rusty with Home Assistant in general. I’m basically trying to create a button on a picture-glance card, that when pressed, will cast my CCTV camera to my TV. I’ve got as far as creating a script that will cast a locally hosted file (my camera isn’t working with the chromecast yet but that’s a separate issue), and that works fine. However when I press the button on the card I get the popup shown below, and then I have to press ‘Execute’ for the script to actually run.
Is there any way to have the script fire when I press the button on the picture-glance card, and remove the extra step with the popup prompt? ui-lovelace.yaml
title: Home
views:
- title: Home
cards:
- type: picture-glance
title: Outside
entities:
- group.doorlights
- script.speaktemperature
camera_image: camera.outside
And then put switch.speaktemperature in your picture-glance.
Note: I chose to put the switch as always on, and run the switch on turn_off because I think a switch that’s on looks better on a picture-glance than one that’s off.
No, it could be almost anywhere, in your config, you could create a domain config of switch.yaml (or thingumie.yaml if you prefer) included from config from the switch domain or as I run things from packages, in any one of those. Depends where you are on the path, how much you’ve read and how comfortable you are editing files by hand getting things wrong and having another go. The first is much easier for newbies but means your files get very complicated very quickly. IMO anyway
And it’s not fake, it’s real but it is a software construct not existing in the physical world (but HA acts the same)