Skip to content

Fix sensor data retrieval for Broadlink A2 devices #826

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kanshurichard
Copy link

@kanshurichard kanshurichard commented Apr 3, 2025

Hi there 👋

This PR fixes an issue that prevented Broadlink A2 air quality sensors from returning correct data. The problem was due to an incorrectly formatted packet being sent to the device when requesting sensor readings.

I’ve updated the request packet structure so that the device now responds with valid and complete data. This includes temperature, humidity, and PM10/2.5/1. The fix has been tested on a real A2 unit (4f60) and is working as expected.

Thanks for your time and effort maintaining this project! Please let me know if anything needs adjustment.

Best regards,
Kan

Context

The Broadlink A2 air quality sensor was previously unable to return valid data because the library sent incorrectly formatted request packets to the device. As a result, the response was shown as Error -5.

Proposed change

Corrected the format of the packet sent to A2 devices when requesting sensor data. With this fix, the device responds with valid data that can be parsed as expected (temperature, humidity, air quality, etc.).

Type of change

  • Bugfix (non-breaking change which fixes an issue)

Additional information

  • This PR fixes issue: N/A (no open issue was created)
  • This PR is related to:
  • Link to documentation pull request: N/A

Checklist

  • The code change is tested and works locally.
  • The code has been formatted using Black.
  • The code follows the Zen of Python.
  • I am creating the Pull Request against the correct branch.
  • Documentation added/updated.

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.

1 participant