some stuff to abstract away binary switches/sensors etc