Can I set the state of a sensor from within HA?

Hi all !

I have a stove I am monitoring, and here are the states it reports :

from its remote controller, I can configure the fan modes. But I would rather figure out a way to change its real_power value.

Question: is this feasible ? Or is it a one way communication channel making it impossible to change a sensor state value from within HA ?

An entity has one state value and can have multiple attributes. What is shown in your screenshot are a climate entity’s attributes. A climate entity has several services to control it but none of them are designed to directly change the value of real_power.

Which integration did you use to produce this climate entity for your stove? Sometimes the integration provides additional services.

this is the one, but I could not find anything about a way to change the attribute of this real_power state :wink:

Its a custom integration that provides no additional services beyond the ones available for the climate integration. Therefore, as mentioned, there’s no service call to set the value of real_power.

There is a python_script posted elsewhere in the forum that can be used to change the value of any attribute. However, this change is not communicated to the physical device and is not permanent. If you restart Home Assistant (or the next time the integration refreshes its attributes) the attribute’s value becomes whatever the integration sets it to and not what you had set it to with the python_script.

It sounds a little too hacky to control a device which is “mechanical” per se.
I will avoid breaking things I guess for this time :wink:

thanks for your help @123