Cookbook
Task-shaped recipes - one URL per how-to, complete runnable code
Each recipe is a single page with a working devicesdk.ts and one device file. Copy, adapt, deploy.
Pages in this section
How do I read a BME280 temperature/humidity sensor on a Pico?
I2C-based BME280 driver - configure the bus, read the chip ID, log readings on a cron
How do I toggle an LED with a button?
Wire a button to an input pin, watch transitions, drive the onboard LED
How do I persist a counter across device reboots?
Use this.env.DEVICE.kv to keep state across reboots, deploys, and reconnects
How do I send a daily summary on a cron schedule?
Declare a UTC cron, accumulate values in KV, post a summary once per day
How do I drive a WS2812 strip with a rainbow effect?
Configure the strip on the Pico's PIO, animate a slow hue shift via cron
How do I show live data on a small OLED?
Wire an SSD1306 OLED, render text, update once a minute from a sensor read
How do I post sensor readings to a Discord webhook?
Read the chip temperature on a cron, POST to a webhook, handle non-2xx responses
How do I surface a sensor as a Home Assistant entity?
Declare HA entities in devicesdk.ts, push values with emitState, consume via the HA integration
How do I make two devices talk to each other?
Use this.env.DEVICES["other"].method() - typed RPC mediated by the runtime
How do I watch a device's state and logs in real time?
Stream live logs and structured state via devicesdk logs --tail or the watch WebSocket