YAML and Jinja Templating Course Episode 6: Counting your lights

  Рет қаралды 7,931

Smart Home Junkie

Smart Home Junkie

Күн бұрын

Пікірлер: 43
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
Let me know how many lights you have in your house!
@PosiCat
@PosiCat 6 ай бұрын
Only 15 lights (a lot are dumb bulbs controlled by switches ... 61 switches) but I do have 622 sensors
@desertaip9137
@desertaip9137 6 ай бұрын
Took some time to add the labels, I have 87 legitimate lights :-)
@emms-place
@emms-place 6 ай бұрын
Another awesome video in the series. These videos have been really help full to me. Keep up the good work. I have 47 lights in my setup
@robertdon-duncan7954
@robertdon-duncan7954 6 ай бұрын
Another great video! Thanks again, it really does open up endless possibilities. One thing I've recently been doing is wrapping this up in a script and passing the label as a variable, so I can ask the same question but for various devices (again all mainly learned from your videos)! I really think you've found your niche in these videos, nothing really out there that helps explain the art of the possible in a simple way! Thanks so much
@edwaaij4752
@edwaaij4752 6 ай бұрын
Another educational video. However, there is so much more to tell about Jinja. Please continue this series.
@peterturcan1062
@peterturcan1062 3 ай бұрын
great tutorials about HA! thank you!. what kind of smart bulbs do you use? I expect they are well integrated into HA
@sevagjb
@sevagjb 6 ай бұрын
as always brilliant ❤ I advise everyone to go immediately to ko-fi👌
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
Thank you for your support 🙏🏻
@jfs43
@jfs43 6 ай бұрын
That's a very useful video, I really like the approach of using labels. Could you give any examples of using 'browser mod' to click on a dashboard icon that shows your 'Lights On' count that then brings up a sub-view listing the light names?
@desertaip9137
@desertaip9137 6 ай бұрын
Fantastic tutorial. I changed my kludgy method of counting numbers of doors and windows opened and closed in my security system into two elegant code lines! Thank you! My device battery monitor sensor is now 6 lines of code instead of 64 My leak sensor code is 4 lines I stead of 32
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
Awesome! I will try to add some extra functionality in the next episode.
@desertaip9137
@desertaip9137 6 ай бұрын
@@SmartHomeJunkie using the label is really brilliant. If I add a new device I just have to add the label to it and it's automatically included. No code change to the sensor or automations!
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
@@desertaip9137 Yes, it is. I must say that TheFes helped me with the idea!
@daveforrester61
@daveforrester61 5 ай бұрын
So it turns out I have 210 light entities 😂. Rather than reject those that I didn't want, I created a Label 'Light Group', assigned that to all the lights I wanted to count and selected those that are on. This gives me 27 total lights. Some of those are light fittings with multiple luminaires, but I don't want to count all the individual luminaires. Another really good walk through thanks. Labels are proving to be really useful.
@bkflag
@bkflag Ай бұрын
I found it counter intuitive to exclude a bunch of labels as well. Can you share how you just included the label you wanted in the count?
@DavHill77
@DavHill77 3 ай бұрын
Great content 😊
@grahamshaw5531
@grahamshaw5531 6 ай бұрын
I have about 24 lights a mix of smart bulbs & Smart switches. According to Mushroom overview 12 are on.
@iamrenzotoo
@iamrenzotoo 4 күн бұрын
Great! And I understand it, but I can't overview the posibilities. What is there in Home Assistant to do with all these jinja commands? Perhaps a new video? :)
@SmartHomeJunkie
@SmartHomeJunkie 4 күн бұрын
You might want to start with episode 1 to understand it.
@wwolfram33
@wwolfram33 6 ай бұрын
Perfect timing - I was looking how to show how many lights are on within a dashboard. Is it possible to show the names of which ones have the state = ON in a dashboard?
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
I'll try to add that request to the next video.
@major_west
@major_west 6 ай бұрын
64 is a boat load of smart lights! We have only have 34, with maybe 10 more that could be made smart.
@birddroppings32
@birddroppings32 6 ай бұрын
I definitely appreciate these territorials and look forward to more, thanks. But, the example case seem very silly. If I'm leaving the house and wanted to know if any lights were on, I would rather see where/what light not just a number of lights that are on anywhere in my house... Then have to go find where/what light/s are on because it only tells me "x6 lights are on in the house somewhere". Seems way more logical to have all lights grouped by rooms they are in then check and report what group is still on when leaving. eg, lounge group on means that a light/s is on in the lounge then, hit the 'turn off lounge lights button' - knowing how many lights are on is pointless. That being said, you can set up automation to check when house goes to unoccupied state and turn off lights automatically, making it a truly smart home. If there are specific lights you like to stay on when away, then create a boolean input 'away lights stay on' and configure the automation to turn off all lights except these specific lights if 'away lights stay on' is on.
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
So. Just add a filter for your area and only the lights in that area are taken into account. I think you can do it yourself based on the tutorials in this series.
@squalazzo
@squalazzo 5 ай бұрын
please add this episode to your jinjia2 playlist, which seems to have only till 5th episode
@SmartHomeJunkie
@SmartHomeJunkie 5 ай бұрын
Hey, thanks for pointing that out! I'll get the missing episode added to the jinjia2 playlist pronto.
@cedricdelecole3964
@cedricdelecole3964 6 ай бұрын
Hi there, Nothing to do with this, but was looking for a way to bui build / store a LIST of items (like the last 5 phone numbers + timestamp) - using an helper ?? Then HOW to display that list on a dashboard ? This would be for a project to display missed calls on my dashboard ... many thanks !
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
I'll try to add this to a future episode.
@danielshiloah1485
@danielshiloah1485 6 ай бұрын
Great video as usual! Thanks for all the work you do! My lights in the house are a mix of light and switches domains. The use of labels is genius and was able to label all entities that are actually lights (either bulbs, switches (L/R), led strips). But i cant figure out how to add the switch domain list with the light domain list before i start filtering for labels and then state.... can you show us how to?
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
You can use the "change device type of a switch " helper to turn a switch into a light so that it will be recognized as being part of a light domain.
@danielshiloah1485
@danielshiloah1485 6 ай бұрын
@@SmartHomeJunkie omg that's perfect, thanks! ❤️
@edizatt
@edizatt 2 ай бұрын
{{ (states.light | list + states.switch | list) | selectattr('entity_id', 'in', label_entities('LIGHT')) | selectattr('state', 'eq', 'on') | list | count }}
@Niels-e3z
@Niels-e3z 6 ай бұрын
Great video, Thanks! I've some relays in my home wich are not indicated with "light." but with "switch." is it possible to add those?
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
Yes, you can. Use the "Convert device type of a switch" helper to convert your switches to lights.
@Niels-e3z
@Niels-e3z 6 ай бұрын
@@SmartHomeJunkie Never knew that, thanks!! :D
@SmartHomeJunkie
@SmartHomeJunkie 6 ай бұрын
@@Niels-e3z No problem
@adamfritzsche
@adamfritzsche 6 ай бұрын
How do I take this one step further and count only the lights on in a specific area?
@desertaip9137
@desertaip9137 5 ай бұрын
{{ states.light | selectattr('entity_id', 'in', area_entities('Kitchen')) | list | count }}
@bennopuetz206
@bennopuetz206 6 ай бұрын
I got stuck trying to count the lights on for a selected room - what to you select there?
@desertaip9137
@desertaip9137 6 ай бұрын
{{ states.light | selectattr('entity_id', 'in', area_entities('Kitchen')) | list | count }}
@joncentel4932
@joncentel4932 6 ай бұрын
👍
Yaml and Jinja Course Episode 7:   Creating your own sensors
12:35
Smart Home Junkie
Рет қаралды 11 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
YAML & Jinja course Episode 5: Calculations and Date and Time
12:48
Smart Home Junkie
Рет қаралды 7 М.
DIY mmWave Presence Detector
15:47
Licky's Smart Home Channel
Рет қаралды 7 М.
Are you maintaining your Smart Home??!
21:36
BeardedTinker
Рет қаралды 16 М.
Mastering Scripts in Home Assistant: A Comprehensive Guide
14:00
Smart Home Junkie
Рет қаралды 51 М.
YAML & Jinja course Episode 3: Conditionals & Loops (w/Examples)
10:44
Smart Home Junkie
Рет қаралды 9 М.
Self Hosting Has Changed My Life - What I Self Host
17:31
The Linux Cast
Рет қаралды 128 М.
Easy & Effective: The Best 5 Home Assistant Automations for Beginners
17:13
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 811 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН