Sensorlogger

  1. Overview
  2. Installation & Startup
  3. Configuration & complete example

Tinkerforge settings

Currently, version 2.1.31 (2021-01-15) of the Tinkerforge C/C++ bindings are used. The following Tinkerforge Bricklets are supported. The table also lists the channel IDs if a Bricklet supports different types of measurements.

Sensor Channels
Air Quality 0: Indoor air quality (IAQ) index
1: Temperature
2: Relative humidity
3: Air pressure
Ambient Light  
Ambient Light 2.0  
Ambient Light 3.0  
Analog In  
Analog In 2.0  
Analog In 3.0  
Barometer  
Barometer 2.0  
CO2  
CO2 2.0 0: CO2 concentration
1: Temperature
2: Relative humidity
Current12  
Current25  
Distance IR  
Distance IR 2.0  
Distance US  
Distance US 2.0  
Dust  
Energy Monitor 0: Voltage
1: Current
2: Energy
3: Real power
4: Apparent power
5: Reactive power
6: Power factor
7: Frequency
Humidity  
Humidity 2.0  
Industrial Digital In 4 0 to 3
Industrial Digital In 4 2.0 0 to 3
Industrial Dual 0-20mA 0 to 1
Industrial Dual 0-20mA 2.0 0 to 1
Industrial Dual Analog In 0 to 1
Industrial Dual Analog In 2.0 0 to 1
IO4 0 to 3, also as a pulse counter
IO4 2.0 0 to 3, also as a pulse counter (not testet)
IO16 0 to 15, also as a pulse counter (not testet)
IO16 2.0 0 to 15, also as a pulse counter (not testet)
Laser Range Finder  
Laser Range Finder 2.0  
Line  
Load Cell  
Load Cell 2.0  
Moisture  
Particulate Matter 1 or 10: PM1.0
2 or 25: PM2.5
3 or 100: PM10
PTC Temperature  
PTC Temperature 2.0  
Sound Intensity  
Sound Pressure Level  
Temperature  
Temperature 2.0  
Temperature IR 0: Ambient
1: Object
Temperature IR 2.0 0: Ambient
1: Object
UV Light  
UV Light 2.0  
Voltage  
Voltage/Current 0: Voltage
1: Current
Voltage/Current 2.0 0: Voltage
1: Current

Connection to the Brick Daemon

The general tinkerforge section is used to configure the connection parameters to the Brick Daemon.

"tinkerforge": {
    "host": "localhost",
    "port": 4223,
    "max_bricklet_read_failures":  8,
    "max_brickd_restart_attempts": 3,
    "brickd_restart_command": "sudo /bin/systemctl restart brickd",
    "system_restart_command": "sudo /bin/systemctl --force reboot"  
}

On any normally running system, you should not use the restart parameters and instead omit them or set them to null. Please only use them if you are fully aware of what you’re doing.

"brickd_restart_command": null,
"system_restart_command": null

Tinkerforge sensors

Polling in specific time intervals

"sensors": [
    ...
    {
        "sensor_id": "Weather/Temperature",
        "tinkerforge_uid": "z3L",
        "factor": 1,
        "offset": -4.5,
        "channel": 0,
        "mqtt_publish": "House/Weather/Temperature/current",
        "homematic_publish": "12345",
        "counter": false,
        "trigger": "periodic",
        "rest_period": {"value": 60, "unit": "s"}
    },
    ...
]

External triggers

Only Tinkerforge IO Bricklets are currently supported as external triggers.

"sensors": [
    ...
    {
        "sensor_id": "Weather/Wind",
        "tinkerforge_uid": "9Ws",
        "channel": 0,
        "io_port": "a",
        "factor": 0.5,
        "offset": 0,
        "mqtt_publish": "House/Weather/Wind/last-pulse",
        "counter": true,
        "trigger": "low",
        "rest_period": {"value": 7, "unit": "ms"},
        "io_debounce": {"value": 7, "unit": "ms"}
    },
    ...
]

MQTT>>