# silverfisk/home-automation architecture

> Architecture diagram of the GitHub repository silverfisk/home-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/silverfisk/home-automation
- Repository: https://github.com/silverfisk/home-automation

## Overview

This repository is a collection of Raspberry Pi home-automation scripts: it reads temperatures, logs indoor and outdoor readings, and controls a heat pump against a target. A separate documented workflow reads a boiler display from an Android webcam using OCR. The graph reflects the main workflows and documented capabilities; some scripts and the plotting/OCR implementations were not sampled, so their internal wiring is shown only where supported by comments or the README.

Main entry points: [`tempAutomation.rb`](https://github.com/silverfisk/home-automation/blob/master/tempAutomation.rb) (Pump automation), [`plotTemp.gnuplot`](https://github.com/silverfisk/home-automation/blob/master/plotTemp.gnuplot) (Temperature plot), [`outsidetemp.rb`](https://github.com/silverfisk/home-automation/blob/master/outsidetemp.rb) (Outside temperature logger), [`temperv14/temperv14`](https://github.com/silverfisk/home-automation/blob/master/temperv14/temperv14) (USB sensor driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Temperature sensing"]
  node_usb_sensor["USB thermometer"]
  node_temperv14["USB sensor driver"]
  node_driver_source["Driver source<br/>[temperv14.c]"]
  node_ds_sensor["DS18B20 sensor"]
  node_ds_reader["1-Wire reader<br/>[readDS18B20.rb]"]
  node_w1_file[("1-Wire sensor file")]
end

subgraph group_control["Heat-pump control"]
  node_automation["Pump automation<br/>[tempAutomation.rb]"]
  node_tellstick["TellStick control"]
  node_heat_pump["Heat pump"]
  node_pump_status["Pump status tool<br/>[pumpstatus.sh]"]
end

subgraph group_monitoring["Logging and display"]
  node_temp_log[("Indoor temperature log")]
  node_action_log[("Pump action log")]
  node_plot_script["Temperature plot<br/>[plotTemp.gnuplot]"]
  node_graph["Published graph"]
  node_outside_reader["Outside temperature logger<br/>[outsidetemp.rb]"]
  node_outside_log[("Outside temperature log")]
  node_ocr_reader["Boiler display OCR<br/>[readLCD.sh]"]
end

node_operator(("Operator"))
node_weather_api["Weather service"]
node_webcam["Android webcam"]
node_boiler_display["Boiler display"]

node_operator -->|"configures"| node_automation
node_automation -->|"reads temperature"| node_temperv14
node_temperv14 -->|"implemented by"| node_driver_source
node_usb_sensor -->|"USB readings"| node_driver_source
node_automation -->|"appends readings"| node_temp_log
node_automation -->|"runs tdtool"| node_tellstick
node_tellstick -->|"switches"| node_heat_pump
node_automation -->|"records actions"| node_action_log
node_automation -->|"runs plotter"| node_plot_script
node_plot_script -->|"reads log"| node_temp_log
node_plot_script -->|"publishes"| node_graph
node_operator -->|"uses"| node_ds_reader
node_ds_sensor -->|"updates"| node_w1_file
node_ds_reader -->|"reads"| node_w1_file
node_outside_reader -->|"requests weather"| node_weather_api
node_outside_reader -->|"appends readings"| node_outside_log
node_webcam -->|"provides image"| node_ocr_reader
node_boiler_display -->|"captured by"| node_webcam
node_operator -->|"configures"| node_ocr_reader
node_operator -->|"checks status"| node_pump_status

click node_temperv14 "https://github.com/silverfisk/home-automation/blob/master/temperv14/temperv14"
click node_driver_source "https://github.com/silverfisk/home-automation/blob/master/temperv14/temperv14.c"
click node_ds_reader "https://github.com/silverfisk/home-automation/blob/master/readDS18B20.rb"
click node_automation "https://github.com/silverfisk/home-automation/blob/master/tempAutomation.rb"
click node_plot_script "https://github.com/silverfisk/home-automation/blob/master/plotTemp.gnuplot"
click node_outside_reader "https://github.com/silverfisk/home-automation/blob/master/outsidetemp.rb"
click node_ocr_reader "https://github.com/silverfisk/home-automation/blob/master/readLCD.sh"
click node_pump_status "https://github.com/silverfisk/home-automation/blob/master/pumpstatus.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_usb_sensor,node_temperv14,node_driver_source,node_ds_sensor,node_ds_reader,node_w1_file toneBlue
class node_automation,node_tellstick,node_heat_pump,node_pump_status toneAmber
class node_temp_log,node_action_log,node_plot_script,node_graph,node_outside_reader,node_outside_log,node_ocr_reader toneMint
class node_operator,node_weather_api,node_webcam,node_boiler_display toneIndigo
```

## Components

### Temperature sensing

- **USB thermometer**
- [USB sensor driver](https://github.com/silverfisk/home-automation/blob/master/temperv14/temperv14): `temperv14/temperv14`
- [Driver source](https://github.com/silverfisk/home-automation/blob/master/temperv14/temperv14.c): `temperv14/temperv14.c`
- **DS18B20 sensor**
- [1-Wire reader](https://github.com/silverfisk/home-automation/blob/master/readDS18B20.rb): `readDS18B20.rb`
- **1-Wire sensor file**

### Heat-pump control

- [Pump automation](https://github.com/silverfisk/home-automation/blob/master/tempAutomation.rb): `tempAutomation.rb`
- **TellStick control**
- **Heat pump**
- [Pump status tool](https://github.com/silverfisk/home-automation/blob/master/pumpstatus.sh): `pumpstatus.sh`

### Logging and display

- **Indoor temperature log**
- **Pump action log**
- [Temperature plot](https://github.com/silverfisk/home-automation/blob/master/plotTemp.gnuplot): `plotTemp.gnuplot`
- **Published graph**
- [Outside temperature logger](https://github.com/silverfisk/home-automation/blob/master/outsidetemp.rb): `outsidetemp.rb`
- **Outside temperature log**
- [Boiler display OCR](https://github.com/silverfisk/home-automation/blob/master/readLCD.sh): `readLCD.sh`

### Other components

- **Operator**
- **Weather service**
- **Android webcam**
- **Boiler display**

## Connections

- Operator → Pump automation: configures
- Pump automation → USB sensor driver: reads temperature
- USB sensor driver → Driver source: implemented by
- USB thermometer → Driver source: USB readings
- Pump automation → Indoor temperature log: appends readings
- Pump automation → TellStick control: runs tdtool
- TellStick control → Heat pump: switches
- Pump automation → Pump action log: records actions
- Pump automation → Temperature plot: runs plotter
- Temperature plot → Indoor temperature log: reads log
- Temperature plot → Published graph: publishes
- Operator → 1-Wire reader: uses
- DS18B20 sensor → 1-Wire sensor file: updates
- 1-Wire reader → 1-Wire sensor file: reads
- Outside temperature logger → Weather service: requests weather
- Outside temperature logger → Outside temperature log: appends readings
- Android webcam → Boiler display OCR: provides image
- Boiler display → Android webcam: captured by
- Operator → Boiler display OCR: configures
- Operator → Pump status tool: checks status
