Thermometers

At the highest level, thermometers are exposed via D-Bus. The service is implemented in the executable /bin/openheating-thermometers.py; responsibilities are roughly those:

  • Based on a configuration (see below), takes care about thermometers.

  • Exposes every thermometer as a D-Bus object.

  • Polls initiate a temperature read.

  • Temperature reads are done in a background thread - a Onewire temperature read takes over a second.

  • Implements simulation mode where temperatures are read from files rather than real hardware. Really cool when you are on a train and the backpack is large enough for your laptop, but too small for an entire heating plant.

Objects Provided

Object Path

Object (Python Class)

/

openheating.dbus.thermometer_center.ThermometerCenter_Server

/thermometers/<name>

openheating.dbus.thermometer.Thermometer_Server

Sample Configuration File

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- python -*-

from openheating.base.w1 import W1Thermometer
from openheating.base.thermometer import FileThermometer

import os.path


_thermometers = [
    ('Raum', 'Raum', '/sys/bus/w1/devices/28-02131dc603aa'),
    ('SpeicherOben', 'Speicher Oben', '/sys/bus/w1/devices/28-011432f138f9'),
    ('SpeicherMitte', 'Speicher Mitte', '/sys/bus/w1/devices/28-01131676b23f'),
    ('SpeicherUnten', 'Speicher Unten', '/sys/bus/w1/devices/28-02131df83daa'),
    ('RuecklaufSolar', 'Ruecklauf Solar', '/sys/bus/w1/devices/28-02131d96bbaa'),
    ('VorlaufSolar', 'Vorlauf Solar', '/sys/bus/w1/devices/28-02131d959eaa'),
    ('Oelbrenner', 'Oelbrenner', '/sys/bus/w1/devices/28-02131d676baa'),
    ('Holzbrenner', 'Holzbrenner', '/sys/bus/w1/devices/28-01131676d067'),
    ('RuecklaufHolz', 'Ruecklauf Holz', '/sys/bus/w1/devices/28-011432772cf9'),
    ('VorlaufHolz', 'Vorlauf Holz', '/sys/bus/w1/devices/28-02131dfd21aa'),
    ('VorlaufHeizkreis', 'Vorlauf Heizkreis', '/sys/bus/w1/devices/28-02131dace9aa'),
    ('VorlaufWarmwasser', 'Vorlauf Warmwasser', '/sys/bus/w1/devices/28-02131d9920aa'),
]

for name, description, path in _thermometers:
    # *in real life*: instantiates a W1Thermometer (which is a
    # callable) with one argument, path - like ``W1Thermometer(path)``

    # *in simulated life*: all but name and description is ignored,
    # and a FileThermometer instance is created.
    ADD_THERMOMETER(name, description, W1Thermometer, path)