Adding pv and logic to automatically switch from dark to light