How can assign a value to a device subattribute

Hi,

Sorry for the probably dumb question, I have looked but didn’t find the solution,
how can assign a value to a device subattribute.
Case is below I want to assign a temperature target to my boiler heater (subattribute name being temperature) , I can read the value without problem like that

“{{ state_attr(‘water_heater.smart_boiler_1d47’, ‘temperature’) |int(0)}}”

what would be the syntax to assign a value ?

Many thanks

It would be:

actions:
  - action: water_heater.set_temperature
    target:
      entity_id: water_heater.smart_boiler_1d47
    data:
      temperature: 42 # put the value you want here

See: https://www.home-assistant.io/integrations/water_heater/#actions

I think you should start by reading the docs Water heater - Home Assistant and then use the water_heater.set_temperature action.