Mastering temperature trends: Elevating your Home Assistant dashboard with sensor insights

Mastering temperature trends: Elevating your Home Assistant dashboard with sensor insights

Welcome to another exciting tutorial of my?Tips & Tricks?newsletter on?Home Assistant.

As a home automation enthusiast, I'm always on the lookout for new ways to make my life easier as well as smarter and I'm happy to share my latest ideas with you.

So, if you're ready to take your home automation game to the next level, read on and don't forget to let me know your thoughts in the comments.

Your feedback will help me ensure that I'm providing the right content for you.

Thanks for being a valued reader! ??

Yesterday during lunch break, I was playing with the temperature trend sensors in Home Assistant and tried to have their graphical representation directly on the Home Assistant dashboard, in order to quickly assess the temperature trends.

In today's article, I will delve into how to accomplish this.

Hardware configuration

Software configuration

Procedure

The first step is to configure the binary_sensor trend sensor based on the Aqara temperature and humidity sensor for which you want to get the trend.

Below the yaml code you have to write in order to have two trend sensors to indicate whether the temperature is rising or falling at a rate of at least 0,5 degrees an hour:

- platform: trend
? ? sensors:
? ? ? trend_temp_studio_aumento:
? ? ? ? entity_id: sensor.lumi_lumi_weather_temperature_2
? ? ? ? sample_duration: 10800
? ? ? ? max_samples: 120
? ? ? ? min_gradient: 0.0001
? ? ? ? device_class: heat

- platform: trend
? ? sensors:
? ? ? trend_temp_studio_diminuzione:
? ? ? ? entity_id: sensor.lumi_lumi_weather_temperature_2
? ? ? ? sample_duration: 10800
? ? ? ? max_samples: 120
? ? ? ? min_gradient: -0.0001
? ? ? ? device_class: cold        

To get specific details about how it works, please refer to this article.

Having the trend sensors correctly configured, the next step is to show their states on the Home Assistant's dashboard.

This is the yaml code to be used:

type: custom:mushroom-chips-card
chips:
? - type: entity
? ? entity: sensor.lumi_lumi_weather_temperature_2
? - type: template
? ? entity: binary_sensor.trend_temp_studio_aumento
? ? icon: >-
? ? ? {{ "mdi:arrow-top-right" if
? ? ? states("binary_sensor.trend_temp_studio_aumento") == "on" }}

? ? ? {{ "mdi:arrow-bottom-right" if
? ? ? states("binary_sensor.trend_temp_studio_diminuzione") == "on" }}

? ? ? {{ "mdi:arrow-right" if states("binary_sensor.trend_temp_studio_aumento")
? ? ? == "off" and states("binary_sensor.trend_temp_studio_diminuzione") ==
? ? ? "off" }}
? ? icon_color: >
? ? ? {{ "red" if states("binary_sensor.trend_temp_studio_aumento") == "on" }}

? ? ? {{ "blue" if states("binary_sensor.trend_temp_studio_diminuzione") == "on"
? ? ? }}

? ? ? {{ "green" if states("binary_sensor.trend_temp_studio_diminuzione") ==
? ? ? "off" and states("binary_sensor.trend_temp_studio_aumento") == "off"}}
? ? double_tap_action:
? ? ? action: none
? ? tap_action:
? ? ? action: none
? ? hold_action:
? ? ? action: none        

This is the final result, of course based on the current state of the trend sensors above:

No alt text provided for this image
No alt text provided for this image

I do hope this new article has been helpful, I encourage you to?subscribe?to my newsletter about?Home Assistant?so that you will be the first to know about my new tutorials!

Thanks for reading and stay powered up!

Manuel Clemente Rodríguez

Ayudando a entender e implantar la tecnología en este mundo de locos.

1 年

I Need to have time for investígate this!!! Sounds great!

要查看或添加评论,请登录

社区洞察

其他会员也浏览了