Docs

Example: HTTP sensor

The SDK's sample integration: poll a JSON endpoint and expose a sensor and a switch.

The SDK ships examples/x_novon_example_http_sensor, a complete integration that polls a JSON endpoint on a timer, publishes a sensor with the value it reads and a switch that posts back. Build it with:

node libs/integration-sdk/bin/novon-integration.mjs build libs/integration-sdk/examples/x_novon_example_http_sensor

What to look at:

  • manifest.json: platforms: ["sensor", "switch"], permissions: ["http", "timers"], a two-input configFlow (URL scoped data, interval scoped options), exposedConfigFields: ["url"].
  • setupEntry: a first request that throws ctx.notReady on failure, entities.add for both entities under one device, and a setInterval poll that calls entities.update.
  • onService on the switch: a POST, then an optimistic entities.update.
  • optionsUpdated: re-reads the interval and restarts the timer instead of letting the hub reload the entry.

Use it as the starting point for any LAN device with an HTTP API: replace the URL shapes, keep the structure.