Trigger input with varying input voltages
That looks dodgy. You haven't linked to a datasheet but the fact that you mention 1.2 to 1.4 V looks like you are referring to the \$ V_f \$ of the opto-coupler LED. If you vary the input voltage by a factor of three your opto-coupler LED current will vary by close to the same amount. 

Your ESP trigger will depend on the output of the opto-isolator and the pull-up resistor. You want this to switch very cleanly so you should be switching the LED on hard rather than just on the edge of working at 5 V.

You could consider a constant current driver for the opto-LED.



Figure 1. This switched constant-current driver provides a constant-current to the LED over a range of supply voltages and independent of the LED’s forward voltage. Source: Simple constant-current driver.

In your case you can connect IN and Vbb together. L1 represents the LED in the opto-coupler. For 10 mA R2 should be about \$ R = \frac {V}{I} = \frac {0.6}{0.01} = 60 \ \Omega \$. Pick the nearest standard value. See my linked article for more.