How to use helpers & templates for energy measurement: monitoring the tumbledryer

Dear Community - I’m new in the HA-Univers, thank you for having me.
As I just started with my HA journey, I’m happily included my smart home instances from HomematicIP (CCU3), Philipps Hue and Nuki (Smart locks) to HA.

From HomaticIP, I’m using some smart plugs for energy monitoring / use of none-smart devices like the tumbledryer and washing machine. Now I want to use this for including the operational status of these devics to HA. It’s easy to interprate the operational status from the sensor “power” by ranges:
0 - 2W: device is off
2 - 6W: device is in standby
more than 6W: device in running
coming from >6W to less: device program is completed (done)

Now, I’m struggling to setup this within HA. I was thinking about a helper representing the status (off, standy, on, done) to use this on a dashboard (like switching the icon / icon color) and dropping notifications to the frontend, apps and voice services.

I’m open for any advices and / or best practices.
Thank you very much,
Peter

To infer a device’s operating state from its power consumption, the common method is to use a Trigger-based Template Sensor.

Here’s a simple example of converting power consumption into one of 5 operating speeds (0, 25, 50, 74,100). It’s part of a recent project to automate a range hood.

template:
  - trigger:
      - platform: state
        entity_id: sensor.range_hood_energy_power
    sensor:
      - name: Range Hood Fan Speed
        unique_id: range_hood_fan_speed
        state: >
          {% set p = trigger.to_state.state | int(0) %}
          {{  { p < 125: 0,
                125 <= p < 160: 25,
                160 <= p < 185: 50,
                185 <= p < 225: 75,
                p > 225: 100 
              }.get(true, 0) }}

A more complex example can be found here: