Tracking Heating Stats with Shelly BLU TRV: A Step-by-Step Guide

As a homeowner looking to optimize my heating system, I’ve been using Sonoff TRVs for a while now and have been successfully tracking their heating stats with this simple yet effective code:

yaml
platform: history_stats
name: “Hall Heating Today”
entity_id: sensor.element_hall_hvac_activity
state: “heating”
type: time
start: “{{ now().replace(hour=0, minute=0, second=0) }}”
end: “{{ now() }}”

This setup allows me to monitor how long my heating system is active each day, helping me understand and potentially reduce my energy consumption. However, when I recently added two Shelly BLU TRVs to my system, I noticed a challenge: unlike the Sonoff TRVs, the Shelly units don’t have a direct “heating” state. Instead, they provide valve position data ranging from 0% to 100%.

At first, I was a bit puzzled about how to adapt my existing code to work with this new data format. After some research and experimentation, I found a solution that works perfectly. Here’s how I adjusted the code to track when the valve is open (indicating heating activity):

yaml
platform: history_stats
name: “Shelly TRV Heating Today”
entity_id: sensor.shelly_blu_trv_valve_position
state: “1-100”
type: time
start: “{{ now().replace(hour=0, minute=0, second=0) }}”
end: “{{ now() }}”

This modification allows me to track any time the valve is open, which effectively indicates when the heating is active. It’s a simple yet effective workaround that keeps my energy monitoring consistent across all my heating devices.

If you’re looking to optimize your heating system or just want to keep better track of your energy usage, I highly recommend exploring the history_stats platform. It’s a powerful tool that can provide valuable insights into how your home operates. Plus, with a little creativity, you can adapt it to work with almost any device in your system!

Let me know if you have any questions or if you’ve found other innovative ways to track your heating stats. Happy automating!