Derive on/off state from power consumption?

I am hoping someone has a solution.

I use an Emporia Vue electric use monitor on the main panel at my workshop. There is a subpanel that feeds the swimming pool pump and hot tub.

The HA entity is:

sensor.shop_123_1min

The base electric usage at the shop is 873 watts.

When the lights go on (automated at 6am; off at 11pm), the power usages rises to 3569 watts. When the pool pump goes on, the power usage rises to 5977 watts. When the hot tub goes on, the power usage rises to 8104 watts.

These measures sometimes vary by 2-4%.

And, sometimes, the lights might be turned off, but the pool pump is running.

Or the pool pump might be off but the hot tub is running.

What I would like is an indicator of the status of each device (on or off) as determined by the power usage total at the Vue.

To expand with examples:

  1. 873 watts being used: Conclusion: base items in workshop are on (networking equipment, fridge, etc.); nothing else
  2. 3569: Base + lights (2696 watts)
  3. 5977: Base + lights + pump (2408 watts)
  4. 8104: Base + lights + hot tub (2127 watts)
  5. 3281: Base + pump
  6. 5696: Base + lights + hot tub

(all amounts should be +/- 3%)

This is way over my head.

Thank you!

One method below. I think you’ve made an error in #6, which I’ve attempted to fix:

template:
  - sensor:
      - name: Workshops heuristics
        state: >
          {% set s = states("sensor.shop_123_1min")|float(0) %}
          {% if 847 < s < 899 %}
            base
          {% elif 3462 < s < 3676 %}
            base, lights
          {% elif 5798 < s < 6156 %}
            base, lights, pump
          {% elif 7861 < s < 8347 %}
            base, lights, hot tub
          {% elif 3183 < s < 3379 %}
            base, pump
          {% elif 5525 < s < 5867 %}
            base, pump, hot tub
          {% else %}
            unknown
          {% endif %}
  - binary_sensor:
      - name: Workshop base
        state: "{{ 'base' in states('sensor.workshop_heuristics') }}"
      - name: Workshop lights
        state: "{{ 'lights' in states('sensor.workshop_heuristics') }}"
      - name: Workshop pump
        state: "{{ 'pump' in states('sensor.workshop_heuristics') }}"
      - name: Workshop hot tub
        state: "{{ 'hot tub' in states('sensor.workshop_heuristics') }}"