Home Assistant 101: How to Create Virtual Switches

preview_player
Показать описание
I'll cover the what, why and how of creating and using virtual (template) switches in Home Assistant. In addition to a few different examples, I'll also cover a couple of different methods or techniques for creating 'switchable' entities that are not tied to a normal switch or light.

Check below for links to additional information, including a copy of all the YAML I show and use in the video.

Chapter Links:
=============
00:00 Introduction
02:27 Light Brightness Example
08:45 Streaming Services Example
13:14 WLED Display Example
18:20 Input Boolean Examples
25:12 Wrap up

Additional Information:
======================

You can help support the channel, or just say thanks, by buying me a cup of coffee at:

#homeassistant #automation #dashboard
Рекомендации по теме
Комментарии
Автор

Please note: In the section on creating the light brightness switches, I made a typo in the initial YAML code. It shows an entity_id of basement.light. Obviously, this is backwards and the correct value should be light.basement. The full example also shows entity_light.basement and this should read: entity_id: light.basement. Sorry about that! Please refer to the linked Gist code in the video description for full copies of the correct YAML code.

ResinChemTech
Автор

Dude this is definitely one of the best home automation videos I’ve seen … and I’ve seen hundreds! I was expecting to just learn how to make a switch but you also answered like 20 other questions on my list to research … including that I need to build my mom a streaming tv remote controller system and now I know how to do it! Thanks so much!

RND-USA
Автор

I will end up coming back to this video again and again I am sure. I don’t make use of dashboards as much as others so some of this will come if and when I add kiosks but the Roku one might get used sooner here.

Nicely done and good job with the dual screen action, so clear and the code in bright fluorescent made it really easy to read!

BELSERVICEMAN
Автор

Thanks for this very clear video! I’d like the idea of using virtual switches for scheduled tasks, but our schedule changes a lot 😊 is it possible to a appointment in a Google calendar, with a certain word in the subject, to trigger an automation?

christophe_de_pauw
Автор

Excellent! A video on how to create a custom card with a drop down list for all the effects in WLED would be much appreciated

Shaqk
Автор

Great video. I'm using a boolean switch as a medicine reminder. If i haven't pressed the "medicine" button in the bathroom or on the dashboard before 7 a.m. / p.m. I'm getting a telegram reminder and some flashing lights.

cowfeet
Автор

6:40 "You see from my lights_100..." The service light.turn_on has a data attribute "brightness_pct" which would allow you to also change the 'data: brightness 255' to 'data: brightness_pct: 100'. Now I need to figure out is that works as an attribute that can be tested in a template.

One question. How does your "Show Standard Switches' switch change the switch for the cards?

I love the hexagon light. Thanks for linking to the build video.

eugsmiley
Автор

I'd love to hear what others have done to sense that their trash is in or out. The most practical ones I've looked at are overhead ultrasonic sensor, ESPresence with a BLE transmitter on the side.

SBinVancouver
Автор

Great new video, your videos are very entertaining, well-presented, and thoughtful!

rodneysmith
Автор

Thank you for your new video. What branch of wall switch do you use at 8:35 and how did you integrate it with HA?

maksymborodin
Автор

Tnx for the video.
I just tried this in the latest Home Assistant in Docker, and my error is: This entity does not have a unique ID, therefore its settings cannot be managed from the UI.
From the manual i can't really see what i need to do to overcome this. I did try creating different virtual switches with much longer names but that didn't make a difference.

steffie.morris
Автор

Thanks! All super helpful suggestions!

Dorff_Meister
Автор

Hey cool vid and i have a question, on what hardware do you run your HA server and what do you think is the most efficient way to have a little HA server

Leconcasseur
Автор

I created the switch.yaml file; Add the code and change the entity name according to your instructions; Restart home assistant. But no entity of the form "switch.sw_...." like yours was found. Please help. Thank!

ngoctaiquach
Автор

What could be the problem that after 2 secs toggle goes from on to off and leaves the task is set to on, but if I do on/off fast it works :( All day and can't find the way to fix it :(

mankvlpwnz