Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: HB3 connected sensors not reporting #319

Merged
merged 1 commit into from Apr 11, 2023

Conversation

martijnpoppen
Copy link
Contributor

The check for HB3 is preventing the integration to set the door Sensor Custom Push data

In the logging of my Homey integration i see:

{
  name: '',
  event_time: -9205462985303130000,
  type: 2,
  station_sn: 'T8030REDACTED',
  device_sn: 'T8900REDACTED',
  title: 'Eufy Security',
  content: 'Keukenraam is open',
  push_time: 1681109148578,
  channel: 0,
  cipher: 0,
  event_session: '',
  event_type: 3,
  file_path: '',
  pic_url: '',
  push_count: 1,
  notification_style: undefined,
  storage_type: 1,
  msg_type: undefined,
  person_name: undefined,
  person_id: undefined,
  tfcard_status: undefined,
  user_type: undefined,
  user_name: undefined,
  station_guard_mode: undefined,
  station_current_mode: undefined,
  alarm_delay: undefined,
  sound_alarm: undefined
}

@martijnpoppen
Copy link
Contributor Author

Yeah exactly so when you check for station_sn === HB3 then a door sensor will identify as a HB3 which you don't want.
So in this case you should check if the device_sn == HB3 so you know you get a HB3 station notification

@Palmke
Copy link
Contributor

Palmke commented Apr 10, 2023

I achieved it by adding
normalized_message.sensor_open = push_data.e !== undefined ? push_data.e === "1" ? true : false : undefined;
in the if-statement on line 346.

@martijnpoppen
Copy link
Contributor Author

Yeah but then still the door_sensor identifies as a HB3.

You shouldn't get all the HB3 information in your notification.

FIX: HB3 connected sensors not reporting
@martijnpoppen
Copy link
Contributor Author

updated the PR ;)

@Palmke
Copy link
Contributor

Palmke commented Apr 10, 2023

But a sensor always report the station it is connected to. While I do not fully understand why this construction was put in place for the HB3, further down the stream it is filtered by the EntrySensor class:
https://github.com/bropat/eufy-security-client/blob/master/src/http/device.ts#L2178

@martijnpoppen
Copy link
Contributor Author

@Palmke yes, but then you miss the sensor_open value which is set on line 451. But line 451 is skipped due to the check I just fixed :p

@bropat bropat changed the base branch from master to develop April 11, 2023 15:34
@bropat bropat merged commit 2aa4668 into bropat:develop Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants