In this tutorial video, I'll show you how to create a bar graph to track occupancy in a specific room or to monitor the daily usage of a device. In addition, I teach you how to make custom sensors yourself! Let me know in the comments what you think!
@rickatgoogle Жыл бұрын
I've been using Home Assistant since 2020, How am I just discovering you? So glad I'm subscribed now! I'm not great with code but your instructions made me feel like I was a pro.
@SmartHomeJunkie Жыл бұрын
I'm so grateful that you found my channel and subscribed! It means a lot to me. I'll continue to provide clear instructions to help you navigate Home Assistant without any coding stress.
@MitchRSA9 ай бұрын
I discovered HA in August last year. Share the sentiment!
@SmartHomeJunkie9 ай бұрын
@@MitchRSA That's great to hear. I'm glad my videos helped you!
@EsotericArctos Жыл бұрын
Just as a note, some installs will not run Studio Code Server. File Editor is a more basic add-on, but it will allow you to edit the YAML files as well and will show you basic YAML errors. To be honest, I rarely edit YAML these days, so I keep File Editor instread of Studio Code. This is a fantastic video for people who are not sure how to start with graphing and reporting. Home Assistant has so much data stored, sometimes it can be hard to know where to start to pull the correct data up. Thanks for showing us and making it look so easy :)
@SmartHomeJunkie Жыл бұрын
Thanks Brendan.
@EsotericArctos Жыл бұрын
@@SmartHomeJunkie You are one of my favourite youtubers, because you explain the more useful stuff in ways that are so easy to understand and implement for people watching. I am a bit geeky so don't mind the complex stuff in somethings, but for my home automation I really just want that to work with minmal fuss, and your videos allow that
@SmartHomeJunkie Жыл бұрын
@@EsotericArctos Thank you Brendan
@josm9090 Жыл бұрын
Thanks, usefull as always.
@SmartHomeJunkie Жыл бұрын
Thank you so much for your support 🙏🏻
@PatrickLangendoen Жыл бұрын
Awesome! I see a nice usecase for this to track the daily amount of hours I spent on my phone (using the home assistant companion app).
@SmartHomeJunkie Жыл бұрын
That's indeed a nice use case as well!
@MildredSeinca Жыл бұрын
Excelente Tutorial, funciona a la perfección. Para que no les pase lo que me paso a mi tienen que usar la entity creada en el historic stats y no la de equipo que quieren monitorear. Dure media hora rompiéndome la cabeza de que porque no me funcionaba.
@SmartHomeJunkie Жыл бұрын
Hmmm, that's new for me. 🤔
@MrStarfox76 Жыл бұрын
Dank je, mijn natuurkunde leraar zei altijd. "Meten is weten" 😊
@SmartHomeJunkie Жыл бұрын
Yup, de mijne ook!
@paulwouters4445 Жыл бұрын
Well done, works perfectly. I would like to extend the usage of the graph to monitor the time my fridge is actually cooling, but the sensor which is available is a power sensor (non zero value = fridge on). What should I need to modify in the apex chart to get is working, as if it was an on/off state ?
@SmartHomeJunkie Жыл бұрын
You can create a template sensor that converts the state to on or off and use that 't template sensor in the graph.
@kobedde Жыл бұрын
Hi Ed, this one is to keep in my library . Great tutorial!👍
@SmartHomeJunkie Жыл бұрын
Thank you
@BeardedTinker Жыл бұрын
Great video Ed! I've been using something similar - how much time kids watch TV, how long the heating was on and for example how much solar panels were working in a day. It really is fun when you get those statistics. One thing I still haven't done is home many times somebody walked in kitchen :D
@SmartHomeJunkie Жыл бұрын
Yeah, it's great fun! I guess I will create many more of these in the next couple of weeks 😂
@waynenocton Жыл бұрын
I honestly thought I was already subscribed, but I am now.
@SmartHomeJunkie Жыл бұрын
Thank you! 🙏🏻🙏🏻🙏🏻
@rincovanderbeek4725 Жыл бұрын
Nice and clear explanation, thanks!
@theimpulse77 Жыл бұрын
Holy cow this is exactly what I was looking for! I've never messed with the coding side of HA before so I was nervous. You made it super easy and clear. Thanks so much! The only question I have is on your lines 18 & 19, what is tickAmount?
@theimpulse77 Жыл бұрын
Oh and one more question! Is there a way to export this information, say weekly, to a document or device? I'm trying to help my wife keep track of her work hours without writing things down on post-its. lol
@SmartHomeJunkie Жыл бұрын
You can write then to a Google sheet. See my Google sheet video for this.
@theimpulse77 Жыл бұрын
@@SmartHomeJunkie I was working my way through that one now! Sorry I asked before I searched. lol
@sevagjb Жыл бұрын
Thanks Ed, Very nice Sensors 👌
@SmartHomeJunkie Жыл бұрын
Thanks Sevag!
@sevagjb Жыл бұрын
@@SmartHomeJunkieWorks like a charm, is it possible to add unique_id to this sensor?
@SmartHomeJunkie Жыл бұрын
@@sevagjb I think you can yeah. Didn't try it.
@sevagjb Жыл бұрын
@@SmartHomeJunkieI tried to add it but it didn't work I got an error in the config file, Thanks any way it is awesome SENSOR 💯
@SmartHomeJunkie Жыл бұрын
@@sevagjb Yeah. I think I will add more of them in my setup the next couple of weeks. So many ideas pop up in my head right now.
@ictstelucjam3604 Жыл бұрын
Great video Ed, with your examples I will take a look how much time I spend behind the PC. I think it will be a boring graph. 😅
@SmartHomeJunkie Жыл бұрын
Hahaha!
@manfredzimmer1199 Жыл бұрын
Great Video again 👍👍👍
@SmartHomeJunkie Жыл бұрын
Thank you Manfred!
@EddieSpaghettiYouTube Жыл бұрын
I have a sonof powr3 device which is always on so cant use that for time tracking. Id like to track the time for when there is load over 1W for instance. How would i specify that as a state. I tried stat ">1" but doent work
@SamanthaMiller-t4h6 ай бұрын
I have set this up to show daily energy usage by device. However the data is appearing cumulatively, rather than resetting at zero each day. Is that a problem with the sensor, or the style of apex graph? Is it also able to be set to show an hourly breakdown of a 24hr period?
@sbuciuni Жыл бұрын
hey, how many time before sensor will be available (after reboot)?
@LiorAssouline Жыл бұрын
Thanks! that was very helpfull!
@SmartHomeJunkie Жыл бұрын
I'm glad it helped!
@PeterCarlsson-k7n Жыл бұрын
Hi Ed, I run HAOS on an Intel NUC 13 Pro Tall I7-1360P with 16GB RAM and an Samsung 870 EVO 1000GB 2.5" SATA-600. I've been told that this is plain stupid overpowered for my Home Assistant use case but with your great videos i might just become an hard core user in the future so i thought what the heck. I like the idea of limiting read/write and DB size by just including the intities you really want and have use for in charts and what not. My problem is that i don understand what every single entity does and if i will miss out on something by not including it. I think the "safest way" for me with my lack of HA skills is to just leave everything be. Just to give you an idea of just how low my use case are i have 19 Z-Wave products controlled by an Aeotec Z-Stick gen 7 USB-adapter, 8 Zigbee products controlled by an SONOFF Zigbee USB Dongle Plus, 4 Frigate cameras and i have 635,6 GiB free space on my HD and my MariaDB is 216,1 MB and most of that is recordings from my Dahua Technology WizSense 5MP IP67 Dome Cameras. Anyway, now to my question. Do you think i will run into problem with read/write issues on my Samsung 870 EVO 1000GB 2.5" SATA-600? Have a nice day
@SmartHomeJunkie Жыл бұрын
That shouldn't be a problem.
@ChrisBkgaardJensen Жыл бұрын
Great video! Do you know if it's possible to get a weekly, monthly or even yearly usage?
@SmartHomeJunkie Жыл бұрын
Interesting question! You can try to experiment with the duration within the graph. I didn't test it myself though.
@alexandrubogdan2444 Жыл бұрын
Hi! I try with input_text.washer_state and at status i put "washing" and dosen t work...
@davidwalker575 Жыл бұрын
Great video thank you. How often does the custom sensor update? Can you define a custom refresh rate?
@SmartHomeJunkie Жыл бұрын
I believe it changes as soon as the value of the entities within the sensor change.
@PeterCarlsson-k7n Жыл бұрын
Love you videos, buying every code snippet :)
@SmartHomeJunkie Жыл бұрын
Oh! Thank you for your support Peter!
@PeterCarlsson-k7n Жыл бұрын
@@SmartHomeJunkie i like the way you separate stuff in include files like sensors. Is it possible to include all mariaDB and all included entities in one "db" file or must the recorder stuff live in the config file? Sorry. This question should been in the 5 tip about taking load from DB by including only specific entities.
@SmartHomeJunkie Жыл бұрын
@@PeterCarlsson-k7n I think it should be in the configuration.yaml.
@bat3332 Жыл бұрын
Can you make a new video on presence sensor video so that based on my family member in the house the alaram system turns on and when all of the leave the house alarm sustem turn off. I know you have one old video on it. but it would be good to have new one based on all the updates home assitant had over the year before the video was done
@SmartHomeJunkie Жыл бұрын
The alarm system video that I created is already refreshed a couple of months ago and still valid. The menu of Home Assistant changed a bit (and will keep changing), but you should find a way around that. I have no plans for another update in the near future.
@rolandehle Жыл бұрын
Thank you very much for this video. Can this be used to track the maximum and minimum temperature?
@SmartHomeJunkie Жыл бұрын
I would create an automaton for that.
@jefSaze Жыл бұрын
Great! Which presence sensor do you recommend for use with Home assistant?
@SmartHomeJunkie Жыл бұрын
The Aqara FP2 or the Everything Presence One.
@davidhouska8427 Жыл бұрын
Thank you for this tutorial, much appreciated.. One question, how much of history will be stored for a sensor? Is it unlimited?
@SmartHomeJunkie Жыл бұрын
Thanks for the love and appreciation for the tutorial! You rock! Now, about your question, there's a difference between history and long-term history. Long-term history is also saved, but it's in a different location and I'm not sure if the long-term history will be taken into account with this method. As of 2023.12, the long-term statistics are shown on the history graph, so maybe it will be visible with this method too. I didn't check this though.
@davidhouska8427 Жыл бұрын
@@SmartHomeJunkie OK, thank you, I will wait and see… 😀 I have one location sensor generated according to this video from you and 2 standard temperature sensors from Sonoff that I would like to have full history visibility. Reading articles on web, but still not clear where to put the codes I found 🤷🏻♂️
@pensionado7668 Жыл бұрын
Hi Ed, great tutorial again, thanks. Can I ask you a different question? Is it possible to make a dashboard on which only devices/entities can be seen when they are "on"? Love to hear about it.
@SmartHomeJunkie Жыл бұрын
Yep, try the auto-entities card from HACS.
@malzbier13395 ай бұрын
Good Job 👍🏻
@SmartHomeJunkie5 ай бұрын
Thank you for your compliment. 🙏🏻
@ginno068 ай бұрын
super video. there is a way to show a custom stats? (show_states: true) becausem the time showme is "1h 0m 0s 410ms", and i want only hour and minute. tks
@RSayGV28 күн бұрын
I was running into this same issue. I removed the as_duration: hour and I got "1.1h", which wasn't exactly what I wanted but it was better than seeing seconds and milliseconds.
@encostablanca Жыл бұрын
A good one for this would be how many times the fridge has been opened and the Time open
@SmartHomeJunkie Жыл бұрын
Great idea!
@MitchRSA9 ай бұрын
You sir, are awesome.
@SmartHomeJunkie9 ай бұрын
Thank you so much 🙏🏻🙏🏻🙏🏻
@FedeLeggio16 Жыл бұрын
Only a question because i have a problem with the sensor.... the date is, for example 2.72h, anyway i should obtain 2h 43 min... why the sensor give me 2.72h? im using your code... can you help me?
@blightniak Жыл бұрын
I have the same question, how to display it has 2:43 (hh:mm) not 2.72, more readable
@LaurentNittler Жыл бұрын
Nice video. Why is the y-axis not linear (grid at 0, 2, 4, > 5
@SmartHomeJunkie Жыл бұрын
You can set it yourself in the apexchart card.
@keith8676 Жыл бұрын
created a history sensor and got the graph working but seeing weird values I think because the history sensor has not yet captured enough "history", waiting to see if it all works
@SmartHomeJunkie Жыл бұрын
That's probably the reason yeah.
@markheatherington83674 күн бұрын
thanks!
@hammerlized Жыл бұрын
Hi, isn't the sensor the same as the "utility meter" helper? What are the benefits using a extra yaml file instead of the helper?
@SmartHomeJunkie Жыл бұрын
It's not a utility, is it? Try to measure occupancy with the utility meter helper...
@hammerlized Жыл бұрын
@@SmartHomeJunkie well that's true, sorry. Was thinking about energy measurement. Is it possible to use multiple entities in one sensor to get a total usage / amount? Let's say to count several lights (time being on) or energy plugs (power usage)?
@SmartHomeJunkie Жыл бұрын
You can add those to a group and use the group in the sensor. That's what I did with the living room lights.
@hammerlized Жыл бұрын
@@SmartHomeJunkie okay perfect, thanks. And if I do understand that code right, the sensor (counter) is getting reset every day at midnight / 12a.m.?
@SmartHomeJunkie Жыл бұрын
@@hammerlized That is correct!
@Yuseigachi Жыл бұрын
Ed I downloaded the code but I get some error, please help? can not read a block mapping entry; a multiline key may not be an implicit key (15:8) 12 | name: Toilet verlichting Light 13 | entityid: light.lumi_lumi_light_aqcn ... 14 | state: "on" 15 | start: "{{ now().replace(hour=0).rep ... -------------^ 16 | end: "{{ now() }}"
@SmartHomeJunkie Жыл бұрын
No idea really. There must have gone something wrong when you copied and pasted the code.
I'm looking into how to monitor how much time I sit in my computer chair every day
@SmartHomeJunkie Жыл бұрын
Mount a vibration sensor or pressure sensor to your chair.
@AlanTuringWannabe Жыл бұрын
I found an automotive pressure sensor. I used an Aqara ZigBee magnetic sensor. I removed the reed switch and soldered the pressure sensor to it. I got that idea from Mark Watt Tech's 4 Simple Wireless Bed Sensors. It's working great. Now I want to set up an automation to remind me to get up and move when I've been sitting for an hour.
@Sun-Yok7 ай бұрын
Tell me how to display data in telegram? Thank you.