AC 230V Voltage Line Detection with sharp PC814 Switch Home Automation
50Hz input gives 100Hz positive pulses at zero crossings.  ( power on = logic “0” out)

With 22k pullup the collector voltage needs to be below 1/3Vdd for marginal “0”. Since RC=T is 63% towards Vdd the Cap load on collector needs to be 2T min. to cut slew rate voltage rise &lt; Vdd/3 or 2RC=10ms or C>=0.47uF.  

Making C too big may delay the detection of power due to current limiting and cap pull down rate from input Current Transfer Ratio (CTR).  You could use C>=0.047 and Rc=220k

A  power switch rated for >2A cannot be used for &lt;10% of rated current  due oxidation of contacts so if you are planning to do this, use a gold plated switch rate for >=2A.