HomeAssistant

From Noisebridge
Revision as of 07:30, 25 March 2026 by Nthmost (talk | contribs) (Add device details, webhook trigger correction, known issues from homeassistant.md)
Jump to navigation Jump to search

Home Assistant is an open-source home automation platform. Noisebridge runs a local instance to coordinate smart plugs, lights, and space-status automations — things that need to respond to whether the space is open or closed, or to sunrise/sunset.

Configuration repo: github.com/nthmost/noisebridge-ha

Why Does Noisebridge Have This?

Home Assistant lets us accumulate smart lights, switches, and other WiFi, Zigbee, and Z-Wave devices and do fancy integrated stuff with them. For example: automating the shutoff of all the lights in the RNA Lounge when someone flips the switch to close the space when they're the last one out.

The emphasis on local matters: we run HA on our own hardware, not in a vendor's cloud. This means automations work even when a manufacturer's API goes down.

Hardware

Home Assistant Host

  • Host: homeassistant.local (10.21.0.43:8123) — accessible on the NB LAN
  • Runs on a Raspberry Pi 4 (clear plastic case, Mary Poppins server rack)
  • The automation scripts live on Beyla (RNA Lounge server) and interact with HA over the local network

The Rack Phone

There is an Android phone mounted in the server rack whose sole job is to add and configure new smart plugs and lights. Smart home devices (especially Tuya-based ones) require a phone app to do initial setup and join them to the WiFi. Rather than borrowing someone's personal phone each time, the rack phone stays provisioned with the relevant apps and credentials so any maintainer can onboard a new device without hassle.

What It Controls

Open/Close Switch Group

These devices turn on when Noisebridge opens and off when it closes. All are assigned to the RNA Lounge area in HA.

Note: despite being called "lights", these are all switch.* entities (Tuya smart plugs powering physical lights) — not HA light.* entities.

Entity ID What It Is
switch.flaschentaschen_socket_1 Flaschentaschen LED display
switch.salt_lamp_1_socket_1 Open sign
switch.mini_smart_plug_socket_1 Beyla lights (RNA Lounge)

Other Devices

Entity ID Notes
switch.mini_smart_plug_5_socket_1 Currently unavailable — not in any automation; may need reconnection
light.home_assistant_connect_zwa_2_led Z-Wave dongle LED — not a room light

Hallway Deco Lights

The hallway decorative lights (switch.mini_smart_plug_2_socket_1) run on a sunset/sunrise schedule — on at dusk, off at dawn — independent of open/close status.

How the Noisebell Automation Works

The data flow from door sensor to smart plug:

  1. Upstream API: https://noisebell.extremist.software/status — returns open or closed
  2. Poller: noisebridge_status_updater.py runs on Beyla via cron every 5 minutes, polls the upstream API, and POSTs to an HA webhook to fire the automation
  3. Automation: automation.noisebell — triggered by webhook, turns the Open/Close switch group on or off depending on status
  4. Retry logic: Up to 5 attempts, 2 minutes apart, until all switches match the target state — handles Tuya cloud and WiFi flakiness
  5. Mode: restart — if status changes again mid-retry, the loop restarts with the new target

Manual overrides are respected — retries only happen during the ~10 minute post-transition window, so hand-switching a plug won't get fought.

Lights Dashboard

A simple web dashboard shows the current state of all switches and auto-refreshes every 15 seconds:

Setup & Configuration

Configuration is managed via ha_configure.py, which pushes automation and switch group definitions to HA via its REST API. This means the configuration is code — repeatable, version-controlled, and recoverable if the HA instance needs to be rebuilt.

To connect to the API you need a long-lived access token from the HA web UI. Store it in .ha_env (see .ha_env.example in the repo).

Known Issues

  • switch.mini_smart_plug_5_socket_1 is unavailable — may need reconnection or may control a light not yet assigned to any automation
  • The status server (noisebridge_status_server.py, port 8099) exposes the HA sensor state over HTTP with no auth — this is intentional for easy local querying

Maintainers