Help with blueprint: How to create history stats based on switch and sensors combined?

So I have 3 SONOFF ZBMINI switches that control the valves on my floor heating and 5 Tuya TRVs on my radiators on the second floor which expose valve binary sensors:

 - switch.0x00124b0026b6c801
 - switch.0x00124b0026b8027e
 - switch.0x00124b0024cb46f4
 - binary_sensor.0x003c84fffef2cf55_valve_state
 - binary_sensor.0x0023fdsf33d224_valve_state
 - binary_sensor.0x003rw22ss2232_valve_state
 - binary_sensor.0x003s22c2233dd_valve_state
 - binary_sensor.0x0032123ss3333_valve_state

I wish to create history stats that can visualize when any of the heating components was on - i.e. “if any of the switch is ON or any of the binary_sensors is ON” I wish to visualize that in a graphic using history stats.

How do I achieve that?

No need for a blueprint.
Use the good Old style groups.

Sorry, could you please elaborate?
I don’t think I can put binary_sensors and switches inside the same old-style group, can I?

Or do you suggest to create 2 separate groups - one for switches and another for the binary sensors?
If I do that - how do I consume them in a history stats later?

Did you read the link i’ve posted?
Yes, you can.

group:
  mixed_group:
    entities:
      - binary_sensor.test_binary
      - switch.test_switch

20230310_160050

type: history-graph
entities:
  - entity: group.mixed_group
  - entity: binary_sensor.test_binary
  - entity: switch.test_switch
title: Old style group with mixed entities
hours_to_show: 0.1

Thank you so much!
I’m not sure why it didn’t work the first time I tried to put binary_sensor and switch in the same group - the entity didn’t show under the Entities view at all.
I might have misconfigured something initially… but now it works as expected!

1 Like