I have a Bosch dishwasher, which reports energy usage ....but only as a percentage (i.e: Energy: 61% - see second screenshot). My best guess (in conjunction with ChatGPT) is that this percentage is a percentage of some arbitrary theoretical maximum energy consumption for that cycle.
That said, that's just a guess because the BSH API documentation isn't terribly helpful. With the help of ChatGPT, I ended up with this sensor to approximate the energy usage of my dishwasher so that I could start tracking it in the energy dashboard. However, I think something is a little off because I somehow end up with my dishwasher using more energy than the total energy usage in that given period (see first screenshot) and a report that my dishwasher is apparently using 4kWh of energy...which seems....off.
{% set base_energy = 1.2 %}
{% set forecast = states('sensor.dishwasher_common_option_energyforecast') | float(100) %}
{% if forecast > 0 %}
{{ (base_energy * (100 / forecast)) | round(2) }}
{% else %}
"Unknown"
{% endif %}
What am I doing wrong here?