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

feat(mqtt)!: Complete rework of MQTT API & Add new content #151

Merged
merged 97 commits into from
Apr 11, 2024

Conversation

Slider0007
Copy link
Owner

@Slider0007 Slider0007 commented Mar 12, 2024

⚠️ Resulting MQTT API topics and structure: /docs/API/MQTT/_OVERVIEW.md


⚠️ BREAKING CHANGES

  • Restructure and rename MQTT topics -> resulting topics and structure: /docs/API/MQTT/_OVERVIEW.md
    • Add additional content -> Check linked API docs for more details
    • Some topics are published in JSON notation by default
    • ⚠️ connection topic moved to /device/status/and states are renamed to online and offline
    • ⚠️ GPIO topics are moved to device/gpio/
    • ⚠️ Process control topics (e.g. cycle_start) are moved to process/ctrl/
  • MQTT component: Complete code refactor
  • Align some of the namings between REST API <-> MQTT API
  • Split previous existing global retain flag setting to more granular configuration. Retain strategy:
    • Process data Retain Process Data and Home Assistant Discovery Retain Discovery Topics can be configured individually
    • Static device info topics are retained by default (published only after boot)
    • Device / process status topics are not retained (get published every cycle anyway)
  • Add option Process Data Notation to configure how process data (number sequence results) get published
    • JSON: Publish process data in JSON notation
    • Single Topics: Publish process data as single topics
    • JSON + Topics: Publish process data in JSON notation + single topics

  • Home Assistant Discovery /docs/API/MQTT/home-assistant-discovery.md
    • Complete refactor of home assistant discovery topics
    • Add option Home Assistant Discovery Prefix to configure 'HADiscoveryMainTopic' -> /docs/API/MQTT/HADiscoveryPrefix.md
    • Add option to configure Home Assistant Status Topic -> /docs/API/MQTT/HAStatusTopic.md
      • HA Discovery Topics get re-published whenever Home Assistant Status Topic change to onlineto ensure Home Assistant read topics even after restart and non-retained messages
    • Add option Retain Discovery Topics to independently configure retain flag for Home Assistant Discovery Topics (Usually not needed as long topcis are controlled by Home Assistant Status Topic, therefore enable retention only if not working as expected)
    • Rename 'Meter Type' to 'Home Assistant Meter Type' to signal this is only used by HA
    • Add new content, e.g. Add discovery topic to control cycle start -> For more details see API description

feat(webui): Add more content to system info page
refactor(REST API): Provide content of '/heap' as JSON + HTML
refactor(REST API)!: Remove handler starttime (use /info?type=DeviceStartTime)
refactor(REST API)!: Remove handler uptime  (use /info?type=Uptime)
refactor(REST API)!: Remove handler rssi (use /info?type=Uptime)
refactor(REST API)!: Remove handler rssi (use '/info?type=WlanRSSI')
refactor(REST API)!: Remove handler cputemp (use '/info?type=ChipTemp')
refactor(REST API)!: Remove handler sysinfo (use '/info' + '/heap')
refactor(REST API): Align time format (ISO)
Add 'datalogging sdcard' to '/info'
feat(REST API): Add legacy API by query parameter 'type'
refactor(REST API): Remove chip temp from 'overview' page. It's accessable from 'system' -> 'info' page
Use '/process_data?type=ProcessState'
Use '/process_data?type=ProcessError
Keeping same functionality, but with reduced APIs to save some RAM
Keeping same functionality, but with reduced APIs to save RAM
Use /process_data API instead

refactor(REST API): Merge parts of /value to /process_data
Use /process_data API instead

refactor(REST API): Rename remaining function of /value to /recognition_details
@Slider0007 Slider0007 marked this pull request as draft March 12, 2024 19:06
@Slider0007 Slider0007 marked this pull request as ready for review April 11, 2024 17:01
@Slider0007 Slider0007 merged commit 48ce862 into develop Apr 11, 2024
@Slider0007 Slider0007 deleted the refactor-mqtt branch April 11, 2024 17:04
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