Тёмный

Smart Home Analytics - Use History Stats in Home Assistant for insights and visualizations. 

mostlychris
Подписаться 34 тыс.
Просмотров 17 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 52   
@RonnyRusten
@RonnyRusten 3 года назад
I think stats are very interesting, so, yes please, do more like this.
@mostlychris
@mostlychris 3 года назад
Thanks for the feedback! I'll do some more on this type of stuff then.
@bill_automated1226
@bill_automated1226 3 года назад
Super helpful video Chris. Thanks! Helps me with defining sensors, and then displaying the data. Keep up the great videos.
@mostlychris
@mostlychris 3 года назад
Thanks! Working on tariff setup now.
@garysteo3398
@garysteo3398 3 года назад
another informative video so yes please keep it coming. Also you touched on bringing Grafana data into lovelace dashboard, any headway on that. I stay away from Grafana because I dont want to manage multiple dashboards or have to flip back and forth between them. Same thing with Node Red it also has a dashboard piece. Anyway great job and thank you
@mostlychris
@mostlychris 3 года назад
I touched on the Grafana thing in one of my livestreams. Adding in a URL card to display the grafana dashboard within Home Assistant. I think some others got that working so that's a possibility. I am working on displaying this same info natively in an HA dashboard so stay tuned (subscribe) for that.
3 года назад
I've been using this approach but issue I find with it is that 1. It consumes unnecessary storage in the database. 2. It doesn't have the data from before you added the template. Theoretically, it should be possible to store only raw sensor data and use Grafana to do all the calculations. This solves both issues because the calculation is never stored but obtained on the fly. Sadly this is quite hard to do and you need to know about Grafana's query language. For example, if you have a on/off (1/0) sensor for the TV, you can calculate how many minutes it was on each day by doing an integral over it. Then sum the integral in intervals of 24h. This requires subqueries in Grafana, but it's something like this: SELECT SUM(timeon) FROM ( SELECT integral("value")/60 AS timeon FROM "state" WHERE ("entity_id" = 'tv_smart_plug') AND $timeFilter GROUP BY time($__interval) fill(null) ) GROUP BY time(24h) Unless Grafana messed up, it should be possible to implement any calculation achievable via templates... at what price though!
@mostlychris
@mostlychris 3 года назад
Interesting. Queries of this type are advanced and can be done. But, like you said, at what cost. I would guess that there is quite a number of people that are not versed in complex queries and using something like history stats makes it available to a wider audience. I have tried to do a lot of things in Grafana and after playing around for awhile, had to choose the easier way(s) because of time constraints, etc.
@jjussi
@jjussi 3 года назад
Have you tested power consumption when the freezer (motor) is not running, but somebody opens the door (light is on)? Your template is firing when consumption goes over zero.
@mostlychris
@mostlychris 3 года назад
I have not, but that is a good point. This was a high level start. I need to look into the edge cases and make sure I account for those.
@tempbmx
@tempbmx 3 года назад
Please make a "time clock" how to, same concept as here with but when i walk into work and turn lights on, it clocks me in. Knowing how long ive worked with each visit, and each day I have figured out. Stacking it into weeks and last month , ive only made it as far as 'this week' and a over engineered amount of automations & inputnumbers and spun myself dizzy.
@mostlychris
@mostlychris 3 года назад
Great suggestion!
@MichaelBennett1
@MichaelBennett1 Год назад
What’s the difference between defining a sensor under binary sensor with a template (as I do) and under platform: template as you have (8:04), just that one will return true/false and the other as on/off? I’m not being pedantic, just wondering what are the benefits of one vs the other.
@JimfromIndy
@JimfromIndy 3 года назад
Your refrigerator's spike is the defrost cycle where it heats up the freezer to evaporate frost.
@mostlychris
@mostlychris 3 года назад
Thanks! Figured that. My fridge sometimes gets a little lost and doesn't defrost correctly (in the freezer section). Ice forms and then the air doesn't get from the freezer to the fridge to provide cooling in the fridge. I have to force a defrost cycle in that case. I have a Xioami thermometer in the fridge transmitting to an ESP32 and I have an automation that will alert me if the temp is too high for x minutes. I then force a manual defrost.
@JimfromIndy
@JimfromIndy 3 года назад
@@mostlychris Do some research on that. I discovered there is a bug in the controller board of one brand of frig (common one, but I can't remember which one...) that causes the problem. It is resolved by a forced reboot of the controller board followed by a strange sequence of toggling the freezer door switch. It actually worked... saved us a service call!
@mostlychris
@mostlychris 3 года назад
@@JimfromIndy Thanks for the tip. I have a Whirlpool and I force the defrost with 3 hands worth of door switch holding and controller button pushing. I'll dig into it more to see if I can find a permanent solution.
@lordnoiado
@lordnoiado 2 года назад
Would you be able to retrieve that data and store it somewhere else in your computer or send it to an API?
@astronomos826
@astronomos826 2 года назад
Many thanks for this "delicious" video! How to calculate time of actual playing RU-vid or Netflix? It has to work when "media_player.living_rm_rock_ultra" state is "playing". It is easy to leave app paused and it should not calculate to the watch time.
@mostlychris
@mostlychris 2 года назад
I think you are asking how to calculate the actual play time, not just when the app is open. Is that correct?
@markcustance2445
@markcustance2445 3 года назад
Great video!
@mostlychris
@mostlychris 3 года назад
Thanks!
@prebenborg
@prebenborg 3 года назад
Statistics on motion sensors would be cool to have. And see stats on busy time in different rooms
@mostlychris
@mostlychris 3 года назад
Thanks for the suggestion!
@TismoGaming
@TismoGaming Год назад
Great videos as always. Appreciate you, Chris! Any chance you could share your Json file for power dashboard highlighted in this video?
@wstrater
@wstrater 3 года назад
Have you tried InfluxDB 2.0? I just built a new system and manually installed InfluxDB 2.0. The Flux query language is very different. They say it is more powerful. It appears to be modeled around streams and you can keep add stream processors.
@mostlychris
@mostlychris 3 года назад
I have not tried that yet. I'll put it on my list.
@wstrater
@wstrater 3 года назад
@@mostlychris The hard part is that most of the Grafana dashboards available for downloading are based on the the older versions. That has forced me to translate any dashboard I want to import. I have learned a lot about Flux but still struggle to do anything but the most simplest query.
@JoseBerruezo
@JoseBerruezo 3 года назад
Nice video, but how to access configuration.yaml in visual code through samba? I cannot install the visual code on my raspberry pi.
@mostlychris
@mostlychris 3 года назад
You can use the file editor add-on. I have never had success with VSC on a pi. I run the stand alone VSC app on my pc and then connect to my files using the samba add-on.
@JoseBerruezo
@JoseBerruezo 3 года назад
@@mostlychris Hi, I also have my VSC on windows, what I want to know is how through samba I can edit my files on my VSC.
@mostlychris
@mostlychris 3 года назад
@@JoseBerruezo You need to install the Samba Add-On in Home Assistant and then mount a drive on Windows. In VSC, you would just open the config folder in the HA mount.
@JoseBerruezo
@JoseBerruezo 3 года назад
@@mostlychris Thank you.
@edwinvanwyk3561
@edwinvanwyk3561 2 года назад
Hello Chris, Do you know if I can check the state of temperature value? I want to show the amount of time a temperature sensor is above a specific value? Thanks
@mostlychris
@mostlychris 2 года назад
You can do this in a number of ways. One example is that you can create an automation that sets timer helper and then extract how long that helper has been above threshold. However, a better alternative might just to be graphing it in grafana and looking at it visually. I suppose the same thing would be shown in the history stats. Since I'm talking in circles now, what is it you want to do with the amount of time above threshold?
@edwinvanwyk3561
@edwinvanwyk3561 2 года назад
@@mostlychris sometimes it’s hard to see what the value was in the history. I want to be able to see how many times or how long it was above a specific value. Originally I was thinking to use a counter to show how many times it was high. But I think showing the amount of time it was high would be better. I’m measure the temperature in my roof to see how hot it gets as I store stuff in the roof. I could not get a counter working so I have been trying to show the max value but having trouble with that as well. Any help would be great! Thanks
@mostlychris
@mostlychris 2 года назад
Take a look at my grafana video that shows how I track how long the A/C and Heat has been running. That might give you a starting point.
@davidlangley833
@davidlangley833 3 года назад
Thank you Chris, simply awesome. My yaml coding certainly isn't great, but I welcome graphs and statistics. I was a bit cautious about approaching 'watching stats'. However after sorting out my silly errors, I can now see how much I have watched on my satellite box, in additionally I will be adding my TV information for RU-vid etc. I would like to see how I can use my smart plugs to calculate my power usage, I have used attributes to see watts, ma, voltage on the plugs, but I do not know how to use the data to view KWh and to correctly use it for Historical data. Thank you again.
@mostlychris
@mostlychris 3 года назад
Hey David. Good job on the watch time! What plugs are you using? Have you seen the new energy portal in 2021.8? I have my S31 and Cloudfree plug listed on that dashboard. Some of my other power monitoring devices don't show, and that is because of the type of data being sent. However, those can be graphed/displayed a different way even if the energy portal doesn't work for them.
@ollivergardenontour
@ollivergardenontour 9 месяцев назад
Love this❤
@RT-er9yl
@RT-er9yl 3 года назад
very good explanation! can i put history stats in lovelace instead of grafana?
@mostlychris
@mostlychris 3 года назад
Yes. It is an entity and you can display it any way you would like. The new stats cards in lovelace might be a good choice.
@pol-henri4823
@pol-henri4823 3 года назад
Amazing! and yes if you can make more videos about stats it can be great !
@mostlychris
@mostlychris 3 года назад
Thanks. Will do.
@ramdisk00
@ramdisk00 3 года назад
Thanks Chris love the video and yes I would like to see how to do more complex stats. That switches are you using on your frig and freezer?
@mostlychris
@mostlychris 3 года назад
Thanks! Yes, I am using the smart plugs on my garage freezer and my kitchen refrigerator.
@ramdisk00
@ramdisk00 3 года назад
@@mostlychris which brand smart plugs
@mostlychris
@mostlychris 3 года назад
@@ramdisk00 I have this plug: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KZslRNw92hg.html and this plug: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9N58uy3ezvA.html
Далее
HIDDEN Home Assistant GEM
16:43
Просмотров 19 тыс.
Build One Script to Rule Them All in home Assistant
11:21
Beautiful data visualisation in Home Assistant
17:05
Просмотров 56 тыс.