Do you know of any other ways to show the battery status of your devices? Let me know in the comments!
@paul-tiberiumiclea14292 жыл бұрын
Hi, yes If I go on state's and call any device with battery I see the value in the state
@aaronjohnson87152 жыл бұрын
In NodeRed: [MQTT NODE] -> [JSON CONV NODE] -> [FUNCTION NODE] var json=msg.payload.battery; if ( json < 30 ){ msg.payload = "Battery is running low on: " + msg.topic +", battery level is: " + msg.payload.battery; return msg; } return 0; This has an mqtt listener to "zigbee2mqtt/+", which then checks the battery level of all updates. When it sees one with battery being reported as below 30 it passes a message out to a push notification. A trigger in the path prevents multiple notifications within an hour. So far this seems to cover all of my devices, but an elseif statement could make this far more flexible if needed.
@notfu9320 Жыл бұрын
I use the "auto entities" card from Hacs .. really quick and basically no code.. no helpers. Also use it to create a dynamic list to show motion or lights on my dash. Really clever card.
@SmartHomeJunkie Жыл бұрын
@@notfu9320 yes, that works as well. With the code in this tutorial you can also make sure that you get a notification on your phone when a battery gets a low value. I believe that cannot be done with the auto entities card.
@AndrewGlasgow20202 жыл бұрын
Another terrific video - and I was happy to buy the code. One very small correction: at 11:20 you reload the template file without restart. TEMPLATE ENTITIES only appears in the list after you have done one restart since adding the "!include templates.yaml" statement in configuration.yaml. So you have to do one restart (after checking configuration is OK of course). Then you can refresh TEMPLATE ENTITIES after any updates without a restart.
@royahuis74582 жыл бұрын
Great explanation. Watched a lot of your tutorials to improve my HA setup for my new house and I really like your videos! Thanks for making them.
@rickz60062 жыл бұрын
Thanks for this I learned a few things once again, glad I found this. When I decided to do a battery warning in HA I went Node Red. Took only 4 nodes an inject, get entities, format and call service. Batteries are checked every day at 3pm and a message is sent to my iPhone if any are low. New devices with a battery are included with no new code changes. The alert will repeat daily until the battery(ies) are replaced or charged as the case might be. Did a more complex version to do actionable notifications for low printer ink with the ability to mark the low ones from the iPhone once the replacement has been ordered. Keep the videos coming!
@SmartHomeJunkie2 жыл бұрын
Yeah, I do have a low printer ink automation as well. The notification on my phone also leads me to an online shop to order the correct cartridges. It's just one click and I can order them. Life saver!
@IanTakats2 жыл бұрын
Thanks for the hard work you put into making this video and for sharing the code. I was up and running in less than five minutes after watching your video. Great idea.
@SmartHomeJunkie2 жыл бұрын
Thank you for your kind words Ian!
@bartmulder6995 Жыл бұрын
Thanks!
@SmartHomeJunkie Жыл бұрын
Thank you for your support Bart 🙏🏻🙏🏻🙏🏻
@bartmulder6995 Жыл бұрын
I'm a SmartHomeJunkieJunkie now@@SmartHomeJunkie
@SmartHomeJunkie11 ай бұрын
Hahaha
@plankton9864 Жыл бұрын
I added this widget today. Pretty great! Love the interaction and not just a panel of dials and buttons. Good Stuff!
@okieculturalcenter Жыл бұрын
Great video. I got it running and it's great for monitoring all of the batteries. I then setup another version to report if any of my temperature sensors start reporting high temperatures. My smoke detectors don't monitor heat and now I've got that.
@OSchubert682 жыл бұрын
Danke!
@SmartHomeJunkie2 жыл бұрын
Thank you for your support!
@danielshiloah14852 жыл бұрын
Truly a great video, was trying to achieve this for a long time. I learn so much from your tutorials, keep up the awesome work!
@fabiocopani831111 ай бұрын
So useFULL! Just added to my Mushroom DashBord and it's AMAZING! thank you very much dude!
@SmartHomeJunkie11 ай бұрын
Great to hear!
@JacobDanielson7 ай бұрын
This is great, thank you! Wanted to add that I found including "| rejectattr('attributes.friendly_name', 'contains', 'Phone')" in the first for loop helped to remove tracking any of our phone batteries in the notifications!
@robsfungaming9722 Жыл бұрын
I love it. It works like a charm. Thanks you so much. I also wanted to show a custom message when when there no batteries need attention instead of hiding the card but got lost in the code
@BlitzFingers11 ай бұрын
That worked well and I learned a little more about working with a yaml file. Thanks for the nice feature!
@sekt19532 жыл бұрын
Hi Thank you for your always great videos; but just a note, if you right click in the VSCode Editor window, you will find an option: Generate UUID at Corsor.
@SmartHomeJunkie2 жыл бұрын
Thanks! I did not know that. Learned something!
@SmartHomeJunkie2 жыл бұрын
And I used this info on my new video 😉. Thx.
@videosfromniek2 жыл бұрын
Thank you for this turorial. Your in my view the best in explaining code. bytheway Unique code generator is in Studio code server... right click on the line in which you want the unique ID and select it
@SmartHomeJunkie2 жыл бұрын
Thank you! Yes, that is correct. I believe I show this in another video somewhere. I didn't know yet at the time when I created this video 😏
@YevgeniyBolembakh2 жыл бұрын
Great video tutorial like all of your videos. Loved. Thank you
@miroslawkaczor70822 жыл бұрын
This was really good. Well done!
@EmiAgriDiY2 жыл бұрын
Great video 👍👍👍 Great channel 👍👍👍 👋👋👋
@xcremers12 жыл бұрын
werkt perfect dit zocht ik al heel lang bedankt man
@SmartHomeJunkie2 жыл бұрын
Wat fijn dat het goed werkt voor je!
@wesleykirkland7150 Жыл бұрын
Thank you so much for this! I went ahead and donated to support you. One question I have is on notifications, I'm using this in a notify service, is there anyway to extract out the batteries that are low for the Slack message? Low Battery Alarm The battery of the sensor(s) {{sensor}} is low. On a misc note have some Ring Contact. Sensors and I have to hide several entities that were showing as a battery for some random reason.
@SmartHomeJunkie Жыл бұрын
Thank you. You can use {{ states('sensor.yoursensor') }} in your message.
@wesleykirkland7150 Жыл бұрын
@@SmartHomeJunkie Thanks! I tried the sensor.sensorname but never tried it wrapped in states.
@assistant-q4m4 ай бұрын
Loved the video, agree with your view of only showing the batteries that are running low, but i have been trying to do one thing just as a visual preference, ( i must say i am a novice at HA ) i was trying to get the icon to show with the device name and percentage, i only wanted to have them visually show as either yellow or red, yellow indicating i have some more time before i need to take action and red when, ok you better go replace the batteries now. I tried everything i could think of in modifying this card and everything chatgpt suggested but got no where even with switching to different card types. Can you help if it is possible to do with the way you present them? Appreciate any input. Great work on the videos btw very detailed which is outstanding.
@tonyseeley11 ай бұрын
Fantastic, thank you, just what I needed.
@clairerovic2 жыл бұрын
Good Morning, another wonderful video. Really did like the pop-up that refreshed you on the data source i.e. the state attributes. When your trying to retain knowledge without a computer in front of you, it makes it so much easier. I have always call the file, sensor.yaml, is there any rules that I should be following or did I miss the memo.
@SmartHomeJunkie2 жыл бұрын
Yes, there's a new and modern way of handling template sensors and that is by using the templates.yaml. The old way of using template sensors does not always work together with the new way unfortunately, so if you want to use the modern way, you should migrate all your template sensors to the templates.yaml and reformat the code a little bit.
@TommyBrenner2 жыл бұрын
Thank you so much, this will definitely replace my "battery level" dashboard.
@Koko-badu2 жыл бұрын
Great vid! You have a talent to make vids for starting audients that can be useful for bit more advanced users as well. Well done.
@SmartHomeJunkie2 жыл бұрын
Thank you!
@danielbraun3503 Жыл бұрын
Thanks for another stunning video! I am just wondering how to implement batteries that do not give a specific value of the battery state but only if the battery is low or not. Did you try this? Could you please give a hint how to do this as well to a noob as me? Thanks again!
@SmartHomeJunkie Жыл бұрын
Thanks! You can do that by filtering on the state of the entities. Filter on the state is low.
@TheUnofficialMaker2 жыл бұрын
very thorough, thanks.
@johntisbury2 жыл бұрын
Thank you, this was very useful and very well explained. I shall be trying this out.
@jlmossjr2 жыл бұрын
This is great thank you, would it be possible to do a similar card/sensor/output for the linkquality attribute?
@SmartHomeJunkie2 жыл бұрын
As long as it's available in the entity as an attribute it should be possible indeed.
@jlmossjr2 жыл бұрын
@@SmartHomeJunkie it looks like it on all the entities related to my aqara motion sensors (occupancy/battery/lux etc). Has an attribute linkquality with the rest
@Kriss5054 Жыл бұрын
I really appreciate your work. How to adapt your code to get the list of opened windows for example ? Is ther anything to change to loop all the binary_sensors ? I've made many tries without succeeding... No help found on internet neither... Thanks
@SmartHomeJunkie Жыл бұрын
Thanks. This video answers your question: Never Forget To CLOSE YOUR DOORS Again When You Leave (With templates masterclass) kzbin.info/www/bejne/ravZfWOLiaaqapY
@Kriss5054 Жыл бұрын
@@SmartHomeJunkie Top ! Thank you very much !
@Novation6812 жыл бұрын
Lots of gold nuggets in this one, thanks! :-)
@SmartHomeJunkie2 жыл бұрын
Thank you for the compliment!
@testguy37374 ай бұрын
As always very informative and helpful. I do have a few questions however, mostly related to the yaml code. In the earlier video "Templates and Custom Sensors in Home Assistant" the blocks are defined by "platform: template" with a sensors: token below it. In this video, the whole file is in the templates domain (I think domain is the right yaml term) and sensor listed below it. While the hierarchy seems roughly the same, the syntax certainly isn't and I find it confusing on which to use when. The other thing that confused me is in the templates.yaml file in this video, after the sensor: tag, the following lines are indented 4 spaces vs. the normal 2. I indented mine 2 and the sensor wasn't seen - when I also indented 4 it worked but I don't understand why. Any insight you have to these would help me in this mysterious land of yaml. Thanks again for all your good work.
@SmartHomeJunkie4 ай бұрын
The video you are referring to is old. Please follow this course to fully understand templates: kzbin.info/aero/PLKuGrHcHLKMiUTClEE8vb60m9v3ijFEhQ&si=KT29mvTX0eRjQeSV
@chiribogas2 жыл бұрын
Great video!!. It seems that the code as is, is not working for me pore some reason. I have a couple of devices that have a "device_class" as battery, but de state is not a number, yet it s picking it up. any ideas of what I did wrong?
@NeilSleightholm2 жыл бұрын
Great tutorial. I found I had to remove the attributes.state_class from the template as not all my battery sensors have the class measurement.
@SmartHomeJunkie2 жыл бұрын
Thx. And great to hear that you managed to adapt it to your own needs. Top! 👍🏻
@daleholden2 жыл бұрын
Great video just what I was looking for
@setmane2 жыл бұрын
👍 thank you very much, for yr time and patience. Really great
@fredaker8353 Жыл бұрын
Another great video. I was glad to contribute. I have a couple of batteries where the value is coming from the internet (Apple, Ring & BMW). They are missing the 'state_class: measurement'. What would you suggest as a workaround for a NOOB?
@fredaker8353 Жыл бұрын
I added 'state_class: measurement' to BMW and it is showing up. I suspect this will break the next time the integration is updated.
@SmartHomeJunkie Жыл бұрын
Thank you for your support!
@Smoothy0911 Жыл бұрын
Hi and many thanks for this very interesting tutorial.👍 Well done 😄 I tried the "auto entities card", but have some problems to configure it for devices not using the device_class: battery (who use % as value) but the device_class: voltage, because I have devices running with 1.5V and others with 3.0V and so on... When creating the card and setting the threshold for ex. to 2.6V as alarm for all the 3.0V devices, all the batteries from the 1.5 devices are also listed as alarm... I hope you understand what I mean :) So now, I wonder if with your project, it is also possible to solve my problem, when using the device_class: voltage with different voltage levels for different devices and then also different thresholds (setpoints)? I think changing the code part in your project to use the needed class will be ok and running for voltage instead of %, but I'm currently stuck with the problembut how to show in the list only the batteries with a real alarm level, depending on the real operating voltage of the individual devices. At the moment, if the threshold is set to 10.5V as alarm level for 12V devices, all devices running with lower voltage will be shown as low level alarm in the list....!? These are the state attributes from one of my devices who do not use the device_class: battery but voltage: state_class: measurement interface_id: ccu3-webui-HmIP-RF address: 00365F29AC1C5D:0 model: HmIP-SWDO-2 entity_type: generic parameter: OPERATING_VOLTAGE function: null value_state: valid unit_of_measurement: V device_class: voltage friendly_name: Fensterkontakt_EG_Flur Betriebsspannung Thanks for any help and suggestions.
@markday31452 жыл бұрын
Lots of useful hints here. Thanks! For this specific use case, an Entity Filter card seems like it would also work, and perhaps be a little simpler. You'd end up with something like an Entities card containing all of the battery entities with low charges, which has the advantage that they would display icons and percentages automatically.
@SmartHomeJunkie2 жыл бұрын
Yeah, but what's the fun in that? 🤪 I looked into the auto-entities card too, but really wanted to have more control. Not sure what the exact reason was that I did not use it, but there was something that I was missing. 🤔
@aldenyarde21942 жыл бұрын
@@SmartHomeJunkie Interesting approach. Thanks for the info. I use the auto-entities card with a template filter to generate the list. It's a bit simpler and the exclude statement allows individual entities to be omitted (or multiple if you use a template in the exclude statement).
@andrebelmudespaiusco1932 жыл бұрын
But wouldn't you need to update the list every time you add a new sensor? And it seems a bit annoying if you want a helper to define the threshold instead of a hardcoded value
@philippelejeune85862 жыл бұрын
Great video. Very much didactic. Thanks for sharing, philippe
@SmartHomeJunkie2 жыл бұрын
Thank you for the compliment Philippe! 👍🏻
@WayneNaylor25 Жыл бұрын
I bought the download for this video and I see that I was missing the "unique_id:". Anyway, it is working now thank you for this excellent video and codes.
@SmartHomeJunkie Жыл бұрын
Thank you for your support 🙏🏻
@Vlaryn Жыл бұрын
I am getting a } at the end of my markdown card and I also would like to know how would I go about excluding an entity. I would rather it not show my cellphones in this list. Thanks!
@gabriel600r2 жыл бұрын
Thank you very much for the video, one better than the other.
@paulpringle64412 жыл бұрын
Great tutorial
@evelien13432 жыл бұрын
Thank you for the nice video. I also have devices that have a battery state that is not numeric, but a text value. It just says 'Normal' or 'Low'. Would it be possible to show those devices as well?
@SmartHomeJunkie2 жыл бұрын
Sure, just add them to the filter in the template.
@jerdejager Жыл бұрын
Hi Ed. The low battery template is great. Unfortunately I have some devices (Tado) that have binary sensors to indicate low battery. Its state is ‘normal’ or ‘low’. Is there any way to add this to the code? Cheers!!
@WayneNaylor25 Жыл бұрын
Where did you get the "Low Battery Devices" entity from. When I did this the only entity like that I encountered was "Low Battery Level" which was an automation. I know that you wrote it in the template.yaml but I don't have an entity named "Low Battery Devices". Did I miss a step somewhere? My template.yaml file is correct. Please help me.
@stanleyso-vb7dy8 ай бұрын
Hey! New subscriber, what sensor do you recommend for smart lock application? Are there any smart circuit boards out there that doesn't need the use of home assistant?
@dennisterpstra42022 жыл бұрын
Thank you for another great video.
@stevephipps93052 жыл бұрын
My battery level of my moto z3 and HA's level do not match any way to increase update interval of my moto z3 battery level in HA? Or do I have a different issue thanks for any info and thanks for the videos
@daviddonnelly84062 жыл бұрын
This is a most excellent video! But... Did I miss, how do you get a notification such as in e-mail or text that a battery or batteries are low?
@SmartHomeJunkie2 жыл бұрын
See one of my other videos for that.
@daviddonnelly84062 жыл бұрын
@@SmartHomeJunkie will do! Thanks!
@jenswymeersch96532 жыл бұрын
I like the video and I've implemented it. Thank you ! The only problem I'm having is that if the result of the markdown card is >=9, the 9th entity is only partially visible where the rest is invisible.
@SmartHomeJunkie2 жыл бұрын
That is because the state of the sensor can only be 255 characters.
@jenswymeersch96532 жыл бұрын
@@SmartHomeJunkie is there anything to do about that ?
@SmartHomeJunkie2 жыл бұрын
@@jenswymeersch9653 No, it's a system limitation. But if you have so many batteries that are below a certain level, you'd have to replace the batteries anyway and the list will be shorter. 🤷🏼
@jenswymeersch96532 жыл бұрын
@@SmartHomeJunkie agreed. That said, the number of battery driven devices has become quite large - 100. So 10% will bring me over the limit...
@SmartHomeJunkie2 жыл бұрын
@@jenswymeersch9653 You can also use a different approach by using the auto-entities integration from HACS. Maybe that one fits you better?
@sygad12 жыл бұрын
Thanks for the video, im going to try this out. QQ - Is line 19 missing a character at the end? -%>
@MAMDAVEM2 жыл бұрын
Great tutorial... THANKS! It would be helpful to have a notification sent if low batteries were identified.
@SmartHomeJunkie2 жыл бұрын
That shouldn't be too difficult to create.
@MAMDAVEM2 жыл бұрын
@@SmartHomeJunkie what state change would you look for to trigger the notify automation?
@SmartHomeJunkie2 жыл бұрын
If state changed from unavailable to something else. So, only the from state should be entered in the trigger part of the automation.
@MAMDAVEM2 жыл бұрын
@@SmartHomeJunkie sorted THANKS!
@SmartHomeJunkie2 жыл бұрын
@@MAMDAVEM Brilliant! 👌🏻
@SBinVancouver2 жыл бұрын
Clear and helpful, as usual. I imagine that device_class == battery will be consistent between different manufacturers' devices. But can one count on state_class always being "measurement"?
@SmartHomeJunkie2 жыл бұрын
It depends on your specific devices, but you can check in the developer tools what the attributes are for your devices and adapt the code if measurement is not available for specific devices in your setup.
@antoniodecrisci23692 жыл бұрын
thanks! followed your tutorial, works exactly as you decribe. Another great addition. Do you think an automation could be made based on the unavailable to available state, and send the persistent notification that a battery is low?
@SmartHomeJunkie2 жыл бұрын
Yes, that shouldn't be a problem. Just create an automation with a state trigger on the created sensor and you'll be fine.
@antoniodecrisci23692 жыл бұрын
@@SmartHomeJunkie thanks, using this as a trigger in my automations, I set it up to send me a message on my phone and in HA. trigger: - platform: state entity_id: - sensor.low_battery_devices from: unavailable
@SmartHomeJunkie2 жыл бұрын
@@antoniodecrisci2369 Great Antonio! Love it. 👍🏻
@YevgeniyBolembakh2 жыл бұрын
@@antoniodecrisci2369 How you create a message with entities names which have a low battery level?
@antoniodecrisci23692 жыл бұрын
@@YevgeniyBolembakh I actually used this blueprint for my batteries and you can add the battery in the message: community.home-assistant.io/t/low-battery-level-detection-notification-for-all-battery-sensors/258664
@JayRushMedia2 жыл бұрын
Great video! I'm struggling with adding binary sensors to your sensor code. some of my sensors only show 'on' or 'off' as a battery warning when the cells get low I've tried adding states.binary_sensor and using the battery device class and state = 'on' but i just get errors in the notification and it stops the whole sensor working. Anyone able to help?
@SVRockChalk9 күн бұрын
Im getting my "Low Battery Threshold" as "Unavailable when I check it in the Developer tools? Any ideas?
@dutchufo4real722 жыл бұрын
Hoi Ed, een erg leuk kanaal en super gave tips. Zelf al jaren bezig met Home Assistant maar nooit te oud om te leren. Keep up that great work. We hebben wel wat raakvlakken, ik zie je vaak in je muziek omgeving, deze passie is er ook bij mij. PS: Ik volg je via twee accounts nu ook die van dutchufo4real. - Fijn weekend. Gr. Ray
@SmartHomeJunkie2 жыл бұрын
Dank je wel voor je leuke reactie! Yes, ik studeer (op mijn leeftijd) om muziektherapeut te worden. Met dit kanaal kan ik mijn studie een klein beetje financieren.
@dutchufo4real722 жыл бұрын
@@SmartHomeJunkie Fijn en leuk dat je dit zo kan combineren. Ja dat klopt wel muziek werkt erg therapeutisch, ik merk zelf dat ik wanneer componeer er een meditatie effect vanuit gaat en met improviseren je iedere keer wat maakt. Ik heb helaas geen screens van mijn HA oplossing op het kanaal staan. Gr Ray 🙏
@Gladers.2 жыл бұрын
So cool. Thanks for this!
@Gladers.2 жыл бұрын
question, can I use this low battery devices to make an automation to send notification to phone when a unit goes below X% ?
@Tman3172 жыл бұрын
Thanks, this was awesome! Just finished implementing all of this, works great! And I also learned about the templates.yaml file. I had a few templates within my configurations.yaml that was making it quite cluttered. Now all moved to a separate file. Thanks again!
@josefpay80422 жыл бұрын
Thank you for all your Videos to Homeassistant. With this one, I have a problem, because if I set the threshold to 70% (or any other number) I still get unavailable and dont know why.
@SmartHomeJunkie2 жыл бұрын
Check the template in the developer tools and see if your devices get filtered by it.
@josefpay80422 жыл бұрын
@@SmartHomeJunkie No they dont get filtered It says unavailable, even if I raise the % to 99%
@SmartHomeJunkie2 жыл бұрын
@@josefpay8042 You have to change the template so that they get included. The video explains how the template works and you can adapt it so that it fits your devices.
@AlexSherm Жыл бұрын
Do you have a way to keep track of what battery each device uses and append it to the battery level script?
@SmartHomeJunkie Жыл бұрын
Hi! Do you mean the type of battery?
@AlexSherm Жыл бұрын
@@SmartHomeJunkie correct, I want to track which device uses which battery so I know if I have it or need to buy more before it dies.
@SmartHomeJunkie Жыл бұрын
@@AlexSherm Interesting question... I have to think about it. It is possible with some nasty code, but I would like it if you can add that info to the existing battery entity.
@Hyabusa82 жыл бұрын
I paid of the template from your previous video however the light code gives me error. What do I need to change about the lights?
@SmartHomeJunkie2 жыл бұрын
That depends on the error you get. Might be many reasons.
@TiborMiska2 жыл бұрын
Great video as always, just one question! All my sensors with batteries are running true zigbee2mqtt and don't have a state_class so the battery sensor isn't working. Any tips how to resolve this?
@SmartHomeJunkie2 жыл бұрын
Thx. The best way to make it work for your specific devices is to see what attributes your devices have in the developer tools state tab and then alter the code using your own attributes. So, in your case remove the state-class lines and maybe replace them with another attribute.
@TiborMiska2 жыл бұрын
@@SmartHomeJunkie Thanks for the quick reply, removed the two lines with state_class, but unfortunately it's still not working. Do i have to remove a other line or piece of the template?
@SmartHomeJunkie2 жыл бұрын
@@TiborMiska I wouldn't know. Each install is different. You can debug it using the developer tools. Just copy the sensor code in the template editor in the developer tools and tinker with it to get it working. I find it curious that it does not work at your side because I also use Zigbee2MQTT and my devices do show a state_class.
@TiborMiska2 жыл бұрын
@@SmartHomeJunkie I will thinker with it and will make it work. But indeed strange the i do not see the state_class.
@TiborMiska2 жыл бұрын
@@SmartHomeJunkie Managed to get it working, it seemed that i was running an old version 1.18.1 of z2m, updated to 1.25.1 and state_class is visible and everything is running smoothly. Thanks!
@Avico782 жыл бұрын
Thanks , I want to filter our several sensor (which are not zigbee, i.e Mobile) , how can i do that? lets say all zigbee sensor starts with zigbee, i tried adding | rejectattr('state.name', "search", "zigbee*") in for loop but doesnt work ....
@JeromeRousset2 жыл бұрын
hi, thank's for this tutorial . English is not my native but your explainations are very clear :) some devices report a low battery , but not included in the template , like zigbee tuya TS0601 ( like tze200 radiator valve thermostats ) , i only have a battery_low: false/true how to add them to the template ?
@TheRealAnthony_real Жыл бұрын
it appears (for some reason) I can`t get this running .. if I take the code from IDE where I edit into TEMPLATES under developer tools I`m getting the following error: UndefinedError: 'jinja2.utils.Namespace object' has no attribute 'sensor' ... the code is fine I triple checked it and also the check config went fine, sensor is created however no matter what input value I set in the helper the low_battery_devices sensor returns unavailable ..
@truckerallikatuk2 жыл бұрын
Only issue is, that with the latest update, the entities card for the sensor has changed from the type shown. How do I amend the entity card to work as yours does? A big popup when I click on it showing the history of the setting is.. well.. cluttered.
@SmartHomeJunkie2 жыл бұрын
I'm not sure what you mean. I do not use the entities card in this video. 🤷🏼
@truckerallikatuk2 жыл бұрын
@@SmartHomeJunkie I should rewatch it then, to find the right card for the sensor to have the slider and the typing box. Many thanks for the excellent code, works perfectly.
@gadawgsfan42 жыл бұрын
How could I approach modifying the code to include devices also with an entity name starting with 'sensor.batt_'? The filtering seems to filter by entity attributes only.
@HugoSantos782 жыл бұрын
Oh my god thank you so much for that "unique_id" tip :D I needed that so much.
@SmartHomeJunkie2 жыл бұрын
That's great to hear!
@HugoSantos782 жыл бұрын
@@SmartHomeJunkie I had so many yank mqtt entities that I couldn’t before edit. That just made my day. Really thanks a lot for that.
@BartVanLandschoot2 жыл бұрын
Tip: In Visual Studio Code you can add a unique_id generator by installing the extension "Unique ID (UUID, CUID, NanoID) Generator". When installed, you can simply right-click on the location where you want to insert the unique_id.
@SmartHomeJunkie2 жыл бұрын
@@BartVanLandschoot That is correct. I think it's even by default of you use the addon.
@SVRockChalk11 күн бұрын
If you have no low batteries, do you get "unknown' displayed on your list?
@SmartHomeJunkie11 күн бұрын
No, when you get unknown, either there might be an error in your template code or you might have to change the filter in the template.
@devonhowton Жыл бұрын
I've watched the video several times and am unable to find a "Low Battery Devices" entity when looking for it in the Developer Tools > States > Set State section. I have a pretty new Home Assistant Yellow that I took out of the box less than a week ago with very few changes made to it from factory settings. I've gone through the responses here looking for a solution, but nothing seems to work for me. I'm not sure what I'm doing wrong, as I've gone over the code several times and I believe I've done everything exactly as stated in the video, but with no success. Can you help me please?
@SmartHomeJunkie Жыл бұрын
Maybe rebooting HA helps?
@devonhowton Жыл бұрын
@@SmartHomeJunkie I restarted HA and now it's throwing this error. Invalid config for [template]: invalid template (TemplateSyntaxError: expected token 'end of statement block', got '{') for dictionary value @ data['sensor'][0]['state']. Got '{% set threshold = states(\'input_number.low_battery_threshold\') | int %} {%- set ns = namespace(sensors=[]) -%} {%- for state in states.sensor | selectattr(\'attributes.device_class\', \'defined\') | selectattr{\'attributes.state_class\', \'defined\') | selectattr{\'attributes.device_class\', \'==\', \'battery\') | selectattr(\'attributes.state_class\', \'==\', \'measurement\') | selectattr(\'state\', \'is_number\') -%} {%- if state.state | int
@devonhowton Жыл бұрын
I figured it out. I had a { instead of a ( on lines 13 and 14. Thank you so much for your videos. They are extremely useful and I'm grateful for your efforts. Can't wait for the next one.
@SmartHomeJunkie Жыл бұрын
@@devonhowton That's great to hear!
@0tuttonr Жыл бұрын
Do you know how to remove Battery status for phones which is appearing under the "Low Battery Devices" entity please?
@SmartHomeJunkie Жыл бұрын
Hi. You can exclude them in the filter of the template based on an attribute that only your phones have.
@0tuttonr Жыл бұрын
@@SmartHomeJunkie Do you filter them in the Conditional Card/Markdown card config or the template.yaml? These are the states that return under 'Bobby Phone Battery Level'. I'm guessing friendly name is the only unique identifier? state_class: measurement unit_of_measurement: '%' device_class: battery icon: mdi:battery-50 friendly_name: Bobby Phone Battery Level
@SmartHomeJunkie Жыл бұрын
@@0tuttonr You filter then in the templates.yaml.
@aaronwoldeit56722 жыл бұрын
First, thank you! I really appreciate the content you put out there. I'm using your more generic SDR version and it has been great! I would really like to be able to integrate a second/third SDR into the mix so I can pick up devices at multiple frequencies without having to time share the SDR. I cloned your repo to test changing the -d (SDR usb index) and can confirm that, after writing a new serial number to rtl_eeprom, I do not get error -6(?) where the integration cannot claim the interface. Seems like I CAN use more than one, but I don't really want to copy and rename/relink the repo multiple times. Any thoughts on how a hac like me could set up more than one SDR? Any chance your integration could support this? Otherwise, would you be willing to make a tutorial for creating our own HACS add-ons? Thanks again!!
@oliverbywaters88932 жыл бұрын
Im new to HA, done quite a lot with it so far from "out of the box". Recently been looking at templates, but have experienced an issue where HA thinks the Template Integration is not installed. i dont see a way to install it in the integrations shop, any thoughts? have done some googling and looks like last year an update messed up templates for everyone for a while, has anyone has experienced this? and any helpful fixes?
@SmartHomeJunkie2 жыл бұрын
I have no idea. It might be that you have an error in your configuration.yaml that messes things up.
@mikemitchelle17232 жыл бұрын
Any idea why Low Battery Devices would have a state of unavailable when I have the threshold set to anything: 10, 50, 99 anything?
@SmartHomeJunkie2 жыл бұрын
Check the attributes of your battery entities. It might be that they are different in your case. If so, adapt the code so that your devices will be included. .
@fredjaspers4364 Жыл бұрын
Ik heb de template code aangeschaft en alle stappen doorlopen maar helaas werkt het niet. Wanneer ik bij Entiteiten kijk en Low Battery Devices op zoek, dan staat er rechts een rode waarschuwingsteken dat de entiteit niet beschikbaar is. Heb een unieke id code gegenereerd en in de template code geplakt. Template entity opnieuw opgestart. Groene vink. @Ed, enig idee wat er aan de hand is?
@SmartHomeJunkie Жыл бұрын
Heb je naar de templates.yaml file verwezen in je configuration.yaml en HA daarna opnieuw opgestart?
@fredjaspers4364 Жыл бұрын
@@SmartHomeJunkie Ja, ik had de template regel toegevoegd aan de configuration.yaml file. Wanneer ik deze na herstart weer open staat deze regel er nog steeds in. De enttity status blijft "'niet beschikbaar'' .
@degullegans10132 жыл бұрын
Hoi Ed, bedankt voor je kanaal. Helder en duidelijke uitleg van de diverse zaken. Ik ben redelijk nieuw in Home Assistant en probeer dit werkend te krijgen. Als ik ga testen kan ik wel de entity Low battery vinden maar deze geeft alleen maar unavailible aan. Ook al verhoog ik de helper naar een waarde waar in ieder geval 1 batterij onder zit. Enig idee waar ik dit in moet zoeken? Groet, Mitch
@SmartHomeJunkie2 жыл бұрын
Hi Mitch, Waarschijnlijk klopt het filter in de template sensor niet voor jouw device entities. Die zal je moeten aanpassen zodat hij de juiste entities filtert.
@ML-cr7ds Жыл бұрын
I'm having the same problem, only I have verified that I do have matching sensors
@camgoudreau2214Ай бұрын
I bought the code, but wasn't able to get this to work. Nothing shows up. Have there been updates since this video was released?
@SmartHomeJunkieАй бұрын
No, this should still work. Did you check the sensors and attributes of your devices? It might be that you need a different attribute in your case.
@camgoudreau2214Ай бұрын
@@SmartHomeJunkie Thanks for getting back to me. For some reason, I couldn't paste the code from your file to my iPhone, so I ended up just re-typing it. I will take another look, and confirm all my spacing and attribute names when I get home
@camgoudreau2214Ай бұрын
I've taken another look and I can't find anything obviously wrong. I was getting an error that there was a problem in the templates.yaml file, but that seems to be resolved. All of my batteries are at 100% right now, but it looks like you are checking for
@LigaDommerАй бұрын
Nice - but i simplly cannot make the code fly ... already sensor: in the first line corrupt the yaml ... /g
@SmartHomeJunkieАй бұрын
Yaml is very picky on indentation. Make sure you do it exactly as I show in the video.
@marcoisabella17242 жыл бұрын
Hello, thanks for this guide. How do I add a WhatsApp notification?
@SmartHomeJunkie2 жыл бұрын
See this: Send PERSONAL WHATSAPP Messages in HOME ASSISTANT Now kzbin.info/www/bejne/maO2aGV3pryWhdk
@marcoisabella17242 жыл бұрын
@@SmartHomeJunkie I have done that but I am not sure how to apply to the low-battery sensor. Since I’d like to have the names of the devices with low batteries in the body of the message.
@SmartHomeJunkie2 жыл бұрын
@@marcoisabella1724 You can do that using template code in the action of the message.
@210Bubbagump2 жыл бұрын
It seems this does not work for any battery that does not have a value. For instance I have a device that has gone completely AWOL and the battery value is unknown. This then makes the conditional card not display for even the devices that ARE indeed below the threshold. Did I miss something or is this a limitation of the template logic?
@SmartHomeJunkie2 жыл бұрын
The template excludes batteries that have a non number state. You can easily include this in the template yourself if you like.
@210Bubbagump2 жыл бұрын
@@SmartHomeJunkie Then I must have missed a step. Very cool. Thank you!
@SmartHomeJunkie2 жыл бұрын
@@210Bubbagump I don't think you've missed a step. I guess your battery sensors have different attributes than mine.
@Wimpieseigen2 жыл бұрын
Top. Bedankt.
@paul-tiberiumiclea14292 жыл бұрын
I try to implemet the template and I got following error: Logger: homeassistant.config Source: config.py:916 First occurred: 7:39:12 PM (8 occurrences) Last logged: 7:50:03 PM Invalid config for [template]: required key not provided @ data['sensor'][0]['state']. Got None. (See /config/templates.yaml, line 0). Invalid config for [template]: [template] is an invalid option for [template]. Check: template->template. (See /config/templates.yaml, line 1). where can be the error?
@SmartHomeJunkie2 жыл бұрын
My best guess is that there is an issue with the indentation of the code.
@paul-tiberiumiclea14292 жыл бұрын
@@SmartHomeJunkie Thanks, was not identation but a } insted of ).😏
@Lordsheva802 жыл бұрын
I did the same but easy with entity filter card.
@SmartHomeJunkie2 жыл бұрын
Yeah sure, that can be done too! But... Did you learn anything about templates and custom sensors in the process? 😉
@SmartHomeJunkie2 жыл бұрын
Oh and you can use this sensor in automations too. For instance to trigger a notification to your phone. 👍🏻
@Lordsheva802 жыл бұрын
@@SmartHomeJunkie well, I did an automation that looks at the state of entity and send a notification of less than x%.
@SmartHomeJunkie2 жыл бұрын
@@Lordsheva80 Do you mean one automation for one entity, or one automation that uses a sensor that checks all the entities?
@limestar97512 жыл бұрын
Gone through this a few times, and its not generating a "Low Battery Devices" sensor.
@brianh.41852 жыл бұрын
I also am having this issue. Your template code on github does not start with - sensor: as you indicate in the video that it must, however I have both included and excluded this line from templates.yaml and it makes no difference; I do not see a "Low Battery Devices" entity via developer tools. Any idea what is wrong?
@SmartHomeJunkie2 жыл бұрын
Did you restart Home Assistant after adding the templates.yaml redirection line in the configuration.yaml?
@brianh.41852 жыл бұрын
@@SmartHomeJunkie Yes, and the Template Entities item appeared on the Yaml Configuration Reloading list where it did not previously exist.
@SmartHomeJunkie2 жыл бұрын
@@brianh.4185 Ah okay. Well it's hard to say why is not working at your side. Other people don't seem to have issues with it. Maybe the log files might give you a clue? Or, but this is a blind guess, you might have set HA to a different language and the entity name might be different because of that? 🤷🏼
@limestar97512 жыл бұрын
@@SmartHomeJunkie yeh
@TalZac2 жыл бұрын
I get this error: extra keys not allowed @ data['template'], can you help me ?
@SmartHomeJunkie2 жыл бұрын
Yes, I think so. Please make sure that you do not have other template sensors in your configuration.yaml or sensors.yaml. Storing template sensors in your templates.yaml only is the modern way of doing this.
@TalZac2 жыл бұрын
@@SmartHomeJunkie I removed my sensors from the config file but still getting the error.?
@SmartHomeJunkie2 жыл бұрын
@@TalZac Did you restart Home Assistant after that? Do you also have a sensors.yaml file maybe that contains sensor templates? If not, I'm not sure what might be wrong in your setup. I think it should be something with having sensor templates defined in multiple files.
@TalZac2 жыл бұрын
@@SmartHomeJunkie thanks for trying to help me but I think youtube comments is going to be hard to repair this, I need to talk to you on facebook to fix this problem...
@SmartHomeJunkie2 жыл бұрын
@@TalZac You can try my Discord server. I am afk atm, but will see when I can respond.
@MrSupersidewinder2 жыл бұрын
Very helpful... THANKS!!!
@SmartHomeJunkie2 жыл бұрын
You're welcome MrSupersidewinder (love the username). Glad it helps!!!
@AcidNightx2 жыл бұрын
{% - ... - %} => what are the "-" for? there is no documentation on this one
@SmartHomeJunkie2 жыл бұрын
Is to keep "the code together". If you check it in the developer tools, you will see that if you do not use the dashes, each code line will take up space in the generated output. I don't think it really makes a difference in templates though.
@AcidNightx2 жыл бұрын
@@SmartHomeJunkie ok ty ^^
@RickFarris2 жыл бұрын
What is an "Afvalwijzer"?
@SmartHomeJunkie2 жыл бұрын
Haha, that's a Dutch service that warns when what trash is being picked up.
@rsdev2732 жыл бұрын
@@SmartHomeJunkie Would love a tutorial on that. I find it really hard to integrate that into my dashboard.
@SmartHomeJunkie2 жыл бұрын
@@rsdev273 There's actually already a tutorial about that on my Github page. I won't create a video about it because it's only working for Dutch people.
@RickFarris2 жыл бұрын
@@SmartHomeJunkie What part of the Netherlands do you hail :) from?
@SmartHomeJunkie2 жыл бұрын
@@RickFarris The Southern part.
@franzkaestner2 жыл бұрын
No problem
@nghtrdr2 жыл бұрын
Your videos are so helpful to me as a Newby who is learning. My only complaint is that your voice in all your vids is way too low. Increasing your voice volume would be a tremendous help.
@SmartHomeJunkie2 жыл бұрын
Hmmm, I tested my voice on various devices and it sounds okay at my end. I might try to increase the volume next time, but I'm afraid it will start clipping.
@nghtrdr2 жыл бұрын
@@SmartHomeJunkie If you can it would be great but know I will still watch them either way.
@SmartHomeJunkie2 жыл бұрын
@@nghtrdr I just posted a poll to see what other people experience. Thank you for your feedback. It's really valuable. 🙏🏻
@franzkaestner2 жыл бұрын
the git hub link is dead
@SmartHomeJunkie2 жыл бұрын
Oh noooooooo..... Fixed it ;)
@JoseBerruezo2 жыл бұрын
Great video, but I would like to see a video that tells me how long the battery lasted.
@SmartHomeJunkie2 жыл бұрын
Thanks. I think with the info in this video you can build this yourself. You'll need a helper for each battery to store the date and time when the battery was installed / charged to 100% probably, but it shouldn't be that hard to create.
@Shellyfi2 жыл бұрын
Biggest problem is to know when new battery was installed or device have taken originally in use. You need to define install /recharge for device
@SmartHomeJunkie2 жыл бұрын
@@Shellyfi Yes. I believe you can store that in a helper.
@gambler3k2 жыл бұрын
Pro tip, dont use this with the RFXTRX integration, i have over 200 of my Neighbours devices for some reason and they all need to change their batterys 😆
@SmartHomeJunkie2 жыл бұрын
😂😂😂
@thbe512 жыл бұрын
👍👍👍👍
@JimBell202 жыл бұрын
Just a thought. The transition sound effect that you are using kind of gets irritating after a while. I would suggest that you keep the transition, but don't use the sound. Again, just a thought.😃