Updated external content (Jenkins build 154)

pull/1472/head
openHAB Build Server 2020-12-26 13:42:51 +00:00
parent 23614b48f0
commit 7689544930
15 changed files with 1372 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -41,6 +41,10 @@ Squeeze players may be official Logitech products or other players like [Squeeze
A Squeeze Server is discovered through UPnP in the local network.
Once it is added as a Thing the Squeeze Server bridge will discover Squeeze Players automatically.
If your Squeeze Server is not discovered automatically, you can add it manually by creating a .thing file containing something like this (more example [below](https://www.openhab.org/addons/bindings/squeezebox/#thing-configuration)):
```
Bridge squeezebox:squeezeboxserver:myServer [ ipAddress="192.168.1.10", webport=9000, cliport=9090 ]
````
## Binding Configuration

View File

@ -253,13 +253,13 @@ Bit5: Disable Multi CC in auto report.
Bit6: Disable to report battery state when the device triggered.
Bit7: Reserve.
The following option values may be configured, in addition to values in the range 0 to 127 -:
The following option values may be configured -:
| Value | Description |
|--------|-------------|
| 20 | PIR Super Sensitivity and Binary Report |
| 4 | Default |
The manufacturer defined default value is ```4```.
The manufacturer defined default value is ```4``` (Default).
This parameter has the configuration ID ```config_7_1``` and is of type ```INTEGER```.

View File

@ -282,7 +282,19 @@ Parameter 2 values may be combined, e.g. 1+8=9 means that Open Window Detector a
8 (bit 3) - enabled LED indications when controlling remotely
16 (bit 4) - protect from setting Full ON and Full OFF mode by turning the knob manually
Values in the range 0 to 31 may be set.
32 (bit 5) - device mounted in vertical position
64 (bit 6) - moderate regulator behaviour (instead of Rapid)
128 (bit 7) - inverted knob operation
256 (bit 8) - report when heating medium is required
512 (bit 9) - detecting heating system failures
Values in the range 0 to 1023 may be set.
The manufacturer defined default value is ```1```.

View File

@ -5,7 +5,7 @@ title: ID-150 - ZWave
{% include base.html %}
# ID-150 Z wave module for ID Lock 150 and 101
# ID-150 Z wave module for ID Lock 150
This describes the Z-Wave device *ID-150*, manufactured by *ID Lock AS* with the thing type UID of ```idlock_idl150new_01_006```.
This version of the device is limited to firmware versions above 1.6
@ -14,8 +14,6 @@ The device is in the category of *Lock*, defining Devices whose primary pupose i
![ID-150 product image](https://opensmarthouse.org/zwavedatabase/1106/image/)
The ID-150 supports routing. This allows the device to communicate using other routing enabled devices as intermediate routers. This device is unable to participate in the routing of data from other devices.
## Overview
The ID Lock Z-wave module is a security enabled Z-wave Plus product that is able to use encrypted Z-wave Plus messages in order to communicate to other Z-wave Plus products enabled security.
@ -48,7 +46,7 @@ The ID Lock Z-wave module can be included and operated in any Z-wave network con
### General Usage Information
Configuration parameters 2 RFID Registration Configuration and 10 Retrieve RFID Information have not been added since they are only valid for the 101 model. 
## Channels
@ -363,13 +361,13 @@ Association group 1 supports 5 nodes.
| COMMAND_CLASS_ASSOCIATION_GRP_INFO_V1| |
| COMMAND_CLASS_DEVICE_RESET_LOCALLY_V1| |
| COMMAND_CLASS_ZWAVEPLUS_INFO_V1| |
| COMMAND_CLASS_DOOR_LOCK_V1| |
| COMMAND_CLASS_DOOR_LOCK_V2| |
| COMMAND_CLASS_USER_CODE_V1| |
| COMMAND_CLASS_CONFIGURATION_V1| |
| COMMAND_CLASS_ALARM_V4| |
| COMMAND_CLASS_MANUFACTURER_SPECIFIC_V1| |
| COMMAND_CLASS_POWERLEVEL_V1| |
| COMMAND_CLASS_FIRMWARE_UPDATE_MD_V1| |
| COMMAND_CLASS_FIRMWARE_UPDATE_MD_V2| |
| COMMAND_CLASS_BATTERY_V1| |
| COMMAND_CLASS_ASSOCIATION_V2| |
| COMMAND_CLASS_VERSION_V2| |

View File

@ -145,7 +145,7 @@ Detailed information on each parameter can be found in the sections below.
Motion sensitivity
0 is disabled, 1 is low sensitivity, and 8 is high sensitivity.
The following option values may be configured, in addition to values in the range 0 to 8 -:
The following option values may be configured -:
| Value | Description |
|--------|-------------|
@ -171,7 +171,7 @@ This parameter has the configuration ID ```config_13_2``` and is of type ```INTE
Enable/disable Basic Set reports on motion detection
The following option values may be configured -:
The following option values may be configured, in addition to values in the range 0 to 1 -:
| Value | Description |
|--------|-------------|
@ -187,7 +187,7 @@ This parameter has the configuration ID ```config_14_1``` and is of type ```INTE
The following option values may be configured -:
The following option values may be configured, in addition to values in the range 0 to 1 -:
| Value | Description |
|--------|-------------|
@ -203,7 +203,7 @@ This parameter has the configuration ID ```config_15_1``` and is of type ```INTE
Enabled/disable Binary Sensor reports on motion detection
The following option values may be configured -:
The following option values may be configured, in addition to values in the range 0 to 1 -:
| Value | Description |
|--------|-------------|
@ -219,7 +219,7 @@ This parameter has the configuration ID ```config_16_1``` and is of type ```INTE
The following option values may be configured -:
The following option values may be configured, in addition to values in the range 0 to 2 -:
| Value | Description |
|--------|-------------|
@ -235,7 +235,7 @@ This parameter has the configuration ID ```config_18_1``` and is of type ```INTE
The following option values may be configured -:
The following option values may be configured, in addition to values in the range 0 to 1 -:
| Value | Description |
|--------|-------------|
@ -311,7 +311,7 @@ This parameter has the configuration ID ```config_183_2``` and is of type ```INT
Humidity reporting threshold
Set the reporting threshold for humidity. The sensor will report a new humidity value to the hub whenever humidity changes by the percentage number entered as value.
The following option values may be configured, in addition to values in the range 0 to 80 -:
The following option values may be configured -:
| Value | Description |
|--------|-------------|
@ -326,7 +326,7 @@ This parameter has the configuration ID ```config_184_1``` and is of type ```INT
Lux reporting threshold
Set the reporting threshold for lux. The sensor will report new lux to the hub whenever the brightness level changes by the number of lux entered as value.
The following option values may be configured, in addition to values in the range 0 to 30000 -:
The following option values may be configured -:
| Value | Description |
|--------|-------------|

View File

@ -61,7 +61,7 @@
<item-type>Contact</item-type>
<label>Device Locked (external)</label>
<description>Device is locked for switching over external sources.</description>
<category>Contact</category>
<category>Lock</category>
<state pattern="%s" readOnly="true"/>
</channel-type>
@ -69,7 +69,7 @@
<item-type>Contact</item-type>
<label>Locked (manual)</label>
<description>Device is locked for switching by pressing the button on the device.</description>
<category>Contact</category>
<category>Lock</category>
<state pattern="%s" readOnly="true"/>
</channel-type>
@ -163,7 +163,7 @@
<item-type>Number:Temperature</item-type>
<label>Setpoint Temperature</label>
<description>Thermostat Setpoint temperature.</description>
<category>Temperature</category>
<category>Heating</category>
<state pattern="%.1f %unit%"/>
</channel-type>
@ -187,6 +187,7 @@
<item-type>String</item-type>
<label>Radiator Mode</label>
<description>States the mode of the radiator (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN).</description>
<category>Heating</category>
<state pattern="%s">
<options>
<option value="ON">On</option>

View File

@ -16,7 +16,7 @@
<channel id="energyProduction" typeId="energyProduction"/>
<channel id="batteryPower" typeId="batteryPower"/>
<channel id="batteryFuelCharge" typeId="batteryFuelCharge"/>
<channel id="batteryState" typeId="system.battery-level"/>
<channel id="batteryState" typeId="batteryState"/>
<channel id="batteryStateValue" typeId="batteryStateValue"/>
<channel id="gridPower" typeId="gridPower"/>
<channel id="gridPowerSupply" typeId="gridPowerSupply"/>
@ -98,6 +98,13 @@
<state readOnly="true" pattern="%.0f %unit%"/>
</channel-type>
<channel-type id="batteryState">
<item-type>String</item-type>
<label>Battery State</label>
<category>Battery</category>
<state readOnly="true" pattern="%s"/>
</channel-type>
<channel-type id="batteryStateValue">
<item-type>Number</item-type>
<label>Battery State Value</label>

View File

@ -130,16 +130,16 @@ Parameter to set the sensor functions<br /> <h1>Overview</h1><p>Bit0: Disable ma
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_7_1" type="integer" groupName="configuration"
min="0" max="127">
<parameter name="config_7_1" type="integer" groupName="configuration">
<label>7: Customer Function</label>
<description><![CDATA[
Parameter to set the Customer Function<br /> <h1>Overview</h1><p>Bit0: Reserve.</p> <p>Bit1: Enable sending motion OFF report.</p> <p>Note: Depends on the Bit4, 0: Report Notification CC, Type: 0x07, Event: 0xFE 1: Sensor Binary Report, Type: 0x0C, Value: 0x00</p> <p>Bit2: Enable PIR super sensitivity mode.</p> <p>Bit3: Enable don't send out BASIC OFF after door closed.</p> <p>Bit4: Notification Type, 0: Using Notification Report. 1: Using Sensor Binary Report.</p> <p>Bit5: Disable Multi CC in auto report.</p> <p>Bit6: Disable to report battery state when the device triggered.</p> <p>Bit7: Reserve.</p>
]]></description>
<default>4</default>
<options>
<option value="20">PIR Super Sensitivity and Binary Report</option>
<option value="4">Default</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_8_1" type="integer" groupName="configuration"

View File

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="zwave"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0
https://openhab.org/schemas/thing-description/v1.0.0">
<thing-type id="fibaro_fgt001_00_000" listed="false">
<label>FGT001 Thermostatic Valve</label>
<description><![CDATA[
Thermostatic Valve<br /> <h1>Overview</h1><p>FIBARO Heat Controller is a remotely controlled thermostatic head to control temperature in the room. It measures the temperature and automatically adjust the heat level. It can be mounted without tools on three types of thermostatic radiator valves. It is also possible to create schedules via app to easily manage temperature throughout the week. <br />Main features:</p> <ul><li>to be installed on three types of valves: M30 x 1.5, Danfoss RTD-N and Danfoss RA-N,</li> <li>compatible with any Z-Wave or Z-Wave+ Controller,</li> <li>supports Z-Wave network Security Modes: S0 with AES-128 encryption and S2 with PRNG-based encryption,</li> <li>built-in battery recharged through standard micro-USB port,</li> <li>easy installation - no tools required,</li> <li>can use dedicated temperature sensor,</li> <li>supports heating schedules,</li> <li>automatic calibration,</li> <li>anti-freeze function,</li> <li>decalc function,</li> <li>unconstrained rotation spherical knob to set desired temperature.</li> </ul> <br /> <h2>Inclusion Information</h2><p>Add the device to the Z-Wave network:</p> <ol><li>Make sure the device is within the direct range of your Z-Wave controller.</li> <li>Set the main controller in (security/non-security) add mode.</li> <li>Use the included key to quickly triple click the button on the thermostatic head.</li> <li>The LED ring will start blinking white.</li> <li>If you are adding in S2 authenticated mode, type in the device pin code (underlined part of the public key on the label).</li> <li>Wait for the adding process to end.</li> <li>Successful adding will be confirmed by the Z-Wave controller.</li> </ol> <br /> <h2>Exclusion Information</h2><p>To remove the device from the Z-Wave network:</p> <ol><li>Make sure the device is within the direct range of your Z-Wave controller.</li> <li>Set the main controller into remove mode.</li> <li>Use the included key to quickly triple click the button on the thermostatic head.</li> <li>The LED ring will start blinking white.</li> <li>Wait for the removing process to end.</li> <li>Successful removing will be confirmed by the Z-Wave controller.</li> </ol> <br /> <h2>Wakeup Information</h2><p>FIBARO Heat Controller is a FLiRS device. The FLiRS device alternates between sleep mode and a partially awake mode in which it is listening beam signal. When device receives this beam, it immediately fully wakes up and then communicates with the controller or other Z-Wave device.</p>
]]></description>
<category>RadiatorControl</category>
<!-- CHANNEL DEFINITIONS -->
<channels>
<channel id="sensor_binary" typeId="sensor_binary">
<label>Binary Sensor</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_SENSOR_BINARY</property>
</properties>
</channel>
<channel id="sensor_temperature" typeId="sensor_temperature">
<label>Sensor (temperature)</label>
<properties>
<property name="binding:*:QuantityType">COMMAND_CLASS_SENSOR_MULTILEVEL;type=TEMPERATURE</property>
</properties>
</channel>
<channel id="thermostat_mode" typeId="fibaro_fgt001_00_000_thermostat_mode">
<label>Thermostat mode</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_THERMOSTAT_MODE</property>
</properties>
</channel>
<channel id="thermostat_setpoint_heating" typeId="thermostat_setpoint">
<label>Setpoint (heating)</label>
<properties>
<property name="binding:*:QuantityType">COMMAND_CLASS_THERMOSTAT_SETPOINT;type=HEATING</property>
</properties>
</channel>
<channel id="alarm_power" typeId="alarm_power">
<label>Alarm (power)</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM;type=POWER_MANAGEMENT</property>
</properties>
</channel>
<channel id="alarm_system" typeId="alarm_system">
<label>Alarm (system)</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM;type=SYSTEM</property>
</properties>
</channel>
<channel id="battery-level" typeId="system.battery-level">
<properties>
<property name="binding:*:PercentType">COMMAND_CLASS_BATTERY</property>
</properties>
</channel>
<channel id="time_offset" typeId="time_offset">
<label>Clock Time Offset</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_CLOCK</property>
</properties>
</channel>
<channel id="thermostat_mode1" typeId="fibaro_fgt001_00_000_thermostat_mode">
<label>Thermostat mode 1</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_THERMOSTAT_MODE:1</property>
</properties>
</channel>
<channel id="thermostat_setpoint_heating1" typeId="thermostat_setpoint">
<label>Setpoint (heating) 1</label>
<properties>
<property name="binding:*:QuantityType">COMMAND_CLASS_THERMOSTAT_SETPOINT:1;type=HEATING</property>
</properties>
</channel>
<channel id="alarm_power1" typeId="alarm_power">
<label>Alarm (power) 1</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM:1;type=POWER_MANAGEMENT</property>
</properties>
</channel>
<channel id="alarm_system1" typeId="alarm_system">
<label>Alarm (system) 1</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM:1;type=SYSTEM</property>
</properties>
</channel>
<channel id="battery-level1" typeId="system.battery-level">
<label>Battery Level 1</label>
<properties>
<property name="binding:*:PercentType">COMMAND_CLASS_BATTERY</property>
</properties>
</channel>
<channel id="time_offset1" typeId="time_offset">
<label>Clock Time Offset 1</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_CLOCK:1</property>
</properties>
</channel>
<channel id="sensor_temperature2" typeId="sensor_temperature">
<label>Sensor (temperature) 2</label>
<properties>
<property name="binding:*:QuantityType">COMMAND_CLASS_SENSOR_MULTILEVEL:2;type=TEMPERATURE</property>
</properties>
</channel>
<channel id="alarm_power2" typeId="alarm_power">
<label>Alarm (power) 2</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM:2;type=POWER_MANAGEMENT</property>
</properties>
</channel>
<channel id="battery-level2" typeId="system.battery-level">
<label>Battery Level 2</label>
<properties>
<property name="binding:*:PercentType">COMMAND_CLASS_BATTERY</property>
</properties>
</channel>
</channels>
<!-- DEVICE PROPERTY DEFINITIONS -->
<properties>
<property name="vendor">Fibargroup</property>
<property name="modelId">FGT001</property>
<property name="manufacturerId">010F</property>
<property name="manufacturerRef">1301:1000,1301:1001</property>
<property name="dbReference">749</property>
<property name="defaultAssociations">1</property>
</properties>
<!-- CONFIGURATION DESCRIPTIONS -->
<config-description>
<!-- GROUP DEFINITIONS -->
<parameter-group name="configuration">
<context>setup</context>
<label>Configuration Parameters</label>
</parameter-group>
<parameter-group name="association">
<context>link</context>
<label>Association Groups</label>
</parameter-group>
<!-- PARAMETER DEFINITIONS -->
<parameter name="config_1_4" type="integer" groupName="configuration"
min="10" max="10000">
<label>1: Override Schedule duration</label>
<description><![CDATA[
Duration of Override Schedule after turning knob<br /> <h1>Overview</h1><p>This parameter determines duration of Override Schedule after turning the knob while normal schedule is active (set by Schedule CC).</p> <p>Units = minutes</p>
]]></description>
<default>240</default>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_2_4" type="integer" groupName="configuration"
min="0" max="1023">
<label>2: Additional functions</label>
<description><![CDATA[
This parameter allows to enable different additional functions of the device.<br /> <h1>Overview</h1><p>Parameter 2 values may be combined, e.g. 1+8=9 means that Open Window Detector and LED indications when controlling remotely are enabled.</p> <p>1 (bit 0) - enable Open Window Detector</p> <p>2 (bit 1) - enable fast Open Window Detector</p> <p>4 (bit 2) - increase receiver sensitivity (shortens battery life)</p> <p>8 (bit 3) - enabled LED indications when controlling remotely</p> <p>16 (bit 4) - protect from setting Full ON and Full OFF mode by turning the knob manually</p><p>32 (bit 5) - device mounted in vertical position<br /></p><p>64 (bit 6) - moderate regulator behaviour (instead of Rapid)<br /></p><p>128 (bit 7) - inverted knob operation</p><p>256 (bit 8) - report when heating medium is required</p><p>512 (bit 9) - detecting heating system failures</p>
]]></description>
<default>1</default>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_3_4" type="integer" groupName="configuration" readOnly="true"
min="0" max="3">
<label>3: Additional functions status (READ-ONLY)</label>
<description><![CDATA[
This parameter allows to check statuses of different additional functions.<br /> <h1>Overview</h1><p>Parameter 3 values may be combined, e.g. 1+2=3 means optional sensor works properly and open window detection was triggered.</p> <p>1 (bit 0) - optional temperature sensor connected and operational</p> <p>2 (bit 1) - open window detected</p>
]]></description>
<default>0</default>
<limitToOptions>false</limitToOptions>
</parameter>
<!-- ASSOCIATION DEFINITIONS -->
<parameter name="group_1" type="text" groupName="association" multiple="true">
<label>1: Lifeline</label>
<description><![CDATA[
Lifeline<br /> <h1>Overview</h1><p>Z-Wave Plus Lifeline association group that reports the device status and allows for assigning single device only (main controller by default)</p>
]]></description>
<multipleLimit>5</multipleLimit>
</parameter>
<!-- STATIC DEFINITIONS -->
<parameter name="node_id" type="integer" min="1" max="232" readOnly="true" required="true">
<label>Node ID</label>
<advanced>true</advanced>
</parameter>
</config-description>
</thing-type>
<channel-type id="fibaro_fgt001_00_000_thermostat_mode">
<item-type>Number</item-type>
<label>Thermostat Mode</label>
<description>Sets the thermostat mode</description>
<category>Temperature</category>
<state pattern="%s">
<options>
<option value="0">Off</option>
<option value="1">Heat</option>
</options>
</state>
</channel-type>
<channel-type id="fibaro_fgt001_00_000_thermostat_mode">
<item-type>Number</item-type>
<label>Thermostat Mode</label>
<description>Sets the thermostat mode</description>
<category>Temperature</category>
<state pattern="%s">
<options>
<option value="0">Off</option>
<option value="1">Heat</option>
</options>
</state>
</channel-type>
</thing:thing-descriptions>

View File

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="zwave"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0
https://openhab.org/schemas/thing-description/v1.0.0">
<thing-type id="idlock_idl150new_01_006" listed="false">
<label>ID-150 Z wave module for ID Lock 150</label>
<description><![CDATA[
Z wave module for ID Lock 150<br /> <h1>Overview</h1><p>The ID Lock Z-wave module is a security enabled Z-wave Plus product that is able to use encrypted Z-wave Plus messages in order to communicate to other Z-wave Plus products enabled security.</p> <p>The module is proprietary for the ID Lock 150 and also backwards compatible with the ID Lock 101. The ID Lock Z-wave module must be used in conjunction with a Security Enabled Z-wave Controller in order to fully utilize their full capability.</p> <p>The ID Lock Z-wave module can be included and operated in any Z-wave network containing certified other Z-wave products regardless of manufacturer. The ID Lock Z-wave module does not support the Basic Set Command Class.</p> <br /> <h2>Inclusion Information</h2><ol><li>Bring the controller as close as possible to the lock unit</li> <li>Set the controller to inclusion mode</li> <li>Push and hold KEY button on the inside panel on the lock until all keys on the outside light up and a audible signal is given.</li> <li>Release the KEY button on the inside panel</li> <li>Enter your Master PIN and press * </li> <li>Click 2 and then *</li> <li>Click 5, don't press *</li> <li>The LED flashes blue when inclusion is in progress</li> <li>The inclusion may take some time as security is required</li> </ol> <br /> <h2>Exclusion Information</h2><ol><li>Set the controller to Exclusion mode</li> <li>Push and hold KEY button on the inside panel on the lock until all keys on the outside light up and a audible signal is given.</li> <li>Release the KEY button on the inside panel</li> <li>Enter your Master PIN and press * </li> <li>Click 2 and then *</li> <li>Click 5, don't press *</li> <li>The LED flashes blue when exclusion is in progress</li> </ol> <br /> <h2>Wakeup Information</h2><p>Manually lock or unlock lock from inside or with PIN-code from outside.</p>
]]></description>
<category>Lock</category>
<!-- CHANNEL DEFINITIONS -->
<channels>
<channel id="lock_door" typeId="lock_door">
<label>Door Lock</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_DOOR_LOCK</property>
</properties>
</channel>
<channel id="sensor_door" typeId="sensor_door">
<label>Door State</label>
<properties>
<property name="binding:*:OpenClosedType">COMMAND_CLASS_DOOR_LOCK</property>
</properties>
</channel>
<channel id="notification_access_control" typeId="notification_access_control">
<label>Access control</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_ALARM;type=ACCESS_CONTROL</property>
</properties>
</channel>
<channel id="alarm_emergency" typeId="alarm_emergency">
<label>Emergency (Contact Fire Service) [Deprecated]</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM;type=EMERGENCY</property>
</properties>
</channel>
<channel id="alarm_burglar" typeId="alarm_burglar">
<label>Burglar alarm (tampering)</label>
<properties>
<property name="binding:*:OnOffType">COMMAND_CLASS_ALARM;type=BURGLAR</property>
</properties>
</channel>
<channel id="alarm_raw" typeId="alarm_raw">
<label>Alarm (raw) [Deprecated]</label>
<properties>
<property name="binding:*:StringType">COMMAND_CLASS_ALARM</property>
</properties>
</channel>
<channel id="battery-level" typeId="system.battery-level">
<properties>
<property name="binding:*:PercentType">COMMAND_CLASS_BATTERY</property>
</properties>
</channel>
</channels>
<!-- DEVICE PROPERTY DEFINITIONS -->
<properties>
<property name="vendor">ID Lock AS</property>
<property name="modelId">ID-150</property>
<property name="manufacturerId">0373</property>
<property name="manufacturerRef">0003:0001</property>
<property name="versionMin">1.6</property>
<property name="dbReference">1106</property>
<property name="defaultAssociations">1</property>
</properties>
<!-- CONFIGURATION DESCRIPTIONS -->
<config-description>
<!-- GROUP DEFINITIONS -->
<parameter-group name="configuration">
<context>setup</context>
<label>Configuration Parameters</label>
</parameter-group>
<parameter-group name="association">
<context>link</context>
<label>Association Groups</label>
</parameter-group>
<!-- PARAMETER DEFINITIONS -->
<parameter name="config_1_1" type="integer" groupName="configuration">
<label>1: Door lock mode</label>
<description><![CDATA[
Set if the lock is in away mode and if automatic locking should be enabled<br /> <h1>Overview</h1><p>Auto lock Mode, Manual lock mode, Activate Away Mode, Deactivate Away Mode.</p> <p>If value is 0x02 (Enable Away, Manual lock) and the door is unlocked value will be set to 0x00.</p> <p>If value is 0x03 (Enable Away, Auto lock) and the door is unlocked value will be set to 0x01.</p> <p> Default Value: 1 (Disable Away/Auto Lock Mode)</p>
]]></description>
<default>1</default>
<options>
<option value="0">Disable Away Manual Lock</option>
<option value="1">Disable Away Auto Lock</option>
<option value="2">Enable Away Manual Lock</option>
<option value="3">Enable Away Auto Lock</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_2_1" type="integer" groupName="configuration">
<label>2: RFID Mode</label>
<description>RFID Mode</description>
<default>5</default>
<options>
<option value="5">RFID activated</option>
<option value="9">RFID deactivated</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_3_1" type="integer" groupName="configuration">
<label>3: Door Hinge Position Mode</label>
<description>Tell the lock which side your hinges are on seen from the outside</description>
<default>0</default>
<options>
<option value="0">Right hinged operation</option>
<option value="1">Left hinged operation</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_4_1" type="integer" groupName="configuration">
<label>4: Door Audio Volume Level</label>
<description>Set the Audio Volume Level of the Lock</description>
<default>5</default>
<options>
<option value="0">No sound</option>
<option value="1">Level 1</option>
<option value="2">Level 2</option>
<option value="3">Level 3</option>
<option value="4">Level 4</option>
<option value="5">Level 5 (Default)</option>
<option value="6">Max. sound level</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_5_1" type="integer" groupName="configuration">
<label>5: Door ReLock Mode</label>
<description><![CDATA[
Sets if the door should relock or not<br /> <h1>Overview</h1><p>With this configuration ID Lock can automatically relock the door if an already locked door gets unlocked, but remains unopened. This is avoided by deactivating relocking.</p>
]]></description>
<default>1</default>
<options>
<option value="0">Disabled</option>
<option value="1">Enabled</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_6_1" type="integer" groupName="configuration">
<label>6: Service PIN Mode</label>
<description><![CDATA[
Sets the validity of the service PIN<br /> <h1>Overview</h1><p>A configuration get command on this parameter returns the latest set parameter value (set by Z-wave).</p> <p>This is a set only value, if changed locally on keypad these values are not changed on Z-wave module. Value 5 and 6 are for future use on door lock.</p>
]]></description>
<default>0</default>
<options>
<option value="0">Deactivated</option>
<option value="1">Valid 1 time</option>
<option value="2">Valid 2 times</option>
<option value="3">Valid 5 times</option>
<option value="4">Valid 10 times</option>
<option value="7">Always Valid</option>
<option value="8">Valid for 12h</option>
<option value="9">Valid for 24h</option>
<option value="254">Disabled</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_7_1" type="integer" groupName="configuration" readOnly="true"
min="0" max="255">
<label>7: Door Lock Model Type</label>
<description><![CDATA[
Sends information if the model of the lock is 101 or 150<br /> <h1>Overview</h1><p>This configuration is only accepted by configuration get command</p> <p>It is a read only parameter. Default value depends on the door lock model type.</p> <p>101 = ID Lock 101</p> <p>150 = ID Lock 150</p>
]]></description>
<default>0</default>
<limitToOptions>false</limitToOptions>
</parameter>
<!-- ASSOCIATION DEFINITIONS -->
<parameter name="group_1" type="text" groupName="association" multiple="true">
<label>1: Lifeline</label>
<description><![CDATA[
<br /> <h1>Overview</h1><p>Notification Reports are sent out unsolicated to device included in the association group.</p>
]]></description>
<multipleLimit>5</multipleLimit>
</parameter>
<!-- STATIC DEFINITIONS -->
<parameter name="node_id" type="integer" min="1" max="232" readOnly="true" required="true">
<label>Node ID</label>
<advanced>true</advanced>
</parameter>
</config-description>
</thing-type>
</thing:thing-descriptions>

View File

@ -82,8 +82,7 @@ Q Sensor<br /> <h1>Overview</h1><ul><li>Quick and reliable motion alerts to Z-Wa
</parameter-group>
<!-- PARAMETER DEFINITIONS -->
<parameter name="config_12_1" type="integer" groupName="configuration"
min="0" max="8">
<parameter name="config_12_1" type="integer" groupName="configuration">
<label>12: Motion sensitivity</label>
<description><![CDATA[
Motion sensitivity<br /> <h1>Overview</h1><p>0 is disabled, 1 is low sensitivity, and 8 is high sensitivity.</p>
@ -92,6 +91,7 @@ Motion sensitivity<br /> <h1>Overview</h1><p>0 is disabled, 1 is low sensitivity
<options>
<option value="0">Disable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_13_2" type="integer" groupName="configuration"
@ -104,63 +104,79 @@ The delay in seconds before the sensor reports no motion<br /> <h1>Overview</h1>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_14_1" type="integer" groupName="configuration">
<parameter name="config_14_1" type="integer" groupName="configuration"
min="0" max="1">
<label>14: Basic Set reports</label>
<description>Enable/disable Basic Set reports on motion detection</description>
<description><![CDATA[
Enable/disable Basic Set reports on motion detection<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>1</default>
<options>
<option value="0">Disable</option>
<option value="1">Enable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_15_1" type="integer" groupName="configuration">
<parameter name="config_15_1" type="integer" groupName="configuration"
min="0" max="1">
<label>15: Basic Set report value on motion detection</label>
<description><![CDATA[
<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>0</default>
<options>
<option value="0">Motion 0xFF; No motion 0x00</option>
<option value="1">Motion 0x00; No motion 0xFF</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_16_1" type="integer" groupName="configuration">
<parameter name="config_16_1" type="integer" groupName="configuration"
min="0" max="1">
<label>16: Binary Sensor reports</label>
<description>Enabled/disable Binary Sensor reports on motion detection</description>
<description><![CDATA[
Enabled/disable Binary Sensor reports on motion detection<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>1</default>
<options>
<option value="0">Disable</option>
<option value="1">Enable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_18_1" type="integer" groupName="configuration">
<parameter name="config_18_1" type="integer" groupName="configuration"
min="0" max="2">
<label>18: Temperature scale</label>
<description><![CDATA[
<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>2</default>
<options>
<option value="0">Celcius</option>
<option value="2">Fahrenheit</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_19_1" type="integer" groupName="configuration">
<parameter name="config_19_1" type="integer" groupName="configuration"
min="0" max="1">
<label>19: LED motion indicator</label>
<description><![CDATA[
<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>1</default>
<options>
<option value="0">Disable</option>
<option value="1">Enable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_32_1" type="integer" groupName="configuration"
min="10" max="50">
<label>32: Low battery notification</label>
<description>The device will report low battery if below this level</description>
<description><![CDATA[
The device will report low battery if below this level<br /> <h1>Overview</h1><p><br /></p>
]]></description>
<default>10</default>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_172_2" type="integer" groupName="configuration"
@ -170,6 +186,7 @@ The delay in seconds before the sensor reports no motion<br /> <h1>Overview</h1>
The reporting frequency for battery, temperature, humidity, and light level<br /> <h1>Overview</h1><p>Set the reporting frequency for battery, temperature, humidity, and light level. This is the minimum interval in which the sensor will send updates to the hub even if the reporting threshold isn't met. The values correspond to the number of hours.</p> <p>Note: Frequent reports will affect battery life.</p>
]]></description>
<default>4</default>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_182_1" type="integer" groupName="configuration">
@ -198,10 +215,10 @@ The reporting frequency for battery, temperature, humidity, and light level<br /
Temperature reporting threshold<br /> <h1>Overview</h1><p>The sensor will report a new temperature value to the hub whenever temperature changes by the number of degrees entered as value.</p>
]]></description>
<default>1</default>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_184_1" type="integer" groupName="configuration"
min="0" max="80">
<parameter name="config_184_1" type="integer" groupName="configuration">
<label>184: Humidity reporting threshold</label>
<description><![CDATA[
Humidity reporting threshold<br /> <h1>Overview</h1><p>Set the reporting threshold for humidity. The sensor will report a new humidity value to the hub whenever humidity changes by the percentage number entered as value.</p>
@ -210,10 +227,10 @@ Humidity reporting threshold<br /> <h1>Overview</h1><p>Set the reporting thresho
<options>
<option value="0">Disable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<parameter name="config_185_2" type="integer" groupName="configuration"
min="0" max="30000">
<parameter name="config_185_2" type="integer" groupName="configuration">
<label>185: Lux reporting threshold</label>
<description><![CDATA[
Lux reporting threshold<br /> <h1>Overview</h1><p>Set the reporting threshold for lux. The sensor will report new lux to the hub whenever the brightness level changes by the number of lux entered as value.</p>
@ -222,6 +239,7 @@ Lux reporting threshold<br /> <h1>Overview</h1><p>Set the reporting threshold fo
<options>
<option value="0">Disable</option>
</options>
<limitToOptions>false</limitToOptions>
</parameter>
<!-- ASSOCIATION DEFINITIONS -->

19
installation/exim.md Normal file
View File

@ -0,0 +1,19 @@
## Mail Transfer Agent configuration
When you choose the "Mail Transfer Agent" install option in `openhabian-config` menu to install `exim4` as the mail transfer agent on your system, you will be presented with a number of questions on how to relay emails through a public service such as Google gmail.
In case you enter anything wrong you can re-initiate the installation process from the openHABian menu
Here's what you will need to enter:
* Mail server type: mail sent by smarthost (received via SMTP or fetchmail)
* System mail name: FQDN (your full hostname including the domain part)
* IPs that should be allowed by the server: 127.0.0.1; ::1; 192.168.xxx.yyy (replace with your hosts's IP)
* Other destinations for which mail is accepted: `<hostname> <hostname>.<domainname> <domainname>`
* Machines to relay mail for: Leave empty
* IP address or host name of the outgoing smarthost: `smtp.gmail.com::587`
* Hide local mail name in outgoing mail: No
* Keep number of DNS-queries minimal: No
* Delivery method: Select: Maildir format in home directory
* Split configuration into small files: Yes
* List of smarthost(s) to use your account for: `*`
* Mail username of the public service to relay all outgoing mail to:
Your username for the mail relay service to use such as `my_id@gmail.com`

View File

@ -0,0 +1,227 @@
---
layout: documentation
title: openHABian
source: https://github.com/openhab/openhabian/blob/master/docs/openhabian-DEBUG.md
---
<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->
This document is meant to give a guiding hand to users when their openHABian
install fails either on initial image installation or later on when running menu
options that install or configure optional components.
TL;DR:<br>
set `debugmode=maximum`in `/etc/openhabian.conf` and see `/boot/first-boot.log` for
image installation else record the terminal output.<br>
Do not ask for help on the forum unless you have FULLY read this guide.
**Attention:**
If you do not use the image but use `openhabian-config` manually - either to run
`openhabian-config unattended` or interactive use -, **there is no logfile**.
To record output in this case, you need to configure your terminal client to record
and save the command line output.
In PuTTy there's a field called 'Lines of scrollback' under the 'Window' option in
settings that you should increase to at least some thousand lines else you might not
capture everything you need to. Configure any other terminal client likewise.
Keep in mind that parts of the following information such as for example WiFi and
IPv6 setup don't apply to manually installed systems because they happen at or
before boot time.
## Prerequisites
First, please make sure you use the proper host hardware that is supported as
per [README](https://github.com/openhab/openhabian/blob/master/README.md).
openHABian requires a minimum of 1GB of RAM to run well. While you can get away
with a 512MB box like a RPi0W, you must not run anything other than openHAB
itself, in particular do **not** run memory hogs such as InfluxDB or Grafana.
openHABian requires you to provide direct Internet access. Using private IP
addresses is fine as long as your router properly provides NAT (Network Address
Translation) services.
Either Ethernet or WiFi is supported at install time, however, Ethernet tends to
be more reliable and WiFi requires user configuration prior to the first boot of
openHABian. To configure WiFi, simply edit the `wifi_psk=` and `wifi_ssid=`
fields in the `boot/openhabian.conf` file on your new SD card.
Your router (or a different device) needs to to provide properly configured DHCP
services so your openHABian box gets an IP address assigned when you boot it for
the first time.
The DHCP server also has to announce which DNS resolver to use so your box
knows how to translate DNS names into IP addresses.
It also needs to announce which IP address to use as the default gateway to the
internet - a typical access router is also the DHCP server will announce it's
own address here.
Finally, the DHCP server should also announce the NTP server(s) to use for
proper time services. Lack thereof will not break the installation procedure but
can lead to all sorts of long term issues so we recommend to setup DHCP to
announce a reachable and working NTP server.
A note on IPv6: openHABian was reported failing to boot in some environments
that make use of IPv6. If basic IP initialization fails (you cannot `ping`
your box) or installation gets stuck trying to download software packages, you
might want to try disabling IPv6. You can also do that before the very first
install attempt if you're sure you don't need any IPv6 connectivity on your
openHABian box. See [this section of openhabian.md](https://github.com/openhab/openhabian/blob/master/docs/openhabian.md#ipv6-notes)
how to disable IPv6 on your system.
Note that this is just a summary to cover the most commonly encountered cases.
The full boot procedure and how to obtain IP addresses, DNS resolver, default
route and NTP server addresses are highly complex and widely customizable and a
comprehensive description on how to properly configure your Internet access and
router are out of scope of openHABian. Please ask G\*\*gle how to accomplish that.
## Install
Proceed to installation: Etch-Burn-d(isk)d(ump)-Flash-whatever the image to an SD card.
NOW, read [openhabian.md](https://github.com/openhab/openhabian/blob/master/docs/openhabian.md#openhabianconf)
how to mount your SD card and how to modify the openHABian config file.
Some parameters are self-explanatory but please nonetheless read the full explanation
in the linked document.
Given that you're already reading the debug guide, the most important parameter
to set is likely `debugmode=maximum`.
Once you have passed the first time boot initialization phase and you can login
to the system, `/etc/openhabian.conf` will be used from there on. You can change
it at any time to get output on future boot runs or if you use `openhabian-config`
interactively.
_At this stage, read the first paragraph on the logfile and interactive use again._
To see debug output during the image installation process, you need to use the
procedure from your PC **before** you power your box on.
If you have a console available (monitor and keyboard), attach it to follow
the install process. Now insert the SD card and turn on your system.
If you don't have any console, try to access the web console at
`http://<yourhostip>:80/`.
It will display the contents of `/boot/first-log.boot` at intervals of some seconds
while installing.
Mind you that if installation fails, network access may or may not be possible
so you might need to access the box via console anyway in order to find out what
went wrong.
Login to your box via network using `ssh openhabian@<hostname>`.
The default hostname is `openhabiandevice`, and the default username and password
both are `openhabian` unless you changed either of these in `openhabian.conf`
before you started the installation run.
If that step fails, try to `ping openhabiandevice`. If that's failing, find out
the system's IP address (usually by looking at your router's running configuration
or using the command `arp -a` which is available on either Windows or Linux.
If you can login, there probably is an issue with your DHCP server.
If you cannot ping the system's IP address, try to login on the console.
In this case you will have to resort to debug the network setup which is beyond
the scope of this document. There's nothing specific about networking though -
openHABian just uses the setup of the underlying OS, Raspi OS for RPis that is or
whatever OS you chose to manually install upon. So again go ask G\*\*gle for help
Once logged in, enter `sudo bash` to become the root user.
Check if your install fails at some stage (also if it seems to hang forever):
there will exist a file either `/opt/openHABian-install-failed` or
`/opt/openHABian-install-inprogress` to reflect these states (to check,
`ls -l /opt/openHABian-install*`).
As a first troubleshooting step, you should reboot your box to see if the same
problems occurs on a second attempt.
## Debug
If the problem persists after booting succeeded at least in principle, login and
check `/boot/first-boot.log` to get an indication what went wrong in the install
process. You can avoid openHABian to start reinstalling on future reboots by
removing the status file, i.e. `rm -f /opt/openHABian-install*`, **but** be aware
that your installation is incomplete and that you should not run openHAB on a box
in that state.
You can use this state to debug, you can also use the menu options in
`openhabian-config` to manually install everything that failed or is missing.
See `/opt/openhabian/openhabian-setup.sh` and the corresponding code in
`/opt/openhabian/functions/*.bash` what usually gets installed on an unattended
installation. Note that if you keep or recreate the status file (just `touch
/opt/openhabian-install-failed`), you can reboot at any time to continue
unattended installation. So if say Java install fails (Java being a prerequisite
to installation of openHAB), you can use `openhabian-config` or manual install,
then continue installation by rebooting.
Should you succeed at some point in time - great! Let us know what you did to
make it work please through a Github issue (see below).
As we cannot be sure everything on your box is 100% the same what an
unattended install gets you, please also do a complete reinstall before you
start operating openHAB. If possible start with the flash step. If that does
not work, at least delete all the packages that openhabian-setup had installed
before you reboot. Use `apt purge` (and not just `apt remove`).
### Create a debug log
You can put openHABian into a more verbose debug level **at any time** after
the very first installation run: edit the config file `/etc/openhabian.conf`
using the editor of your choice (use `nano` if you have no idea) and change
the `debugmode` parameter to either `on` or `maximum` right away (default
is `off`). If it's missing there, just add it.
Specifying `maximum` is usually your best choice as it will have
`openhabian-config` show every single command it executes so you might spot
the problem right away. If you open an issue, always provide the maintainers
with a logfile at `maximum` detail level.
Your next boot run will also exhibit much more verbose logging. Remember boot
time output will be appended to `/boot/first-boot.log`.
If installation still fails to finish, please retrieve that file from your box,
open a GitHub issue (see next paragraph), thoroughly describe the environment
conditions and your findings so far and upload the log.
### How to open a Github issue
While written for openHAB, the guideline at <https://community.openhab.org/t/how-to-file-an-issue/68464>
also applies to openHABian issues.
Please proceed as told there. openHABian has its own repository at <https://github.com/openhab/openhabian>.
Search the issues listed there first if 'your' problem has already been seen and
eventually opened as an issue by someone else (you should remove the `is:open` filter from the search
bar to let you see closed issues). If so, you may leave a "me too"
comment there but please do not open another issue to avoid duplicates.
You can reference other issues (eventually also request to reopen closed ones)
and Pull Requests by their number (just type #XXX along with your text,
GitHub will insert the proper link).
If you open an issue, we kindly ask you to deliver as much information as
possible. It is awkward and annoying if we need to spend time asking and asking
what the real problem is about. Please avoid that situation, be proactive and
tell us in the first place.
Once you opened the issue, copy `/boot/first-boot.log` from your openHABian box
over to your desktop and upload it to GitHub.
If you succeed logging on and get to see a banner with system information,
please also copy that as part of your issue.
If you're able to help in producing a fix to problems, we happily take any
Pull Request.
Explaining git and Github unfortunately is out of our scope (Google is your
friend).
See the guidelines outlined in [CONTRIBUTING.md](https://github.com/openhab/openhabian/blob/master/CONTRIBUTING.md)
as well.
For simple fixes to a single file only, you can click through the source
starting at <https://github.com/openhab/openhabian> and edit the file online,
GitHub will then offer to create the PR.
You can also clone the openHABian repository, make your changes locally and use
git to check in your changes and upload them to a repo copy of yours, then
follow the git-offered link to create the PR.
## Checkpoint
Remember to always let `openhabian-config` update itself on start.
If you want to change anything to work around some not yet fixed bug, you can
directly edit the files in and below `/opt/openhabian` on your box. Just do not
let `openhabian-config` update itself on start as that would overwrite your
changes.
You can also clone (download) a different openHABian version than the most
current one, e.g. if a maintainer or contributor to openHABian offers or asks
you to test-drive a development version. Set the `clonebranch` parameter in
`/etc/openhabian.conf` to the branch name to load, then update `openhabian-config`
on start.
**Note**: You must not modify `repositoryurl` to point elsewhere than the
official repo. openHABian will only ever update from there so you can only
test drive a test branch that a developer has provided you on the official site.
The main program is in `openhabian-setup.sh`.
If the initial unattended install fails again and again at the same step (say
Java installation), you may try to comment that step out. But mind the code in
`build-image/first-boot.bash` towards the end starting with `git clone`.
This is where openHABian updates itself. If you don't comment that out as well,
it'll overwrite your changes on the next install run.
## Disclaimer
For obvious reasons, changing openHABian code is not a supported procedure.
We just want to give you a hint what you _could_ try doing if your install fails
and you're sitting there, desperately looking for a fix.
Google and learn for yourself how to edit a file, learn to understand shell
programming basics, you're on your own here.
If you change openHABian code on your box, remember for the time it takes to get
openHABian officially fixed, you must not let `openhabian-config` update itself
on start as that would overwrite your changes.

View File

@ -0,0 +1,620 @@
# How to backup your openHABian server using Amanda
# Intro
## The need for recovery
First, make yourself aware how important a comprehensive backup and recovery concept is.
Yes, this text is the README on the backup software part for openHABian that you're reading, but take a couple of minutes to
read and think about recovery in a generic sense first. This might avoid a LOT of frustration.
So you have your smart home working thanks to openHAB(ian).... but what if a component of your system fails ?
First thing is: you need spare hardware of EVERY component that needs to work for your smart home to work.
Think of EVERY relevant component and not just the obvious ones. Think of your Internet router, switch, server, NAS and required
addons such as a ZWave or 433MHz radio or WiFi USB stick, proper power supplies and the SD card writer.
Now think of a recovery concept for each of these components: what do you have to do if it fails ?
If the SD card in your Pi fails because of SD corruption (a very common problem), you need to have a PREinstalled, at least
somewhat current clone SD card to contain all your current OS packages, including all helper programs you might be using (such
as say mosquitto or any scripts you might have installed yourself), and your matching CURRENT openHAB config, and more.
If you believe "in case of SD card crash, I'll simply reinstall my server from scratch", then think first!
How long will that take you? Are you even capable of doing that ? Will the latest version of openHABian/Linux packages be
guaranteed to work with each other and with your hardware ?
Do you REALLY remember all the parts and places of your system where you configured something related to your server/home
network and smart home ? If you're honest to yourself, the answer will often be "NO".
Yes, you can get your smart home back up working somehow, but it will take several hours, and it will not be a complete
restoration of all features and setups you used to have in operation before the crash.
**A specific word of WARNING:**
If you run a ZWave network like many openHAB users do, think what you need to do if the controller breaks and you need to
replace it. A new controller has a different Home ID, so all of your devices will not talk to it unless you re-include all of them (and
to physically access devices in quite a number of cases means you need to open your walls !!) And even if you have easy access,
it can take many hours, even more so if it's dark and your ... no I'm NOT joking, and I'm not overdoing things.
This is what happened to several people, and it can happen to you, too. We have seen people be so frustrated that they gave up
on openHAB or smart home altogether because of this.
For RaZberry/zwave.me USB stick, you can run the Z-Way software to backup and restore the ZWave network data including the
controller. For the Aeon Gen5 stick, there's a Windows tool available for download.
NOTE: you will face the same type of problem if you run a gateway unit to control commercial systems such as a HomeMatic CCU or Insteon
controller.
Remember Murphy's law: When your system fails and you need to restore your system for the first time, you'll notice your backup
is broken. So dive into and ensure you have a working restore procedure and don't just believe it'll work BUT TEST IT, and
repeat every now and then.
### SD card issues
The most common setup for a openHAB smart home server is to run a Raspberry Pi off its internal SD card, so we provide a backup
concept for that one. But it will also work on most other SBCs (single board computers) and modified configurations (such as if
you moved your OS or parts thereof).
Pay special attention to SD card size: different models slightly differ in size. Any replacement gear must have *at least*
the size of the original card so best is to get two identical cards right in the first place. If you don't, ensure at least
you use the smaller one as your main and the larger one as the replacement card.
**Another word of WARNING:**
To move your system off the internal SD card does NOT solve SD corruption problems or increase reliability in any other way.
SD cards and USB sticks use the same technology. And SSDs and HDDs still can get corrupted as well, and they can crash, too.
You may or may not want to use Internet / cloud services for various reasons (privacy, bandwidth, cost), so we provide
you with one solution that is designed to run on local hardware only. We provide a config to use a directory as the backup
destination. This can be a directory mounted from your NAS (if you have one), a USB-attached storage stick, hard drive, or other
device. We also provide a config to store your most important data on Amazon Web Services if you are not afraid of that.
We believe this will cover most openHAB backup use cases.
NOTE: don't use CIFS (Windows sharing). If you have a NAS, use NFS instead. It does not work with CIFS because of issues with symlinks,
and it doesn't make sense to use a Windows protocol to share a disk from a UNIX server (all NAS) to a UNIX client (openHABian) at all.
If you don't have a NAS, DON'T use your Windows box as the storage server. Attach a USB stick to your Pi instead for storage.
There's many more possible configurations, the software is very flexible and you can tailor it to your own needs if those offers
do not match your needs. You could even use it to backup all of your servers (if any) and desktop PCs, including Windows
machines. Either way, it's not one-or-the-other, you can run multiple configs in parallel.
But in any case, you will need to have a clone SD card with your CURRENT config.
Now all that being said, let's turn to what what you're here for: how to accomplish the software side of backup and restoration.
## Some Amanda background
Best is to read up on and understand some of the basic Amanda concepts over at <http://www.amanda.org>.
That's not a mandatory step but it will probably help you understand a couple of things better.
The world of UNIX and backup IS complex and in the end, there's no way to fully hide that from a user.
Here's a couple of those concepts, but this is not a comprehensive list. I cannot understand the system for you,
that's something you have to accomplish on your own. Read and understand the Amanda docs.
* It's helpful to know that Amanda was originally built to use magnetic tape changer libraries as backup storage in professional
data center installations. It can operate multiple tape drives in parallel, and the tapes used to be commonly stored in what's
called a 'slot' inside the tape library cabinet.
* The default dumpcycle for an openHABian installation is 2 weeks. Amanda will run a 'level 0' dump (that means to backup EVERYTHING)
once in a dumpcycle and will run 'level 1' dumps for the rest of the time (that means to only backup files that have CHANGED
since the last level 0 dump was done, also called an 'incremental' backup).
Amanda will combine level 0 of some devices with level 1 or 2 of others, aiming to have the more or less same amount of data
to be backed up every day (every invocation, actually). No, you cannot have it do level 0 on weekends and level 1 else,
[see FAQ](https://wiki.zmanda.com/index.php/FAQ:How_do_I_make_Amanda_do_full_backups_on_weekends_and_incrementals_during_the_week%3F).
* Note for *raw* devices to backup such as `/dev/mmcblk0` (which is the internal SD card reader of a RPi), nothing but a level 0
dump will work because there is no efficient way to determine what has been changed since the last full dump.
So if you include `/dev/mmcblk0` in your disklist, it'll be backed up on EACH run. If you don't want that (as it'll likely consume
the by far largest part of your backup run time and capacity) then remove it from the disklist. You can create a second Amanda
configuration to only include that raw device and run it say just once every month. Essentially you need to create a copy of the
/etc/amanda.conf/openhab-dir directory and contents, but a full explanation is out of scope for these docs.
* Typically, for a backup system to use this methodology, you need the amount of storage to be 2-3 times as large as the amount
of data to be backed up. The number of tapes and their capacity (both of which are sort of artificially set when you store to a
filesystem) determines how long your storage capacity will last until Amanda starts to overwrite old backups.
By asking you to enter the total size of the storage area, the Amanda installation routine will compute the maximum amount of
data that Amanda will store into each tape subdirectory as (storage size) divided by (number of tapes, 15 by default).
The ability to backup to a directory was added later, but the 'slot', 'drive' and 'tape' concepts were kept. That's why here,
as a deployment inside openHABian, we will have 'virtual' tapes and slots which are implemented as subdirectories (one for each
'tape') and filesystem links (two by default config, drive0 and drive1) to point to a virtual tape.
If you have the drive1 link point to the slot3 directory, it effectively means that tape 3 is currently inserted in drive 1).
* Amanda was built on top of UNIX and makes use of its user and rights system, so it is very useful and you are requested to
familiarize yourself with that. As a general good UNIX practice, you shouldnt use functional users such as “backup” (the OS
uses functional users to execute tasks with specific access rights) for administration tasks. Use your personal user instead
(that you have created that at the beginning of your openHABian installation or "openhabian" by default).
Installation tasks including post-package-installation changes (edits) of the Amanda config files, require to use the `root`
user. Any ordinary user (such as your personal one) can execute commands on behalf of root (and with root permission) by
prepending "sudo " to the command. As yourself, prepend "sudo -u backup" to execute the following command as the "backup" user.
# Installation
These notes were written for an interactive installation run. Note openHABian comes with the new ["auto backup" feature](https://github.com/openhab/openhabian/blob/master/docs/openhabian.md#auto-backup).
It'll essentially mirror your internal SD card to another (bigger) card in an external card reader and uses the remaining space as your Amanda storage area. We highly recommend you to make use of this feature on initial openHABian installation, but you can also setup Amanda later on as well.
## Storage preparation
Now once you read up on all of this and feel you have understood this stuff, the next step will be to prepare your storage.
***
HEADS UP: You need to provide your storage BEFORE you install Amanda.
***
That is, you have to mount the USB stick or disk from your NAS to a directory that is LOCAL to your openHABian box.
Specifically for Windows users: if you are not familiar with the UNIX filesystem concept and what it means 'to mount' storage,
read up on it NOW. Various tutorial can be found on the net such as <https://linoxide.com/linux-how-to/how-to-mount-drive-in-linux> .
Google is your friend, but make sure you ask specific questions such as “how to mount a NAS disk on a Raspberry Pi” to match your use case.
So NOW, prepare your storage by creating a directory somewhere and by then mounting the USB device or disk you've previously
exported (= shared, i.e. made available for mounting) on that directory. This is your mountpoint.
*For Windows fans: Let's be clear here. This only works if client AND server side are UNIX machines. And it only works to use NFS.
If you want to use Windows sharing (CIFS), you can try to use the `nounix` mount option in /etc/fstab of your openHAB machine,
but this is known to not work in various cases and to cause trouble. You are COMPLETELY on your own here. Using CIFS is NOT SUPPORTED.
Let alone it also does not make sense as NFS can do the same but any Windows machine will not run 24x7 as a RPi or NAS will do.*
Another specific thing to watch out for when configuring your export share on the NFS server is to add the `no_root_squash`
option (that's the name on a generic Linux box, depending on your server OS or UI it might have a different name but it'll be
available, too).
Its function is to NOT map accesses of userID 0 (root) to some other UID as your server will do by default.
Here's examples how to mount a NAS (to have the DNS name "nas" and IP address 192.168.1.100) and two partitions from an attached
USB stick identified as `/dev/sda8` (Linux ext4) and `/dev/sda1` and Windows vfat(FAT-32) filesystems.
HEADS UP: These are just EXAMPLES. Device and directory names will be different on your system.
Do not deploy these commands unless you are fully aware what they will do to your system, using a command with a wrong device
name can destroy your system.
### NAS mount example
```
----- EXAMPLE ONLY ----- Don't use unless you understand what these commands do ! ----- EXAMPLE ONLY -----
pi@pi:~ $ sudo bash
root@pi:/home/pi# host nas
nas.fritz.box has address 192.168.1.100
root@pi:/home/pi#
root@pi:/home/pi# mkdir -p /storage/server
root@pi:/home/pi# echo "192.168.1.100://share/freespace /storage/server nfs nolock,noatime 0 0" >> /etc/fstab
root@pi:/home/pi# mount /storage/server
root@pi:/home/pi# df -k /server
Filesystem 1K-blocks Used Available Use% Mounted on
192.168.1.100://share/freespace 2882740768 2502091488 380649280 87% /storage/server
root@pi:/home/pi#
----- EXAMPLE ONLY ----- Don't use unless you understand what these commands do ! ----- EXAMPLE ONLY -----
```
### USB storage mount example
Note that this is showing two alternative versions, for FAT16/FAT32 filesystems (i.e. the original MS-DOS and the improved
Windows filesystems that you usually use for USB sticks) and another version to use the ext4 native Linux filesystem. You can
use ext4 on a stick or USB-attached hard drive.
Either way, you just need one or the other.
```
----- EXAMPLE ONLY ----- Don't use unless you understand what these commands do ! ----- EXAMPLE ONLY -----
root@pi:/home/pi# fdisk -l /dev/sda
Disk /dev/sda: 14,8 GiB, 15836643328 bytes, 30930944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel : dos
Disk identifier: 0x000210ce
Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 2357421 2349230 1,1G e W95 FAT16 (LBA)
/dev/sda2 2357422 31116287 28758866 13,7G 85 Linux extended
/dev/sda5 2359296 2424829 65534 32M 83 Linux
/dev/sda6 2424832 2553855 129024 63M c W95 FAT32 (LBA)
/dev/sda7 2555904 30056445 27500542 13,1G 83 Linux
/dev/sda8 30056448 31105023 1048576 512M 83 Linux
root@pi:/# mke2fs -t ext4 /dev/sda8
mke2fs 1.43.3 (04-Sep-2016)
/dev/sda8 contains a ext4 file system
created on Sun Oct 29 00:17:48 2017
Proceed anyway? (y,n) y
Creating filesystem with 437248 1k blocks and 109728 inodes
Filesystem UUID: edb36b80-f363-434c-a50e-ca4a81a6bb7d
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
root@pi:/# mkexfatfs /dev/sda1
mkexfatfs 1.1.0
Creating... done.
Flushing... done.
File system created successfully.
root@pi:/#
root@pi:/home/pi# mkdir -p /storage/usbstick-linux /storage/usbstick-msdos
root@pi:/home/pi# echo "/dev/sda8 /storage/usbstick-linux ext4 defaults,noatime 0 1" >> /etc/fstab
root@pi:/home/pi# echo "/dev/sda1 /storage/usbstick-msdos vfat noatime,noauto,user,uid=backup 0 1" >> /etc/fstab
root@pi:/home/pi# mount /storage/usbstick-linux
root@pi:/home/pi# mount /storage/usbstick-msdos
root@pi:/home/pi# df -k /storage/usbstick-linux /storage/usbstick-msdos
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda8 13403236 8204144 4495196 65% /storage/usbstick-linux
/dev/sda1 13403236 9018464 3680876 72% /storage/usbstick-msdos
root@pi:/home/pi#
----- EXAMPLE ONLY ----- Don't use unless you understand what these commands do ! ----- EXAMPLE ONLY -----
```
## Software installation
First, mount/prepare your storage (see examples).
Next, double check that your `backup` user has write access to all of the storage area (preferrably, he `owns` the directory):
*Create* a file there (`touch /path/to/storage/file`), check its ownership (`ls -l /path/to/storage/file`), then delete it
(`rm /path/to/storage/file`).
If that does not work as expected (to produce a file that is owned by the `backup` user), you need to change export options
on your NAS/NFS server. See also [paragraph on `no_root_squash`](#storage-preparation) above.
Now finally, install Amanda using the openHABian menu.
When you start the Amanda installation from the openHABian menu, the install routine will create a directory/link structure in
the directory you tell it. Your local user named "backup" will need to have write access there. Amanda install routine should do
that for you, but it only CAN do it for you if you created/mounted it before you ran the installation.
Installation will ask you a couple of questions.
* "What's the directory to store backups into?"
Here you need to enter the *local* directory of your openHABian box, also known as *the mount point*. This is where you have
mounted your USB storage or NAS disk share (which in above example for the NAS is `/storage/server` and for the usb stick is
either `/storage/usbstick-linux` or `/storage/usbstick-msdos`).
* "How much storage do you want to dedicate to your backup in megabytes ? Recommendation: 2-3 times the amount of data to be
backed up. Enter a number to consist of figures only."
Amanda will use at most this number of megabytes in total as its storage for backup.
If you choose to include the raw device in the backup cycle (next question), that means you should enter 3 times the size of
your SD disk NOW. If you choose not to include it (or selected the AWS S3 variant which omits raw SD backups per default), it's
a lot less data and you need to estimate it by adding up the size of the config directories that are listed in the `disklist`
file. If you don't have any idea and chose to NOT backup your SD card, enter 1024 (= 1 GByte). If you chose to backup it, the number
should be larger than the SD capacity in megabytes plus 1024.
You can change it in the Amanda config file at any later time (the entry below the line reading `define tapetype DIRECTORY {`).
* "Backup raw SD card ?" (not asked if you selected AWS S3 storage)
Answer "yes" if you want to create raw disk backups of your SD card. This is only recommended if your SD card is 8GB or less in
size, otherwise the backup can take too long. You can always add/remove this by editing `${confdir}/disklist` at a later time.
All of your input will be used to create the initial Amanda config files, but you are free to change them later on.
HEADS UP: if you re-run the install routine, it will OVERWRITE the config files at any time so if you make changes there,
remember these changes and store them elsewhere, too.
Once you're done installing openHABian and Amanda, proceed to the usage guide chapter below.
Finally, another HEADS UP: The first thing you should do after your first backup run ended successfully is to create a clone of
your active server SD card by restoring the backup to a blank SD card as shown below as an `amfetchdump` example for recovery of a
raw device's contents. `/dev/mmcblk0` is the Pi's internal SD reader device, and from an Amanda perspective, this is a raw
device to be backed up to have that same name.
You will have two Amanda config directories (located in `/etc/amanda`) called `openhab-dir` and `openhab-AWS` if you choose to
setup both of them.
If any of your Amanda backup or recovery runs fail (particularly if you try to use the S3 backup), you should try getting it
to work following the guides and knowledge base available on the web at <http://www.amanda.org/>.
There's online documentation including tutorials and FAQs at <http://wiki.zmanda.com/index.php/User_documentation>.
In case you come across inherent problems or improvements, please let us (openHABian authors) know through a GitHub issue, but
please don't expect us to guide you through Amanda, which is a rather complex system, and we're basically just users only, too.
# Operating Amanda - a (yes, very brief) usage guide
The overall config is to be found in `/etc/amanda/openhab-<config>/amanda.conf`.
You are free to change this file, but doing so is at your own risk.
You can specify files, directories and raw devices (such as HDD partitions or SD cards) that you want to be backed up in
`/etc/amanda/openhab-<config>/disklist`. You are free to add more lines here to have Amanda also take backup of other
directories of yours.
Note: the raw SD card backup was left out for the AWS S3 config, as that would require a lot of bandwidth and runtime.
openHABian setup routine will create systemd timers in `/etc/systemd/system/` to start all backups you select every night at around 01:00AM.
## Backup
Find below a terminal session log of a manually started backup run.
It's showing the three most important commands to use. They all can be started as user *backup* only, interactively, via systemd.timer or cron,
and you always need to specify the config to use. You can have multiple backup configs in parallel use.
The `amcheck` command is meant to remind you to put in the right removeable storage medium such as a tape or SD card,
but for the AWS and local/NAS-mounted directory based backup configs, we don't have removable media. So don't get confused,
`amcheck` is not a required step.
The `amdump` command will start the backup run itself.
The result will be mailed to you (once your mail system was setup - see openHABian menu option 2C).
You can run `amreport [-l=logfile] <config>` at any time to see a report on the last backup run for that config.
Use -l with a filename of /var/log/amanda/<config>/log* to get reports of past dumps.
**Reminder:** you have to be logged in or use `sudo -u backup` to execute commands as the `backup` user. To accomplish that, you can also login as your ordinary user and
use the `sudo` (execute commands with superuser privileges) and `su` (switch user) commands as shown below.
```
pi@pi:/etc/amanda/openhab-dir $ sudo su - backup
backup@pi:~$
backup@pi:~$ amcheck openhab-dir
Amanda Tape Server Host Check
-----------------------------
slot 3: contains an empty volume
Will write label 'openhab-openhab-dir-001' to new volume in slot 3.
NOTE: skipping tape-writable test
NOTE: host info dir /var/lib/amanda/openhab-dir/curinfo/pi does not exist
NOTE: it will be created on the next run.
NOTE: index dir /var/lib/amanda/openhab-dir/index/pi does not exist
NOTE: it will be created on the next run.
Server check took 2.218 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 5.705 seconds. 0 problems found.
(brought to you by Amanda 3.3.6)
backup@pi:~$ amreport openhab-dir
nothing to report on!
backup@pi:~$ amdump openhab-dir
backup@pi:~$ amreport openhab-dir
Hostname: pi
Org : openHABian openhab-dir
Config : openhab-dir
Date : März 30, 2017
These dumps were to tape openhab-openhab-dir-001.
The next tape Amanda expects to use is: 1 new tape.
STATISTICS:
Total Full Incr. Level:#
-------- -------- -------- --------
Estimate Time (hrs:min) 0:12
Run Time (hrs:min) 1:31
Dump Time (hrs:min) 1:19 1:19 0:00
Output Size (meg) 7951.1 7951.1 0.0
Original Size (meg) 15581.6 15581.6 0.0
Avg Compressed Size (%) 51.0 51.0 --
DLEs Dumped 4 4 0
Avg Dump Rate (k/s) 1723.1 1723.1 --
Tape Time (hrs:min) 1:19 1:19 0:00
Tape Size (meg) 7951.1 7951.1 0.0
Tape Used (%) 8.0 8.0 0.0
DLEs Taped 4 4 0
Parts Taped 4 4 0
Avg Tp Write Rate (k/s) 1722.4 1722.4 --
USAGE BY TAPE:
Label Time Size % DLEs Parts
openhab-openhab-dir-001 1:19 8141884k 8.0 4 4
NOTES:
planner: Adding new disk pi:/dev/mmcblk0.
planner: Adding new disk pi:/etc/openhab2.
planner: Adding new disk pi:/var/lib/openhab2/persistence.
planner: Adding new disk pi:/var/lib/openhab2/zwave.
planner: WARNING: no history available for pi:/var/lib/openhab2/zwave; guessing that size will be 1000000 KB
planner: WARNING: no history available for pi:/var/lib/openhab2/persistence; guessing that size will be 1000000 KB
planner: WARNING: no history available for pi:/etc/openhab2; guessing that size will be 1000000 KB
taper: Slot 3 without label can be labeled
taper: tape openhab-openhab-dir-001 kb 8141884 fm 4 [OK]
big estimate: pi /etc/openhab2 0
est: 1000032k out 259820k
big estimate: pi /var/lib/openhab2/persistence 0
est: 1000032k out 48720k
big estimate: pi /var/lib/openhab2/zwave 0
est: 1000032k out 1370k
DUMP SUMMARY:
DUMPER STATS TAPER STATS
HOSTNAME DISK L ORIG-kB OUT-kB COMP% MMM:SS KB/s MMM:SS KB/s
-------------------------------------------- ----------------------- -------------- -------------
pi /dev/mmcblk0 0 15645696 7831974 50.1 78:01 1673.2 77:59 1673.9
pi /etc/openhab2 0 259820 259820 -- 0:32 8077.0 0:34 7641.8
pi /var/lib/openhab2/persistence 0 48720 48720 -- 0:11 4501.6 0:13 3747.7
pi /var/lib/openhab2/zwave 0 1370 1370 -- 0:01 1156.1 0:01 1370.0
(brought to you by Amanda version 3.3.6)
```
## Restore
### Locating a backup
Depending on the type of storage medium, you eventually may need to locate which volume a wanted backup is stored on.
You can use the `amadmin` and eventually `amtape` commands to do this:
```
[14:24:16] backup@openhabianpi:~$ amadmin openhab-dir find openhabianpi /dev/mmcblk0 /var/lib/openhab2
date host disk lv storage pool tape or file file part status
2019-12-06 01:00:02 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-005 5 1/1 OK
2019-12-07 01:00:02 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-008 5 1/1 OK
2019-12-08 01:00:02 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-009 5 1/1 OK
2019-12-09 01:00:03 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-010 5 1/1 OK
2019-12-10 01:00:06 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-011 5 1/1 OK
2019-12-11 01:00:03 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-012 5 1/1 OK
2019-12-12 01:00:04 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-013 5 1/1 OK
2019-12-13 01:00:04 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-014 5 1/1 OK
2019-12-14 01:00:03 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-015 5 1/1 OK
2019-12-15 01:00:06 openhabianpi /dev/mmcblk0 0 0 -1/-1 FAILED (planner) "[/usr/lib/amanda/application/amraw terminated with signal 15: see /var/log/amanda/client/openhab-dir/sendsize.20191215010011.debug]"
2019-12-16 01:00:03 openhabianpi /dev/mmcblk0 0 0 -1/-1 FAILED (planner) "[missing result for /dev/mmcblk0 in openhabianpi response]"
2019-12-17 01:00:03 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-018 5 1/1 OK
2019-12-18 01:00:02 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-019 5 1/1 OK
2019-12-19 01:00:02 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-006 5 1/1 OK
2019-12-30 01:00:03 openhabianpi /dev/mmcblk0 0 openhab-dir openhab-dir openhab-dir-007 5 1/1 OK
2019-12-06 01:00:02 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-005 1 1/1 OK
2019-12-07 01:00:02 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-008 1 1/1 OK
2019-12-08 01:00:02 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-009 1 1/1 OK
2019-12-09 01:00:03 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-010 1 1/1 OK
2019-12-10 01:00:06 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-011 1 1/1 OK
2019-12-11 01:00:03 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-012 1 1/1 OK
2019-12-12 01:00:04 openhabianpi /var/lib/openhab2 1 openhab-dir openhab-dir openhab-dir-013 2 1/1 OK
2019-12-13 01:00:04 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-014 1 1/1 OK
2019-12-14 01:00:03 openhabianpi /var/lib/openhab2 1 openhab-dir openhab-dir openhab-dir-015 2 1/1 OK
2019-12-15 01:00:06 openhabianpi /var/lib/openhab2 1 openhab-dir openhab-dir openhab-dir-016 2 1/1 OK
2019-12-17 01:00:03 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-018 1 1/1 OK
2019-12-18 01:00:02 openhabianpi /var/lib/openhab2 1 openhab-dir openhab-dir openhab-dir-019 1 1/1 OK
2019-12-19 01:00:02 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-006 1 1/1 OK
2019-12-30 01:00:03 openhabianpi /var/lib/openhab2 0 openhab-dir openhab-dir openhab-dir-007 1 1/1 OK
```
`amtape` can show which volume is in which slot:
```
[13:59:15] backup@openhabianpi:~$ amtape openhab-dir show
scanning all 15 slots in changer:
slot 1: date 20191215010006 label openhab-dir-016
slot 2: date 20191216010003 label openhab-dir-017
slot 3: date 20191217010003 label openhab-dir-018
slot 4: date 20191218010002 label openhab-dir-019
slot 5: in use
slot 6: date 20191219010002 label openhab-dir-006
slot 7: date 20191230010003 label openhab-dir-007
slot 8: date 20191207010002 label openhab-dir-008
slot 9: date 20191208010002 label openhab-dir-009
slot 10: date 20191209010003 label openhab-dir-010
slot 11: date 20191210010006 label openhab-dir-011
slot 12: date 20191211010003 label openhab-dir-012
slot 13: date 20191212010004 label openhab-dir-013
slot 14: date 20191213010004 label openhab-dir-014
slot 15: date 20191214010003 label openhab-dir-015
```
### Restoring a file
To restore a file, you need to use the `amrecover` command as the `root` user.
Note that since Amanda is designed to restore ANY file of the system, you are required to run `amrecover` as the root user to
have the appropriate file access rights everywhere (neither the `backup` nor your personal user are allowed to write everywhere).
Remember in openHABian you can _execute_ commands as root using `sudo <command>`.
`amrecover` sort of provides a shell-like interface to allow for navigating through the stored files.
Here's another terminal session log to show how a couple of files are restored into a target directory `/server/temp`.
```
pi@pi:/etc/amanda/openhab-dir $ sudo bash
root@pi:/etc/amanda/openhab-dir# amrecover openhab-dir
AMRECOVER Version 3.3.6. Contacting server on localhost ...
220 pi AMANDA index server (3.3.6) ready.
Setting restore date to today (2017-03-30)
200 Working date set to 2017-03-30.
200 Config set to openhab-dir.
200 Dump host set to pi.
Use the setdisk command to choose dump disk to recover
amrecover> listdisk
200- List of disk for host pi
201- /dev/mmcblk0
201- /etc/openhab
201- /var/lib/openhab/persistence
201- /var/lib/openhab/zwave
200 List of disk for host pi
amrecover> setdisk /etc/openhab
200 Disk set to /etc/openhab.
amrecover> ls
2017-03-30-13-25-29 quartz.properties
2017-03-30-13-25-29 login.conf
2017-03-30-13-25-29 logback_debug.xml
2017-03-30-13-25-29 logback.xml
2017-03-30-13-25-29 jetty/
2017-03-30-13-25-29 configurations/
2017-03-30-13-25-29 .
amrecover> add quartz.properties
Added file /quartz.properties
amrecover> add logb*
Added file /logback_debug.xml
Added file /logback.xml
amrecover> lcd /server/temp
amrecover> pwd
/etc/openhab
amrecover> lpwd
/server/temp
amrecover> extract
Extracting files using tape drive changer on host localhost.
The following tapes are needed: openhab-openhab-dir-001
Extracting files using tape drive changer on host localhost.
Load tape openhab-openhab-dir-001 now
Continue [?/Y/n/s/d]? Y
Restoring files into directory /server/temp
All existing files in /server/temp can be deleted
Continue [?/Y/n]? Y
./logback.xml
./logback_debug.xml
./quartz.properties
amrecover>quit
root@pi:/etc/amanda/openhab-dir# cd /server/temp
root@pi:/server/temp# ls -l
insgesamt 12
-rw-rw-r-- 1 openhab openhab 2515 Feb 19 2016 logback_debug.xml
-rw-rw-r-- 1 openhab openhab 3573 Mär 30 06:45 logback.xml
-rw-r--r-- 1 openhab openhab 302 Feb 3 2016 quartz.properties
root@pi:/server/temp#
```
### Restoring a partition
To restore a raw disk partition, you need to use `amfetchdump` command. Unlike `amdump`, you have to run amfetchdump as user backup, though.
Heres another terminal session log to use `amfetchdump` to first retrieve the backup image from your backup storage to image called
`openhabianpi-image` on `/server/temp/`
**Reminder:** you have to be logged in as the `backup` user.
```
backup@pi:/server/temp$ amfetchdump -p openhab-dir openhabianpi /dev/mmcblk0 20191218010002 > /server/temp/openhabianpi-image
1 volume(s) needed for restoration
The following volumes are needed: openhab-openhab-dir-001
Press enter when ready
```
Remember to specify the date. If you don't, Amanda will restore ALL available dumps. That likely is not what you want.
When the partition(s) you specify to restore are stored across multiple (virtual) tapes, Amanda will eventually ask you to mount
a specific volume (put a virtual tape into a virtual tape drive).
Be prepared and have another terminal window open as the backup user.
Use `amadmin` (see above) to find out where a specific backup is located.
When in need, you can instruct Amanda to load a specific volume like this:
```
backup@pi:/server/temp$ amtape openhab-dir slot 1
slot 1: time 20170322084708 label openhab-openhab-dir-001
changed to slot 1
```
Finally you can go back to the first terminal window and press Enter. Amanda will automatically pick up the other files if the backup
consists of more than one file.
```
amfetchdump: 4: restoring split dumpfile: date 20170322084708 host pi disk /dev/mmcblk0 part 1/UNKNOWN lev 0 comp N program APPLICATION
927712 kb
```
You can also provide amfetchdump with the date of the backup that you want to restore by adding the date parameter (format e.g. 20180327)
like this:
```
backup@pi:/server/temp$ amfetchdump -p openhab-dir pi /dev/mmcblk0 > /server/temp/openhabianpi-image 20180327
```
This line also shows how to restore this image file to a SD card from Linux. In this example, we have an external SD card writer with a
(blank) SD card attached to /dev/sdd.
```
backup@pi:/server/temp$ dd bs=4M if=/server/temp/openhabianpi-image of=/dev/sdd
```
You could also move that temporary recovered image file to your Windows PC that has a card writer, rename the file to have a .raw extension, and use Etcher or other tool in order to write the image to the card.
### A final word on when things have gone badly wrong...
and your SD card to contain the Amanda database is broken: you don't have to give up.
Whenever you use a directory as the storage area, openHABian Amanda by default creates a copy of its config and index files (to know what's stored where) in your storage directory once a day (see `/etc/systemd/system/amandaBackupDB.service`).
So you can reinstall openHABian including Amanda from scratch and copy back those files. Eventually see `amadmin import` option.
Even if you fail to recover your index files, you can still access the files in your storage area.
The `amindex` command can be used to regenerate the database. How to apply unfortunately is out of scope for this document so please g**gle if needed.
There's also a manual way: Amanda storage files are tar files of the destination directory or compressed raw copies of partitions, both have an additional 32KB header.
If you just want to retrieve some files from a partition backup file, you can mount that file. See <https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/>.
Here's examples how to decode them:
```
[18:13:29] root@openhabianpi:/volatile/backup/slots/slot7# ls -l
insgesamt 2196552
-rw-rw----+ 1 backup backup 32768 Mär 29 09:29 00000.openhab-dir-007
-rw-rw----+ 1 backup backup 16857088 Mär 29 09:29 00001.openhab._etc.0
-rw-rw----+ 1 backup backup 370219008 Mär 29 09:30 00002.openhab._var_lib_openhab2.0
-rw-rw----+ 1 backup backup 22673408 Mär 29 09:30 00003.openhab._boot.0
-rw-rw----+ 1 backup backup 1839450239 Mär 29 09:55 00004.openhab._dev_mmcblk0.0
[18:13:29] root@openhabianpi:/volatile/backup/slots/slot7# head -14 *001*
AMANDA: SPLIT_FILE 20180329091738 openhab /etc part 1/-1 lev 0 comp N program /bin/tar
DLE=<<ENDDLE
<dle>
<program>GNUTAR</program>
<disk>/etc</disk>
<level>0</level>
<auth>BSDTCP</auth>
<record>YES</record>
<index>YES</index>
<datapath>AMANDA</datapath>
</dle>
ENDDLE
To restore, position tape at start of file and run:
dd if=<tape> bs=32k skip=1 | /bin/tar -xpGf - ...
[18:14:49] root@openhabianpi:/volatile/backup/slots/slot7# dd if=00001.openhab._etc.0 bs=32k skip=1 | tar tvf -
drwxr-xr-x root/root 2139 2018-03-29 08:50 ./
drwxr-xr-x root/root 15 2018-03-26 17:23 ./.java/
drwxr-xr-x root/root 35 2018-03-26 17:23 ./.java/.systemPrefs/
drwxr-xr-x root/root 31 2018-03-26 17:20 ./PackageKit/
drwxr-xr-x root/root 85 2018-03-26 17:23 ./X11/
drwxr-xr-x root/root 9 2018-03-26 17:23 ./X11/Xreset.d/
...
[18:14:49] root@openhabianpi:/volatile/backup/slots/slot7# dd if=00004.openhab._dev_mmcblk0.0 bs=32k skip=1 | zcat | dd of=/volatile/temp/restore_file
...
```