I just noticed you have labelled all the ESP pins as INPUT - they should be outputs to switch the transistors.
There are chips which will behave like a resistor (google digital potentiometer). MCP4151 springs to mind. However these may be too high a resistance.
Mike.
Edit, I would move the resistors into the collector of the transistors and increment them (10,20,30 etc.) and ground the emitters.
Edit2. You could possibly use binary values of resistors (5,10,20,40 etc.) and put a binary value on the ESP pins.