Skip to content

Expose RTL_433 contact states in Home Assistant discovery - #2379

Open
dajiaohuang wants to merge 1 commit into
1technophile:developmentfrom
dajiaohuang:fix-rtl433-contact-discovery
Open

dajiaohuang wants to merge 1 commit into
1technophile:developmentfrom
dajiaohuang:fix-rtl433-contact-discovery

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

Add Home Assistant binary sensor discovery for RTL_433 contact fields closed, contact_open, and opened. The closed field is inverted so a closed sensor state maps to Home Assistant off; contact_open and opened keep their reported polarity. All three use the neutral opening device class.

This addresses the missing discovery mappings discussed in #2375. The separate RTL_433_ESP decoding work mentioned there remains upstream.

Validation: git diff --check and focused source checks pass. A local PlatformIO build was attempted but could not run because PlatformIO is unavailable (pio is not installed and Python has no platformio module).

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings (local PlatformIO build unavailable)
  • I accept the DCO.

@1technophile

1technophile commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Thanks, you need to add opening into 'availableHASSClasses'

@dajiaohuang

Copy link
Copy Markdown
Author

The requested follow-up is prepared locally: HASS_CLASS_OPENING is defined as "opening" in config_mqttDiscovery.h and included in availableHASSClasses.

Both PlatformIO release builds pass with this patch: esp32dev-rtl_433 and nodemcuv2-rf. ESP8266's upstream elf2bin.py emits Python SyntaxWarnings, so this is not a warning-free claim.

I have not validated the discovery payload on physical hardware. The contribution checklist requires hardware testing; the follow-up remains unpublished until that requirement can be satisfied. The existing PR head is still 76a52734640079ab2f57530f99ae793eef52e72b, so its CI does not validate these two local additions.

This branch has not been deployed

No deployments
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.

2 participants