Templates and Custom Sensors in Home Assistant - How To TUTORIAL

  Рет қаралды 151,839

Smart Home Junkie

Smart Home Junkie

Күн бұрын

Пікірлер: 323
@markhoffman
@markhoffman Жыл бұрын
You are one of the best Home Assistant teachers on KZbin
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you Mark! 🙏🏻🙏🏻🙏🏻
@herrstoy4766
@herrstoy4766 Жыл бұрын
Thank you so much from France! You helped build my first sensors. I've been struggling with this for 2 months. I'm very grateful!
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
That's great to hear!
@miguelavello7493
@miguelavello7493 2 жыл бұрын
Ed, you are just amazing !!!! The structure of your videos and use cases examples allow your followers to visualize many options and opportunities to apply your points to infinite possibilities. THANK YOU 🙏
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for this BIG compliment 🙏🏻🙏🏻🙏🏻
@webwolfdroid
@webwolfdroid 2 жыл бұрын
Ok I'm no noob when it comes to this kinda thing (but kinda new to HASS). After reading several articles, blogs, forums... I could not figure out how to get an asset to show "online" instead of "home". 5 minutes skipping through this 30 minute video and it's done. Simple as anything! Explained exceptionally well at every step and leaves nothing to be unsure about. Perfect example a good how to guide! Thanks for the time and effort you put into this!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for your compliments!
@ReinonX
@ReinonX 7 ай бұрын
Finally someone who made a step-by-step guide to make a light count for us newcomers! Thank you!
@TheRoeckie
@TheRoeckie 11 ай бұрын
Great tutorial, after spending hours on trial & (many) error based on Google results, your video was finally an eye-opener. Many thx
@pipomudano2044
@pipomudano2044 Жыл бұрын
You'r the best to explain the custem sensors as well. In my mothers tongue nobody can do that. thx
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you!
@BallsworthBallsbury
@BallsworthBallsbury Жыл бұрын
Ed, bravo as usual! I have a quick tip to share.... At 22:07 you're forced to scroll horizontally to show the code. To avoid this scenario in future videos, click the top header (where, in this case, it says "Entities Card Configuration"). That will make the window expand horizontally to the full width of your screen. A perfect solution for scenarios like this :) Thanks as always. Your videos are an tremendous help. Cheers from Kansas City!
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Wow, thank you! I didn't know this... I keep learning every day.
@BallsworthBallsbury
@BallsworthBallsbury Жыл бұрын
@@SmartHomeJunkie Things you've taught me: 1000 Things I've taught you: 1 It's nice to even the ratio a bit :D
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
@@BallsworthBallsbury ☺️
@TheUnofficialMaker
@TheUnofficialMaker 2 жыл бұрын
Sharing your knowledge in such a friendly and well explained way is really appreciated.
@brettgould8283
@brettgould8283 Жыл бұрын
One of the best video I have watched in a long time that showed me exactly what I have been looking for, for over a week. Thank you.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you for this compliment! 🙏🏻
@thierry3610
@thierry3610 2 жыл бұрын
Thank you for the concise & thorough explanation of templates, makes it much easier to understand and follow. Great work!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you.
@rolandweiss5883
@rolandweiss5883 26 күн бұрын
Wow, to me you are the best home assistant teacher and learn from every video. Thank you so much. I am very interested in how to create a binary sensor.
@SmartHomeJunkie
@SmartHomeJunkie 26 күн бұрын
Better watch this video which uses the updated way of creating sensors: Yaml and Jinja Course Episode 7: Creating your own sensors kzbin.info/www/bejne/sHvKaoysgrCejq8
@markusmaucher
@markusmaucher 2 жыл бұрын
Very nice tutorial again, the way you teach/instruct. Awesome. Thank you!
@major_west
@major_west 9 ай бұрын
Great tutorial. I've been using HA for a few years and finally feel confident enough to write my own templates. 💚
@johnhubbard3879
@johnhubbard3879 10 ай бұрын
Excellent tutorial. This is exactly what I was looking for! Thanks for NOT assuming anything and going step by step. So many videos I watch leave out so much. This is the second video of yours I have watched in 3 days; I am now subscribed 😊.
@MihaiKrieger
@MihaiKrieger 2 жыл бұрын
This has helped me achieve what I've been struggling with for a long time. This has also confirmed to me that I CANNOT change the battery icon color based on percentage in a Mushroom Chips card! I had wasted already too much time on that. Thank you!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You definately van change the icon color in a chips card based on a value of a sensor. For instance : - type: template entity: input_boolean.mail_arrived icon: | {% if is_state('input_boolean.mail_arrived', 'on') %} mdi:mailbox {% else %} mdi:mailbox-open-up-outline {% endif %} icon_color: |- {% if is_state('input_boolean.mail_arrived', 'on') %} yellow {% else %} grey {% endif %} hold_action: action: none double_tap_action: action: call-service service: input_boolean.toggle service_data: {} target: entity_id: input_boolean.mail_arrived tap_action: action: none
@MihaiKrieger
@MihaiKrieger 2 жыл бұрын
@@SmartHomeJunkie wow, thank you. I really have to sit down and have a look carefully
@fbechannel5322
@fbechannel5322 Жыл бұрын
You are like Angel, thank you I see you video at the right moment for my use cases. Thank U so much❤
@henger1980
@henger1980 2 жыл бұрын
Thank you for these great videos. I'm learning a lot from them. Just to give back a little for the others when only one light is on the grammar is not correct :D Use this code for the primary info and it will be correct: {% if states('sensor.number_lights_on')|int==0 %} All lights are off! {% elif states('sensor.number_lights_on')|int==1 %} 1 light on {% else %} {{states('sensor.number_lights_on')}} lights on {% endif %}
@mstemmer4573
@mstemmer4573 2 жыл бұрын
Thanks!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for your support 🙏🏻🙏🏻🙏🏻
@mstemmer4573
@mstemmer4573 2 жыл бұрын
Thanks! You do a great job!
@zipitrik1
@zipitrik1 2 жыл бұрын
This was exactly what I needed to learn , I had created a working template but had no idea how to integrate it to my frontend. THANK YOU !!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Great! When you watch one of me latest videos, you'll see that I use a different (modern) way of working with template sensors and the templates.yaml. I use that for instance in the garden watering video. It's even better if you store your templates like that, but this way of using it is also supported, so you should be fine.
@zipitrik1
@zipitrik1 2 жыл бұрын
@@SmartHomeJunkie Thanks for the info. I'm still new to HA so learning all the different ways to do things is great. Going to check that video now :)
@martinsidgreaves7924
@martinsidgreaves7924 2 жыл бұрын
Thank you so much! I've been getting myself in a right mess with this template stuff and you have made it so clear and simple. You've just gained another subscriber. Thank you again!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for your support Martin. 👍🏻
@vidarg75
@vidarg75 2 жыл бұрын
I've put off learning about templates for a long time. This helped me understand more. Thanks. I wish all your code in this video was in the ko-fi text file and not just the custom sensor code.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
What code are you missing exactly? The test code that I show in the developer tools? Maybe you can join on my Discord server so that I can help you.
@vidarg75
@vidarg75 2 жыл бұрын
@@SmartHomeJunkie I'm thinking about the code you paste into the card configuration at 27:57. I love copy and paste. Don't have to worry about typos when you paste. :-)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@vidarg75 I will look at it!
@Arq-System
@Arq-System 2 жыл бұрын
Great tutorial about templates and Mushroom Cards. Thank you! I just want to add add that you can avoid duplicating code in the Mushroom Template Card and make it more reusable. When you have allready assigned value to the Entity property in you card you can use it elsewhere, for example in definition of icon: instead of {{state_attr ('sensor.battery_status_kitchen', 'icon')}} you can write {{state_attr (entity, 'icon')}} Additionally, it makes the code easier to maintain and less error prone.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
That's a great addition. I wasn't aware of that. Thx! 👍🏻
@ziocacu
@ziocacu Жыл бұрын
Sei bravissimo, insegni concetti complicati rendendoli semplici.. Bravo!! 😊
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Grazie per questo complimento!
@davidlangley833
@davidlangley833 2 жыл бұрын
Whenever you release a new videos I start juggling around my HA setup. I think in the back of my mind I have of lots of ideas and when you dive in great detail it brings those things in my head to the forefront. Your expressive nature, detail and clarity make for a great experience. Thank you. 👍
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for your kind words ☺️🙏🏻☺️
@MarcLepage_RetroModelCars
@MarcLepage_RetroModelCars 2 жыл бұрын
Thank you for all those videos, I'm a beginner and I'm french speaking but your english and the structure of your videos make it easy to understand and to learn how to use this great HA. Thank you so much for this incredible work !
@davebareham1075
@davebareham1075 2 жыл бұрын
Just watched this....found it very useful. I will be putting it to use later :) ..yes, I have liked and subscribed! Thanks again
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Lovely! Thank you 🙏🏻
@K1GBD
@K1GBD 2 жыл бұрын
I've been struggling with icon templates for 2 days straight, but after seeing your vid here it all makes PERFECT sense and everything is working great! Thank you!! ❤❤❤
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
That is so great to hear!!!
@Dani-qv5cl
@Dani-qv5cl 2 жыл бұрын
yours is perfect. These are going to takes loads of ti off the learning process.
@clairerovic
@clairerovic 2 жыл бұрын
Thankyou for another wonderful adventure into Home Assistant. I figure you might be a bit of a mind reader as I was currently having fun in this area. For me I took a different approach to counting lights as I had a ZHA and Helpers groups for various lamps with multiple bulbs, which I wanted to count as a single light. So I created a 'List' and looped through it {% set lights_down = [states.light.bar_lamp,states.light.dining_dimmer] %}{{ lights_down | selectattr('state','eq','on') | list | count }}. This returns a count of 2 even though there are actually 3 lights. Then I ensured it was a Binary Sensor so I could test on On/Off with attribute of count (binary_sensor: !include binary_sensor.yaml).
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
That's also an idea indeed.
@davidtjac
@davidtjac Жыл бұрын
Very concise. Just what I was looking for. Thanks
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Awesome!
@marclambert9978
@marclambert9978 8 ай бұрын
Hi, Thank you for all the tips you are giving us, they are very useful. I'm having problem trying to set the icon for my sensor.value for the weather [current.condition] . The problem is related to the weather list based on the weather condition [ int ] that I cannot find anywhere other than in English. . Fx: I'm using a French UI I'd like to make sure I have the good translation to the current condition or even better the integer values to the current states as below in my languages. Is there is a particular place when the entire list of weather condition are available? [ int ] : Terms 3 : Cloudy (English) 3 : Nuageux (French) thank you for
@dbenyakar
@dbenyakar Жыл бұрын
Great tutorial. The Number Lights ON entity is used in my mushroom chips card where the entities are shown at the top of the dashboard. Can I use the code for the icon color change there? Been trying to it seems not possible.
@mareckorlicki6334
@mareckorlicki6334 Жыл бұрын
Hi This was a great tutorial and I implemented it a year ago But recently I noticed that it was showing a wrong total. After a bit of searching, I found the cause I had installed 3 new Reolink cameras and it was picking up the camera infra-red lights entities and adding them to the total these are exposed by the Reolink integration. I just 'piped a -3' in the Mushroom card on the dashboard and fixed the problem as I considered that the counting was not wrong but the display was including 3 lights that were not really visible as lights.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
You can also change the filtering of entities so that certain devices are not taken into account.
@louisviciedo
@louisviciedo 2 жыл бұрын
Thanks Ed, a great video on templates! Much needed as I expand my use cases in HAS. By chance do you have a video that returns a specific entity that triggered an automation? For example I have 5 smoke sensors and I want my notification to return the specific sensor that triggered the automation. Thank you!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
That's worth a video!
@lovshrm24
@lovshrm24 Жыл бұрын
just amazing!!!! one question how I can use the templates in esphome. for example wind direction, I have an esp32 adc pin reading voltage divider array, I want an esp32 to send different states depending on the reading. for example, if the reading is 3v then north, 2.8v east, 2.5v west, 2v south, 1.7 v northeast, and so on. code is working in the template editor after watching your video, it displays the direction according to the voltages. but I have no idea how to use it with esphome so that esp32 can send that state to home assistant. maybe I have to make a custom sensor with a platform template in esphome code but I can't figure out how. the project is a weather station and I want to send the state of wind direction to the home assistant. i really appreciate your help. thank you
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
It's too complex to explain in a comment, but it might be a nice idea for a future video.
@lovshrm24
@lovshrm24 Жыл бұрын
​@@SmartHomeJunkiehi i think i figure it out but I didn't try it, I just read the documentation and I think I got it, but I try it tomorrow if I got it work I'll let you know and also I can help you for your next video, but really your video helped me to learn templates. Thank you
@M4biz-g3d
@M4biz-g3d 2 жыл бұрын
Hi. ! great job. A complex argument made easy. Anyway I've a question for you that I've posted on the HA forum but without any useful reply . I’ve an ESP32 device connected to HA via BLE. The ESP32 is in deep sleep for the most of the time and , perodically, say 3 secs every minute, it is awake. When it is awake it sends the value on a specific pin (say pin 34) tha can be low or high. I’d like that on the HA dashboard will be an “indicator” (a sort of LED) that when the value on the pin 34 is High will be ON and remain ON even when the ESP32 goes to deep sleep. The led must go from ON to OFF (and remain OFF) only when, in the next awake interval, the value on the ESP32 pin change from High to LOW. In other words, I need of a sort of memory that need an high, momentary, value to set ON (and remain ON) and a low, momentary pulse to set OFF (and remain OFF). Have you ever faced anything like ? Thanks in advance.
@kdelios
@kdelios 2 жыл бұрын
Great tutorial, thanks a lot!! Just one question: How to exclude zha light groups from light count template? Thank you in advance!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Not sure. I do not use ZHA myself currently. You'd have to investigate which attributes are unique for ZHA groups and exclude entities that contain that attribute or attribute value.
@TheNikesh85
@TheNikesh85 2 жыл бұрын
awesome video, as always.... I do have a question though. how would you go about, if I had to change the light sensor to door sensor and identify how many doors (windows in my case) are open and give me a message exactly which window is open? I'd appreciate it if you could give me some hints, guidance etc... Thanks!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
This is definitely possible. I created this before, but would have to dive into it again.
@yegorstyblyna9257
@yegorstyblyna9257 Күн бұрын
It is the best tutorial! Thank you very much!
@JohanVromans
@JohanVromans 2 жыл бұрын
Great tutorial. Thanks. I'm puzzled by the | int | round(0,'floor') code. After int, it is a whole number, so rounding won't have any effect. OTOH, you would like to round down to multiples of 10, since the icons are battery-10, battery-20 and so on. In your example the battery status was 60, so it works, but when it drops to 59?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
I must say, I did not test all cases, so maybe the code can be improved. Anyway, it's just an example to illustrate how templates can work.
@JohanVromans
@JohanVromans 2 жыл бұрын
@@SmartHomeJunkie Ok, so I can stop puzzling ☺.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@JohanVromans well, I just double checked and you were right. The code was not entirely correct. I fixed it on the github page that I am linking to in the description. Thank you for being so sharp! 🙏🏻
@thijsclaessens8219
@thijsclaessens8219 2 жыл бұрын
@@SmartHomeJunkie to fix it, divide by 10, round and finally multiply by 10. It was quite the puzzle to solve. the templating page got the info required to solve. {{ (states('sensor.bewegingssensor_groot_battery') | int/10 )| round(-1, 'floor')*10 }}
@phillwallace1535
@phillwallace1535 2 жыл бұрын
This was by far the easiest way to explain this - Thank You! For the lights state is there a way to use state.light but sort for a group that you have created?
@radio-tropoli
@radio-tropoli Жыл бұрын
Takk!
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you for your support! 🙏🏻
@Ashleyhandz
@Ashleyhandz Жыл бұрын
{{ state_attr('sensor.bathroom_sensor_temperature','temperature') }} Result type: string shows as None. Any idea what may have caused this, is something wrong with the code? thank you
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Try {{ states('sensor.bathroom_sensor_temperature')}}
@tommyolsen861
@tommyolsen861 Жыл бұрын
Tak!
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you so much for your support 🙏🏻🙏🏻🙏🏻
@fergusgarber6151
@fergusgarber6151 2 жыл бұрын
Love this. Where can I find your template code. I would like to copy it and paste in my own entities. Thanks
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Ah, good point! I will add it to my Github page and will add the link in the description.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Done ;)
@fergusgarber6151
@fergusgarber6151 2 жыл бұрын
Thank you.
@renesrensen1928
@renesrensen1928 2 жыл бұрын
Great video, one of the best this year, hope you do some more on the subject, nice nice work learned a lot
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for this BIG compliment! 🙏🏻
@nicolasberg57
@nicolasberg57 Жыл бұрын
Hi, great tuto, very clear, step by step. Can you let me know which card you use for the animated weather card ? Regards
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
The animated weather card from HACS
@Alufakwa
@Alufakwa Жыл бұрын
Very clear and concise, I love it!
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Glad it was helpful!
@bjornsmedsgard6201
@bjornsmedsgard6201 2 жыл бұрын
Great video! I just started to play with templates and this video explain it on a good way! THANKS!
@TwanJaarsveld1
@TwanJaarsveld1 2 жыл бұрын
This is really cool! is it also possible for 2 motion sensors to become one ? for instance it turns on when one or the other gets triggered and only turns of when both stop detecting motion
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Yes, by placing them in a group!
@TwanJaarsveld1
@TwanJaarsveld1 2 жыл бұрын
@@SmartHomeJunkie Thanks ! I don't know why I didn't thought of that it sounds so logical
@robcork2620
@robcork2620 2 жыл бұрын
Hello Ed, is it possible for you to create a tutorila o9n how to install Home Assistant on a VMware virtual machine? I'm enjoying your informative how to's. Thank you
@peejayw
@peejayw 2 жыл бұрын
Excellent! I have used it to derive the difference between two temperature sensors and tell my ceiling fan to turn on when the difference is greater than 5deg. For some reason the difference is sometimes reported to 6 decimal places though! How would I get it to display to just one decimal place? Thanks so much for your great videos. {{ states('sensor.inside_temperature')float - states('sensor.rm_pro_temperature')|float }}
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You can add |round(2) to your template code.
@peejayw
@peejayw 2 жыл бұрын
@@SmartHomeJunkie Thanks so much, perfect.
@peejayw
@peejayw Жыл бұрын
@@SmartHomeJunkie What would I do to remove all decimal places so I get 25 instead of 25.8? Thanks so much.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
@@peejayw Use | round(0) at the end of the line in the template.
@SnTu9743
@SnTu9743 2 жыл бұрын
Best learning video ever. Thank you
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thanks for the compliments!
@impervious88
@impervious88 Жыл бұрын
I am having issues with adding a custom sensor into the sensors.yaml file. I already have a custom sensor but it's the old type "- platform: template" am I able to add a new sensor under this one but in the new method? "template: - sensor:" I am getting this error currently and wondering if you can help please? end of the stream or a document separator is expected
@peterandresrensen4793
@peterandresrensen4793 2 жыл бұрын
Icon colors not working with: - type: custom:template-entity-row as shown in video at: 21:58! (HA: 2023.1.2 - template-entity-row: 1.3.0)
@malayaleeking
@malayaleeking 2 жыл бұрын
This video is just what I was looking for! Very clear and concise! Thank you sir! 👍🏆
@jenswymeersch9653
@jenswymeersch9653 2 жыл бұрын
Hello, I've enjoyed your tutorial. I'm trying to build a template that gives me the answer to the following questions : Is there motion in the house and if so, where is the motion ? Any idea how this would look like ?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Interesting use case. I think it might be easier to use the auto-entities card from HACS to create this. I'd have to think about how to create a template sensor for this. 🤔
@jenswymeersch9653
@jenswymeersch9653 2 жыл бұрын
@@SmartHomeJunkie thank you for your quick reply. Another one, that comes to mind is related to door sensors and curtain switches. I'm now thinking in the direction of using NR to populate an input boolean and effectively the auto-entities card (which I never used)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@jenswymeersch9653 You don't need Node Red for that. (I'm not a fan of Node Red, but that is my personal thing)
@GTS_Grootebroek
@GTS_Grootebroek 2 жыл бұрын
Hello, I've tried and searched, but I can't count the number of lights that are on per area. The total number of lamps that go well. But per area, for example only in the kitchen, that doesn't work. Can I get some help on my way?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
I do not have an answer right away and would have to investigate this. At first glance it seems difficult because the area is not stored in the entities.
@godheid1998
@godheid1998 Жыл бұрын
Beste Smart Home Junkie, Heel hartelijk dank voor alle leerzame videos'. Ik krijg de lightcounter niet aan de praat en dat ligt denk ik met name aan het feit dat ik een conbee stick gebruik en geen deconz. Daardoor is de sensor niet goed. Als ik een deel van de sensor weghaal waarbij de "rejectattr' in staat werkt het wel alleen dan telt hij ook de groupen. Zou je mij een duwtje in de goede richting willen geven hoe dit op te lossen? Een voorbeeld van een van de groepen die ik gebruik is als volgt: light.dresden_elektronik_conbee_ii_bijkeuken_lampen_zha_group_0x0004 Bij voorbaat veel dank!!
@Novation681
@Novation681 2 жыл бұрын
Great, your channel is a must for new and experienced HA coders! Copied the light counter and it worked directly 👍 Any chance you could do a counter for switches and not the least counter for entities not available? Cheers
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thx. For switches is easy. Just replace light by switch and remove the two group exclusions.
@hanssmeets7424
@hanssmeets7424 Жыл бұрын
awesome video again. I am trying to do the light counter with Hue, and i cant seem to filer out the "rooms" i have 4 lamps in the group but it counts 5. I have tried rejectattr('attributes.is_hue_group', 'true') and |rejectattr('attributes.hue_type', 'defined') or but it always counts 1 extra. Any ideas?
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thx. Check the attributes of your Hue groups and reject the attribute that is in the group and not in a single bulb.
@Tman317
@Tman317 2 жыл бұрын
Ok, been using the "number of lights" template for a couple of months and have it on my dashboard. It's pretty cool. But now that I know that X number of lights are on, how can I get it to list which lights it found? That's what I want to know now!
@cyclope1960
@cyclope1960 2 жыл бұрын
Hoi Ed, bedankt voor deze geweldige uitleg over templates. Maar nu nog even een vraagje over de count template. Ik gebruik Wled met segmenten waarvan de segmenten aan staan en de master op uit. Dus mijn ledstrip is niet aan maar mijn segmenten worden wel geteld als zijnde on. Ben op zoek naar en oplossing maar vind deze niet.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Dat is een interessante case! Wellicht dat je de segmenten in een lightgroup kunt zetten en deze kunt includen in de template? De segmenten zou je dan moeten excluden. Het is maar een gok omdat ik zelf geen wled heb.
@peledudok
@peledudok 2 жыл бұрын
Hi, what kind of card are you using for the weather i see in minute 2:52 (our home dashboard)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
It's the animated weather card: github.com/bramkragten/weather-card
@peledudok
@peledudok 2 жыл бұрын
@@SmartHomeJunkie thx
@Starchilddk
@Starchilddk Жыл бұрын
Thanks Ed, I really like your video's, very informative and down to earth, keep up the good work :)
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Thank you for your kind words 🙏🏻
@adnanhukic1974
@adnanhukic1974 2 жыл бұрын
Another great video from SMJ, I would like to see future videos about Mushroom cards, like example how to create "Mushroom Chips Card" that showing count of lights with state "on" based on "Custom: Auto Entities Card. Thx
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Tanks, but why based on auto entities card? It's not needed to determine the number of lights that are on. You can just count all the light entities like how I do it in this video. But I might miss what you are meaning exactly.
@adnanhukic1974
@adnanhukic1974 2 жыл бұрын
@@SmartHomeJunkie Reason why I said that I would like to see count on lights with states "on" to be based on previously built custom auto entities card because that I have lights with switch domain and I have exclude entities that are not lights. After I adjusted custom auto entities card I was think that will be easier way the count option base on that card. I agree that way that you educate us through the your video is totaly acceptable and I will go that way. Thanks for your dedicated work.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@adnanhukic1974 since the latest version of Home Assistant, you can show a switch as a light and HA will count that switch as a light of you indicated that in the entity settings of that switch.
@adnanhukic1974
@adnanhukic1974 2 жыл бұрын
@@SmartHomeJunkie I know that we can change now entity name like from switch to light, I am on it, thanks for your quick reply.
@biegstal
@biegstal 2 жыл бұрын
Ed, again a lovely tutorial and a lot of information. The more you run HACS services, is that not memory intensive?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thanks Alfonso, I didn't experience any memory problems yet. But you can also use templates and custom sensors without using a HACS integration. I just used these two HACS frontend integration to make the tutorial more visual attractive.
@matthiashess
@matthiashess 2 жыл бұрын
Exactly what I needed. Great explanation. Subscribed.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Great to hear and Thank you!
@azbound5310
@azbound5310 2 жыл бұрын
Love your videos, enjoy the multiple things you cover to make my HA so much more! As a noob I tried to use the code you provided, but had issues when copying it into config and templates. Not sure where I went wrong. Will continue to investigate and see if I can get it working.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
I updated the download file and added some instructions in there on how to use it.
@azbound5310
@azbound5310 2 жыл бұрын
@@SmartHomeJunkie since I already downloaded the code, do I need to pay again to get the updated file?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@azbound5310 No. Contact me on Discord please. But the code was changed a week ago, so if you downloaded it after that, you should be fine.
@specialwilliams
@specialwilliams 2 жыл бұрын
Great and informative tutorial. Thanks Ed! Do you know if it's possible to do the colour and mdi:icon change on the "count number of lights on" Mushroom Chip card? I was looking for a way to do it, but i do not seem to understand how to do that.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Yes you can do this with a template card. In icon color put something like: {% if is_state('input_boolean.airconditioning_mode_heat', 'on') %} red {% else %} amber {% endif %}
@specialwilliams
@specialwilliams 2 жыл бұрын
@@SmartHomeJunkie Yes, i know this can be done with the template card (got that working allready). But i wanted the same functionality in a Mushroom CHIP card.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@specialwilliams You can choose a template as chip card. That was what I meant.
@specialwilliams
@specialwilliams 2 жыл бұрын
@@SmartHomeJunkie Yes, i see.... now i know what you meant! Thanks Ed!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@specialwilliams No problem, I was not clear enough!
@rodrigoclasen3876
@rodrigoclasen3876 2 жыл бұрын
I have some devices which measure energy and I create a sensor to sum all of them, but I cannot add this sensor to the energy dashboard, how can I create a sensor to input data at the energy dashboard?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Your sensor needs to have the correct unit of measurement to be able to do that. I guess that's the reason why.
@PedrokasPT
@PedrokasPT 2 жыл бұрын
Thank you for another amazing video ! Greetings from Portugal :-)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You're welcome
@ajaxstationers
@ajaxstationers 2 жыл бұрын
Thank you for great video. Could you please add the codes to blog for the dashboard entities cards
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Unfortunately, I do not have these cards on my own dashboard anymore :(, so I's have to rewrite the code. I will do that as soon as I find the time for this.
@ajaxstationers
@ajaxstationers 2 жыл бұрын
Thank you for your prompt reply. I have also sent an 📧. Regards Ajay
@danielgozzani
@danielgozzani 2 жыл бұрын
Great Video, Still digesting it though. Any change you can do a video on how to create this custom weather card with animated icons? or give me some pointers...
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Yes, I can: github.com/bramkragten/weather-card
@Tman317
@Tman317 2 жыл бұрын
Awesome, just implemented the number of lights template and mushroom card too, this is great! I really want to know now though, how is your "All Lights" button (at 25:49) implemented? I really want to have an All Lights Off button on my dashboard!
@fuuman5
@fuuman5 2 жыл бұрын
That are just amazing tutorials and so helpful! Thank you very much for your effort you put into these videos!
@antoniomazabandes5419
@antoniomazabandes5419 Жыл бұрын
Ed, perfect tutorial. but when I try to enter settings I get this: This entity ('sensor.entities_count') does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Add a unique ID to the template and you'll be fine.
@antoniomazabandes5419
@antoniomazabandes5419 Жыл бұрын
Error loading /config/configuration.yaml: while parsing a block mapping in "/config/sensors.yaml", line 205, column 5 expected , but found '' in "/config/sensors.yaml", line 207, column 7@@SmartHomeJunkie
@antoniomazabandes5419
@antoniomazabandes5419 Жыл бұрын
Can you give a small example?
@datawolk
@datawolk 2 жыл бұрын
How did you create the garbage collecting card? And is it possible with templates to only show a message when needed. For instance: if the paper bin is collected, only show it one day ahead? Instead of always showing a day or date.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You can download it here: ko-fi.com/s/43b474913b
@datawolk
@datawolk 2 жыл бұрын
@@SmartHomeJunkie Thanks! Do you also have an answer related to my templates question?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@datawolk Yes, you can show it one day ahead. It's also in the code.
@kerbalette156
@kerbalette156 2 жыл бұрын
Thanks so much for explaining this so concisely!
@RobFahndrich1
@RobFahndrich1 2 жыл бұрын
Great video!! Quick question on what cameras you use to get a real-time view in your dashboard?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thx. I have multiple. Ring and Reolink.
@RobFahndrich1
@RobFahndrich1 2 жыл бұрын
I am thinking of putting a Home Assistant in my RV so that I can monitor temps and a cameras. We have a need to leave the dogs behind and want to make sure they are quiet and not too hot. I currently have a Home Assistant at home. Have you done any videos on multiple instances of HA ??
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@RobFahndrich1 No, I did not, but it shouldn't be a problem to have multiple HA instances. I have two myself in my house. One for testing and one production instance.
@firebladejohnny
@firebladejohnny Жыл бұрын
How do you assign an area to a template binary_sensor? I tried attribute > location: "Room". But this was ignored.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Make sure the template had a unique id. After that you can sign an area in the UI.
@xisop
@xisop 2 жыл бұрын
Is it also possible for the code to count all the lights for one specific floor in the house? For instance ground level.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Yes, that should be possible. The template will be a little bit more complicated for that because you'd have to filter the specific lights in there.
@xisop
@xisop 2 жыл бұрын
@@SmartHomeJunkie top. Ga ik me daar maar eens in verdiepen. Bedankt voor al je video's. Echte helpers 👌 Denk dat ik het beste een groep kan aanmaken waarmee ik de lampen per verdieping tel, of beter alle entiteiten in een lijst zetten die geteld wordt?
@Kriss5054
@Kriss5054 2 жыл бұрын
Thank you very much for taking time to explain... you've helped me a lot ! I was wondering how to get the number of low battery devices ? I tried to duplicate the template removing unecessary lines but it doesn't work. I tried to create another template sensor with a template {{ 'Low Battery Devices' | count | int }} without success... Is there another way we can get it ?
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Check this video for that: HOW TO create your own Low Battery Warning Sensor In Home Assistant - TUTORIAL kzbin.info/www/bejne/jJi5kHiui8qGnKc
@Kriss5054
@Kriss5054 2 жыл бұрын
@@SmartHomeJunkie I made the comment at the wrong place… it was supposed to refer to the video you ask me to watch ! But this video explains how to make a list, not to get the number of sensors involved. Tried to duplicate code with a « count » function. Tried to make a new sensor with a count of the original one. But none works. I’ll investigate further more.
@Kriss5054
@Kriss5054 2 жыл бұрын
Found it out ! Just reworked the code in the other video. Kept the beginning until {%- endfor -%} followed by a simple {{ ns.sensors | count }} Now I will make a button with a green icon if everything is ok and a red mdi-battery-alert with a label stating the number of low battery devices . Click on that button will (If I manage to do it) open a popup with the list as you explained. That will be a great user interface I think... Thanks a lot ! 😉
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@Kriss5054 Wow, that's great to hear!
@abwino
@abwino 2 жыл бұрын
Hi! Thanks very much for this video. In the light counter, is there a way to reject browser mod entities which show up as lights? Thanks :)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Check the attributes of those entities and see if you can exclude them in the template sensor.
@abwino
@abwino 2 жыл бұрын
@@SmartHomeJunkie Thanks very much for your help.
@photelegy
@photelegy 2 жыл бұрын
23:00 ❓ How to use templates in a card (e.g. picture-element-card) to differ e.g. the color depending on a input_boolean? In the "Developer-Tools Template" it works but not in the card. My code is: style: color: >- {% if is_state('input_boolean.darkmode_manuell', 'on') %} blue {% else %} red {% endif %}
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Actually, the color is a style element and shouldn't be part of template which is a data element.
@photelegy
@photelegy 2 жыл бұрын
​@@SmartHomeJunkie Ok, thank you. Maybe I misunderstood the idea behind templates. I thought templates just writes the value (result) there where it stands. So because in "Developer-Tools Template" the result was rightfully ('red' if button=on and 'green' when button=off), I hoped it just puts in the result on the place in the code where it is. So if templates are the wrong tool for this, how is the right way to do it to be able to use it universally? (Maybe a HACS integration?)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@photelegy Hmmm, I am not sure if I understand you correctly. A template outputs a state and that state can be used in other places. If your card accepts a sensor template that delivers a color as a state than theoretically this should work. I thought that you meant that the template also contains a color.
@setmane
@setmane 2 жыл бұрын
Thk you very much. Easy, clear... ,thank you very much for your time
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You're welcome.
@christian1603
@christian1603 2 жыл бұрын
Alweer een fijne video van je ! Die template-entity-row kende ik nog niet 👌 Een vraagje/opmerking : ik dacht begrepen te hebben dat het gebruik van sensor.yaml afgeraden wordt en je deze zaken nu in templates.yaml moet stoppen... ? Voordeel is alvast dat je de templates afzonderlijk kunt herladen zonder HA te moeten heropstarten.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thx. Zou kunnen. Is mij niet bekend.
@christian1603
@christian1603 2 жыл бұрын
Ziehier de link : www.home-assistant.io/integrations/template/#legacy-binary-sensor-configuration-format En daar lees je dus dit : For old sensor/binary sensor configuration format, see below.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@christian1603 Goed punt. Heb ik weer iets om een video over te maken. 🙃
@sneffetsd
@sneffetsd Жыл бұрын
Exactly what i needed.
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
That's great to hear. I want to create an updated video shortly because of since changes in HA, but this still works.
@Paullik83
@Paullik83 2 жыл бұрын
This is awesome! Thank you for your time.
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Thank you for your kind comment!
@sevagjb
@sevagjb 2 жыл бұрын
Thanks for the important information you gave her, I have a question inspired by this video Can I do the same search for the battery sensors? If possible you can help me Thanks :)
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Good question. I haven't done that before. Do you mean detecting how many battery sensors that are unavailable?
@sevagjb
@sevagjb 2 жыл бұрын
@@SmartHomeJunkie yes exactly, and im new in jinja2 or in coding but i have fun in learning that
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
@@sevagjb Interesting case indeed. Shouldn't be that hard. If I have some time left I will look into this.
@sevagjb
@sevagjb 2 жыл бұрын
@@SmartHomeJunkie i found this code it is promising: {{ states | selectattr('attributes.device_class', 'eq', 'motion') | selectattr('attributes.device_class', 'eq', 'battery') | selectattr('state', '
@MattemanAutomation
@MattemanAutomation 2 жыл бұрын
Goede uitleg, heldere video! Ik denk dat ik er binnenkort mee ga spelen zodat het één en ander niet alleen functioneler wordt, maar ook mooier :)
@ankujnarchal5415
@ankujnarchal5415 2 жыл бұрын
Hey, Great stuff. Love your videos. I do have a question for you. I created the sensor for number lights on however then decided to change it to number of lights on. Now i am seeing both sensors appear in the entities even though the code ive got is just for number of lights on. How do i remove the number lights on so that i dont see it in the entities anymore
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Hi! I'm not sure if I understand your question tbh.
@joeblstrn
@joeblstrn Жыл бұрын
I have lumi.motion. sensors.. they work and sense well but after a few days they stop... I tried everything and nothing fixxed it... a day later it started working again and now it has stopped again,... any ideaS?
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
Probably not a strong zigbee network. Place more router devices in your Zigbee network. (Like lightbulbs)
@Joseph-ko2kl
@Joseph-ko2kl 2 жыл бұрын
Ed Thanks! I am getting the following error- Invalid config for [sensor.template]: expected dictionary for dictionary value @ data['sensors']['icon_template']. Got 'mdi:lightbulb-group'. (See ?, line ?). Spaces are correct any clue what is going on? if I just remove the icon line config is valid. EDIT- So I fixed it- This is why I hate YAML- I typed the exact thing you had on screen but I had to put an extra space on the last line and it was fine. I do have an additional sensor in my sensor.yaml and I had to put 2 spaces then the - platform other than that it is exactly what you showed - Why would it be different? THANKS!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
Not sure. Anyway, I added a link to the code that I used in the description of this video, so now everyone can just copy and paste it. I wouldn't recommend copying and pasting though, because I think you learn more if you write the code yourself.
@Erikstbye
@Erikstbye 8 ай бұрын
I have a sensor: “sensor.solveien_total_lifetime_energy_output_2”. This sensor counts lifetime kWh produced by my solar panels. I like to make two new sensors that gets it value from the “solveien_total_lifetime_energy_output_2” sensor. The two new sensors need to be updated with new values, once each month, day 1 at 00:00:01, and the second sensor need to be updated once a year, January 1. at 00:00:01. The monthly sensor can be named: growatt_lifetime_mnd_value The yearly sensor can be named: growatt_lifetime_year_value Do you have a tutorial covering such topics in how to make?
@RichardRem-e2q
@RichardRem-e2q 11 ай бұрын
Hi Ed! Again nice video's, please continue with the great work. I followed this video and was interested in the section: number of lights that were on. Have just two questions/problems to solve: 1. I tried to do this and added a line in configuration.yaml and created the sensors.yaml (and rebooted afterwards), but at the developer [status], i cannot find the entity with friendly name. (in your video around 19min.) Configuration.yaml (end of the file I wrote): sensor: !include sensors.yaml Sensors.yaml I wrote: #### Count number of lights on ############################### - platform: template sensors: number_lights_on: friendly_name: Aantal Lampen Aan value_template: >- {{ states.light | rejectattr('attributes.is_Axis_group', 'eq', true) | rejectattr('attributes.entity_id', 'defined') | selectattr('state', 'eq', 'on') | list | count }} icon_template: mdi:lightbulb-group 2. I have several Axis cam's and think he is also calculating the infrared lights. Do i have to make this line: | rejectattr('attributes.is_Axis_group', 'eq', true) --> or just fill in the brandname AXIS? I tried all, but when i have the IR of one of the Axis fixed on ON, it will still calculate it to the totals. How can i exclude those? Because the attributes Axis or similar doesn't seem to work. Hope you can advise me to this. Thanks and greetings. Richard
@cwh6091
@cwh6091 Жыл бұрын
When I add the sensor include line in configuration.yaml, I get sensor duplicate errors! What can I do about that?
@SmartHomeJunkie
@SmartHomeJunkie Жыл бұрын
You cannot have two sensor: entries in your configuration.yaml. That said, you cannot have two sensor: entries at all. So, if you also use a sensors.yaml or templates.yaml you will get this error. the modern way is to use a templates.yaml, but the method in this video still works as well.
@cwh6091
@cwh6091 Жыл бұрын
@@SmartHomeJunkie Thanks for clarifying!
@Bijstandskoning
@Bijstandskoning 2 жыл бұрын
Great video! Thanks again for sharing your knowledge!!
@SmartHomeJunkie
@SmartHomeJunkie 2 жыл бұрын
You're welcome!
@Tibrus74
@Tibrus74 Ай бұрын
Excellente vidéo, thanks to share it But one question, where are you add the icon ? Exemple with battery state where you change icon regarding mdi:battery-batterylevel but where home assistant find icons because you don't add path to find it on interne 😉 So I think you have copy some icons in a home assistant folder
@SmartHomeJunkie
@SmartHomeJunkie Ай бұрын
This is quite an old video. You better follow this course instead: YAML & JINJA Templating Course kzbin.info/aero/PLKuGrHcHLKMiUTClEE8vb60m9v3ijFEhQ
@Tibrus74
@Tibrus74 Ай бұрын
@@SmartHomeJunkie Ok thanks. But it's was light and easy the configuration in this vidéo
Mastering Home Assistant Templates: A Beginner's Guide
23:56
SlackerLabs
Рет қаралды 58 М.
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Create your OWN Template Sensor with Home Assistant Coding Tutorial
13:30
Smart Home Makers
Рет қаралды 59 М.
11 Essential Tips For Home Assistant Beginners!
14:49
Everything Smart Home
Рет қаралды 127 М.
I Made My Smart Home Presence Sensors Even Better! + Updates
16:23
Everything Smart Home
Рет қаралды 68 М.
How To Make Your Dashboard Smaller And More Efficient
20:35
Smart Home Junkie
Рет қаралды 46 М.
Improve your UI in Home Assistant with 4 HACS components
13:44
BeardedTinker
Рет қаралды 58 М.
Yaml and Jinja Course Episode 7:   Creating your own sensors
12:35
Smart Home Junkie
Рет қаралды 11 М.
Mastering Scripts in Home Assistant: A Comprehensive Guide
14:00
Smart Home Junkie
Рет қаралды 51 М.
Zigbee2MQTT vs ZHA vs deCONZ - WATCH THIS BEFORE YOU DECIDE!
13:35
Smart Home Junkie
Рет қаралды 82 М.
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.