You are overthinking this shifting business. Keep it simple...if it gets too hard, shift. If it gets too easy, shift.
If you have a cadence sensor, the principle is the same. If it gets too hard to spin at, say 90, shift. If it gets too easy at the same cadence, shift.