diff --git a/examples/motion_detector_home_assistant.py b/examples/motion_detector_home_assistant.py index 92dd673..b057563 100644 --- a/examples/motion_detector_home_assistant.py +++ b/examples/motion_detector_home_assistant.py @@ -49,14 +49,15 @@ class HomeAssistantBinarySensor: self.state = state data = { "state": "on" if state else "off", - "attributes": {"friendly_name": self.name}, + "attributes": {"friendly_name": self.name, "device_class": "motion"}, } + print(f"Updating sensor {self.name} to {data}") requests.post(self.url, json=data, headers=self.headers) # Stores historical data for each receiving antenna, for each subcarrier historical: dict[tuple[int, int], Queue[np.complex64]] = {} -sensor = HomeAssistantBinarySensor("motion_detector", "Motion Detector") +sensor = HomeAssistantBinarySensor("motion_detector", "Room Motion Detector") MAGN_THRESHOLD = 20 PHASE_THRESHOLD = 0.5 diff --git a/where_fi/processing/preprocess.py b/where_fi/processing/preprocess.py index 94f9539..170eb7c 100644 --- a/where_fi/processing/preprocess.py +++ b/where_fi/processing/preprocess.py @@ -130,11 +130,11 @@ class Preprocessor: + h_hat * config.preprocessing.moving_average_alpha ) - self._last_sample = h_hat - # Remove long term average, to remove static paths + # h_hat -= self.long_term_avg + + self._last_sample = h_hat return h_hat - h_hat -= self.long_term_avg # Apply bandpass filter to remove low and high frequency noise if not hasattr(self, "filter_zi"):