How to I set the initial, max/min value for a slider using entities?

Hi All,
I would like to have a slider that will take formulation parameters as below:

min_value: 0.0
max_value: [a value published by an entity]
initial_value: [a value publish by an entity]

I used ChatGPT (I knew it may not be as correct as specified by esphome) and it advised me to use lambda and return id(maxvalue_entity).state …
however, the ChatGPT option did not work.
Can you advise me on how to do this?
Best

It rarely does. Stop wasting your time with it.

Neither the min_value nor max_value can be used with lambdas. All you can specify is a number.

chatgpt lied to you.

You can make an template number, that’s your only option to have initial values set on startup via a slider. Otherwise you can use an automation to set the helper’s value on startup.

Ok, thanks, I will try for now!