Water heater isnt publishing target temperature changes

I’m struggling to get my water heater device to publish target temperature changes to the HA activity log. I’ve tried every example I can find and everything Claude and Gemini suggest but nothing works, not sure if I’m being stupid or there’s some bug or what…
Changing the mode is reflected in the activity log just fine

water_heater:
  - platform: template
    id: water_heater_tank
    name: "Hot Water Tank"
    current_temperature: !lambda 'return id(water_temp).state;'
    optimistic: true
    restore_mode: RESTORE_AND_CALL
    supported_modes:
      - "OFF"
      - GAS
      - ELECTRIC
    visual:
      min_temperature: 30
      max_temperature: 65
      target_temperature_step: 0.5

Changes to the target_temperature are saved, but do not appear in the Activity Log.

Other entities declared on the same device also reflect their changes in the activity log

What am I missing?

Thanks

So how is your water heater device supposed to publish target temps or anything?
Your template doesn’t have target temperature parameter.

In the UI, I adjust the target temp, this is stored correctly, but never published to the activity log

Define “water heater device” and specify what “UI”.

Template components are confusing and activity logs are mainly for state changes.
You don’t have
target_temperature:
or
set_action:
parameters on your config.

Anyway, I have never used this component and likely not able to offer one click solution, but others might if you describe your setup sufficiently.

The Home Assistant UI?

If I change the Mode, its in the Activity Log. If I change the target temperature, it is not.

“Water heater device” = The entity in home assistant, apologies not Device

What should I put in the target_temperature parameter then?

I appreciate not having a set_action renders this device useless at the moment, but that’s irrelevant here. Even if you add a set_action this problem remains.

you can add

set_action:
 - lambda: |-
     ESP_LOGD("water_heater", "I make no difference to the problem, which is why I was omitted");

I’m not familiar with this platform either.

But is target temperature perhaps stored as an attribute on the HA side (rather than a state)?

A bit like this.

… What do you see on your image above if you go to the “details” menu?

Ah, right ok.

Just tested this with a climate entity and they don’t publish activity for target temp changes either, as they are attributes there too.

OK, thanks for helping me understand

I think what I do when I need to access the target temp a lot is to create a dedicated sensor for it.

So like a template sensor that refers to the attribute. On either the ESPHome or HA side.

Yes, to wrap a bow on this topic:

The activity log only tracks entity state changes. It does not track attribute changes. (And it also doesn’t track state changes to sensor entities that have a unit_of_measurement).

If there is an attribute you’d like to show up in the activity log, then create a template sensor so that the attribute becomes the state of that new entity. You can use a template like this for a sensor template helper: {{ state_attr('water_heater.living_room', 'target_temperature') }}

But keep in mind that if you set a unit of measurement for that new template sensor, it won’t show up in the activity log… :slight_smile:

Sounds like solid wrap. Not far from expectations.