Hi,
I’m new here and would really appreciate your help as I’ve searched these forums and the net for days!
I have a light that is turned on and off via IR (Broadlink RM mini). I have created two scripts - one for on and one for off under the names:
script.spots_office_on
script.spots_office_off
All I want to do is to be able to have these in my overview with a toggle to turn the Office Spots on or off. There is no state sensor so really just a simple on/off toggle using the two scripts.
Any help appreciated.
Many thanks
If I follow you, you can add an Identity card to the dashboard, and add to that your two scripts. You should then be able to activate either with a press on “Run”.
This shows adding a script entity to current entries in an Entity Card (bottom left) that sets 7 Nest thermostats for me, and the result for the dashboard Entities card on the right. FWIW, the entities showing as able to Activate are scenes. The entities with a toggle are light groups (for give the momentary Capt.Obvious here [g]).
Hi Bob,
Thanks for coming back to me. I can do that no problem., however what I would like to do is to have a toggle show up for on and off (see attached mockup) rather than two seperate lines with “run”
Try going to Settings / Devices / Helpers, and create a Helper. Choose Group, Light Group.
Give it a name, then begin adding the spot lights you want toggle. If you have no need to see the lights in the group evident anywhere else (the light group alone is all you need), you can Hide Members of the group. Not necessary to decide on this right away. When the group is complete, save it.
Also note, if you don’t use those scripts anywhere else you can put the script sequences directly in the template switch turn_on and turn_off options. They accept sequences of services (which is why I showed them above as lists with “-”).
thanks Tom!
I added this to the configuration.yaml as posted but it does not show up in my entities? Anything I’m missing?
Also I’m not clear on your second post with reference to the “-”. I have about 20 on/off scripts that are linked to IR broadlink, so will need this configuration for all of them - so not a one off.
thanks again!
Logger: homeassistant.config
Source: config.py:1258
First occurred: 11:46:13 (1 occurrences)
Last logged: 11:46:13
Invalid config for ‘switch’ from integration ‘template’ at configuration.yaml, line 97: expected dictionary ‘switches->office_spots->turn_on->0’, got ‘script.spots_office_on’, please check the docs at Template - Home Assistant Invalid config for ‘switch’ from integration ‘template’ at configuration.yaml, line 99: expected dictionary ‘switches->office_spots->turn_off->0’, got ‘script.spots_office_off’, please check the docs at Template - Home Assistant
thanks Bob for your reply, but that doesn’t work as the lights are captured as scripts and not lights. as such they are not recognized as light entities, so can’t be added to the light group.
Bowing to Wood & Tom, this topic lead me to make the time to find/view some YTube tutorials on Templates. I suppose I wasn’t ready until now to delve into them (didn’t know what to do with the answers here, despite HA help links), but I’m starting to grok it now.