Skip to content

Development

Dan Roberts edited this page Jan 16, 2026 · 1 revision

Development

Repository conventions

This repo is a split Arduino sketch so changes are easier to review and you can use Git diffs effectively.

Suggested workflow:

  • Keep behavior changes small per commit.
  • Prefer “one feature or fix per PR” style.
  • Capture Serial logs in issues when reporting bugs.

Build (Arduino IDE)

  1. Open BedJetMatterBridge.ino.
  2. Select board + port.
  3. Ensure your Arduino-ESP32 core provides Matter (#include <Matter.h>).
  4. Flash and monitor Serial at 115200.

Build (PlatformIO)

This repo currently targets Arduino IDE style. If you add PlatformIO support, consider:

  • adding platformio.ini
  • defining BOOT_PIN via build flags for boards that differ
  • documenting tested platform + versions

Extending the BedJet parser

The bridge intentionally avoids full JSON parsing for footprint/simplicity. Current behavior:

  • /api/state is fetched as a string
  • the bridge extracts:
    • ble_connected (optional)
    • status_summary (required)
  • the status_summary string is parsed for tokens

If BedJetWebSchedule evolves, you have two options:

  1. Keep status_summary stable and update parsing tokens
  2. Add a lightweight JSON parser (trade-off: footprint and complexity)

Adding new Matter clusters

Right now the bridge exposes Thermostat + Fan.

If you add more endpoints/clusters:

  • keep the “suppress update” pattern to prevent write-back loops
  • decide whether BedJetWebSchedule needs new endpoints or a richer schema
  • document the mapping in the wiki

Style & safety

  • This is a home automation project controlling heat/cool.
  • Always clamp ranges, validate inputs, and default conservative.
  • Avoid blocking calls in the main loop beyond short retries/timeouts.

Contribution checklist

  • Update wiki page(s) if user-facing behavior changes
  • Add/refresh troubleshooting notes if applicable
  • Test: setup portal, Wi‑Fi join, Matter pairing, command round-trip

Clone this wiki locally