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

[MQTT] (Auto)Discovery implementation #5199

Open
wants to merge 28 commits into
base: mega
Choose a base branch
from

Conversation

tonhuisman
Copy link
Contributor

@tonhuisman tonhuisman commented Dec 30, 2024

Resolves #977
Resolves #4982
And Forum request(s) (here)

Features:

  • MQTT (Auto)Discovery for all supported devices configured to use a MQTT Controller that has MQTT Discovery implemented
    • Controller settings for Trigger and Discovery topics, and an Enabled checkbox
      • Suggested defaults:
      • Discovery Trigger topic: homeassistand/status (listening for payload online).
      • Auto Discovery topic: homeassistant/%devclass%/%sysname%/%tskname%/%valname% (/config will be added by default)
      • Actions:
      • When discovery is triggered, a random delay between 1 and 10 seconds is inserted before starting the action, to spread the load on the receiving server.
      • Discovery is sent for all enabled tasks that have this controller enabled in their settings.
      • When the controller is enabled and Auto Discovery is enabled, on clicking the Submit button a full discovery is sent.
      • The Discovery is triggered when the Controller is started.
      • Discovery is sent without Retain flag (for now, still considering to make this configurable).
    • Device settings for Controller config to set an optional Group ID and Resend MQTT Discovery
      • When the task is enabled, the Resend MQTT Discovery checkbox is checked and the Submit button used, the Discovery for the current device is resent.
      • The Group field can be used to manually group multiple tasks as a single device on HA. When 0, all values of the device are grouped as a single, unique, device.
  • [C005] Home Assistant (openHAB) MQTT: (partially) implemented (more device classes to add).
    • Device classes: switch, temperature, humidity, pressure, distance, pm1, pm25, pm10
  • [P052] CO2 Senseair: implement device class config for supported values

TODO:

  • Testing
  • Enable actually sending the MQTT messages...
  • Documentation updates
    • Add section to Development documentation
  • Implement more device class handlers: wind, analog, lux, direction, moisture, co2, gps, uv, uvindex, ir, (dimmer?), (weight?).
  • Implement more plugin specific value handlers (for plugins that allow user-selectable values)
  • Add configurable trigger value (default: online) and topic suffix (/config)
  • ...

src/_P018_Dust.ino Outdated Show resolved Hide resolved
src/_P077_CSE7766.ino Outdated Show resolved Hide resolved
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.

[FR] Home Assistant Auto Discovery MQTT Auto-discovery feature suggestion !
2 participants