Val Town Ground Floor Door Opener

This Val provides a web interface that allows authorized Val Town employees to remotely open the ground floor office door using a Switchbot device.

To use this, you must login with an @val.town email address.

The original version of this Val was created for a party: @stevekrouse/switchbot_party

Video demo

Switchbot API Integration

This Val authenticates to the Switchbot API with SWITCHBOT_TOKEN and SWITCHBOT_KEY environment variables.

The application uses the Switchbot API to send a "press" command to the device with ID D2353438164D (Val Town Ground Floor device).

Learn how to get your own Switchbot API keys here: Switchbot Docs.

Project Structure

  • main.tsx: The main application file with Hono routes and UI components
  • utils.tsx: Utility functions for Switchbot API authentication and requests
  • styles.tsx: CSS styles for the web interface