The problem with ACS712 is that it's bi-directional so if you supply 5v to it it will give 2.5V even if no current is flowing. But esp8266 has a maximum ADC range of 1V which means you will always get 1023 as your output.
ACS712 works well with arduino, but I need to get it working with esp
Also ceiling fan uses very less power ,maximum of 400mA, and ACS712 5A module gives 185mV/A, So practically I get less than 0.093 V when the fan is consuming maximum power which becomes very difficult to calculate.
Any other alternative? anything like ACS 712 but gives uni-directional output or anything else
Using transformer will make my board bulky and I don't want that.