Added a past device state memory to better detect when a devices state is changed