Proportional valves with onboard electronics