Rotary Two side communication

Hi Community,

I need help for my project, I made a switch which controls the brightness of the esphome builtin led using rotary, it is all okay until I change the brightness using analog on rotary, but when I use the mobile application to change it just directly jump to the value I left using analog on rotary, so basically I want a two-side communication i.e mobile application of home assistant should change the value from the same as I left from analog.

Thanks!