'Listen for sate change.
Track device state change if a device has a tracking id specified.'

def device_state_changed_listener(self, entity_id, from_s, to_s):

    self.device_states[entity_id] = str(to_s.state)
