How to add customer attributes to a light type entity created through EspHome Device?

I have a light entity created by an EspHome device. I have a timer helper which starts on execution on a particular automation. This automation turns on the light, triggers a timer and waits for time out to turns off the light.

Now I want to add a number attribute to the light entity to display realtime timeout (in the bar of a bubble card) before the light automatically turns off.

For this I think I’ll need to add an attribute to this entity which can be displayed in slider of bubble card. (sometime like controlling the light intensity/power of hue lights).

Any ideas how can we make this happen?

I don’t think it’s possible to add attributes, however, you can create another sensor with that attribute state as sensor state and use this sensor in HA to achieve what you want.