I have a boiler, which I am using to heat the house. Every heating has its own thermostat and is running on its own schedule and is opening the valve when it needs hot water.
For this I am using the following code (full example here):
Unfortunately Homematic does not report a state for one or two devices and they get unavailable as value and do not have the attribute Valve anymore, which leads to a broken automation and a veery cold house
Therefore I switched over to a template sensor, with which I can use default values:
I use jinja filters to list all wattage sensors, and then, most importantly, I kick the current sensor out from the result (if not you get endless recursion), and then i pick the attributes and finally sum them.
I would assume you could do something similar for a group … :
Thank you all so much for your help!
Too bad groups do not support the “entities” tag, it would definitely have solved this issue a lot easier, but actually the “rejectattr” was what I was missing out on.
My solution now is just a modified version: