Get date time value inside custom component

Hi, I develop a custom component for my smart thermostat. I need to get and set the value of a input datetime sensor inside the custom component code. How can I do??

Thanks

You’ll need to call the input_datetime.set_datetime service with hass.services.call.

Thanks I will try it

Hi try but I don’t understand how can I call services with python custom component. Please can you write me an example?
Thank you

I have never written a custom component, I just found this on the fourms, try Google.

Did you find a way to do it … If so, could you give me an example?

Thank you,

Did nothing come up related in a google?

I have done hours of research and pretty hard to find anything … Your topic is basically what I’m trying to do!

If you know an Home Assistant genuine component that do such thing, I’ll get a look! Or better, if you managed to solve your initial problem, it would be great if you could share your Git / code…

Thx!