arm/device-connect · zenoh device-to-device · zero brokers

SUNHAUS · a Device Connect
smart-home demo

One house. Twelve appliances. One agent. A full day in three minutes. Every device is its own process; none knows about the others in advance. A home-energy agent discovers them over Zenoh and orchestrates the whole day — laundry and hot water on the solar peak, a cloud front handled, an EV charged before it reaches the driveway.

● real DeviceRuntime processes ● real Zenoh D2D discovery ● real @rpc / @emit traffic simulated hardware only 20 tests green

01The house, in motion

An animated storyboard of the three-minute day. Press play. This page is scripted — but the runnable demo underneath it is real: the same twelve appliances as real processes, discovered over a real bus, driven by a real agent.

sunhaus-demo-storyboard.html

02What's real, what's simulated

The honest split. The Device Connect layer and the agent are exactly what a production deployment runs. Only the hardware behind each driver is a simulation.

LayerWhat it isStatus
DiscoveryZenoh D2D multicast peer scouting — no broker, no registry, no configreal
Commandsinvoke("device(id).function(name)") → device @rpcreal
Eventsdevice @emit → agent subscribe("event(*)")real
Devicesone DeviceRuntime process each, real lifecyclesreal processes
Agentdevice-connect-agent-tools; deterministic policy codereal · 0 tokens
The worldsun, clouds, temperatures, car state-of-chargedeterministic sim

03The cast — twelve devices + one agent

Deliberately ordinary household gear. The point is that normal appliances benefit from a common device bus — and that devices never call each other; only the agent does.

inverter-01
pv_inverter
PV production, day forecast, re-forecast on clouds
battery-01
home_battery
Solar-first charge / discharge, SoC telemetry
wallbox-01
ev_charger
Plug sensing, metered charge session
ev-blue
electric_vehicle
Commutes; announces heading_home from the road
ev-red
electric_vehicle
Stays home; evening top-up request
heatpump-01
heat_pump
Asks for a cheap DHW window, heats on grant
pool-01
pool_system
8,000 L pool: filter, heat pump, cover, water-temperature sensor
hvac-01
air_conditioner
Pre-cool / eco / off, on agent command
washer-01
washing_machine
Loaded with a "done by 17:30" deadline
climate-01
climate_sensor
Indoor temp; cools when it hears the AC
weather-01
weather_station
Own irradiance + internet nowcast fusion
meter-01
grid_meter
Import/export, tariff bands, peak warning
agent-home
home-energy agent
Discovers, plans, and orchestrates the house

04The day, in the agent's own decisions

A real captured run at 1× — every [ok] is a real RPC round-trip over real Zenoh D2D. Nothing here is scripted.

$ python -m runner.demo  ·  agent-home decisions12 devices · 1 agent
[06:00] discovered 12 devices over Zenoh D2D (no broker)
[06:00] PV forecast (rpc): 68.1 kWh today, peak 8.1 kW @ 12:30
[08:00] washer 'eco40' due 17:30 → scheduled 11:45 (solar peak, +3.8h margin)
[08:30] heat pump wants 3.0 kWh → grant_window 11:30–13:00 [ok]
[09:00] pool 23.5°C → 26°C: filter + heat pump scheduled on solar [ok]
[11:30] invoke heatpump-01.start_dhw — hot water on sunshine [ok]
[11:45] invoke washer-01.start_cycle — laundry on PV surplus [ok]
[11:47] invoke pool-01 filter + heat pump — 8,000 L pool on PV surplus [ok]
[12:00] solar peak → pre-cool house to 22.5°C for the hot afternoon
[14:00] cloud front (own irradiance −38% + nowcast agree) → HVAC eco, heat pump paused
[16:45] ev-blue heading home ETA 17:30, needs 21 kWh → pre-plan: PV surplus now + off-peak 01:00
[17:30] ev-blue plugged in → start_charge from pv_surplus (matches pre-plan, zero wait) [ok]
[20:00] ev-red wants 78% by 07:00 → staggered to 22:30 to cap the grid peak
[21:55] daily stats — PV 61.5 kWh · self-consumption ~78% · battery 55% · washer done early
61.5 kWh
PV generated
~78%
self-consumption
12
devices, one agent
$0.00
LLM cost, policy mode (≈8¢/day even fully LLM-driven)

05Run it yourself

The whole house comes up with one command. Each appliance is a real process that finds the others over Zenoh; the agent discovers them and takes over.

Launch the house

# from sunhaus/, in a venv with the two
# device-connect packages + eclipse-zenoh
pip install -e .

python -m runner.demo            # 3-min day
python -m runner.demo --speed 6x # 30-sec run
python -m runner.demo --tail     # + live bus log

Watch the real bus & run the tests

# in a second terminal — genuine Zenoh
# event traffic, subscribe("event(*)")
python -m runner.tail

# 20 tests, no bus needed
python -m pytest

06How it fits together

Thirteen processes on one machine, no shared memory, no coordinator — only a Zenoh device-to-device bus and a simulated-day clock each derives locally.

   inverter-01   battery-01   wallbox-01   ev-blue   ev-red   heatpump-01
   hvac-01       washer-01    climate-01   weather-01   meter-01   pool-01
        │   each is a DeviceRuntime — a Zenoh peer   │
        └───────────────┬────────────────┬───────────┘
                        │  Zenoh D2D bus  │      (multicast scouting, no broker)
                        │                 │
                    agent-home        runner.tail
           discover() · invoke() · subscribe("event(*)")

Devices state needs; the agent owns the schedule. A heat pump asks for a cheap window, a washer advertises a deadline, a car announces it's heading home — the agent answers with an RPC. Request events repeat until served, and the plug-in is confirmed over RPC, so the demo stays reliable over best-effort D2D. Full write-up in architecture.md and CONCEPT.md.