iobroker.ds18b20
Version:
This is an ioBroker-Adapter to integrate DS18B20 1-wire temperature sensors.
453 lines (442 loc) • 13.9 kB
JSON
{
"type": "tabs",
"tabsStyle": {
"width": "calc(100% - 100px)"
},
"i18n": true,
"items": {
"mainTab": {
"type": "panel",
"label": "Main settings",
"items": {
"defaultInterval": {
"type": "number",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 4,
"lg": 3,
"xl": 3,
"label": "Default query interval",
"help": "The default time between sensor queries in milliseconds.",
"min": 500
},
"w1DevicesPath": {
"type": "text",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 8,
"lg": 6,
"xl": 6,
"label": "Path of the 1-wire devices",
"help": "System path where the 1-wire devices can be accessed. Default is '/sys/bus/w1/devices'."
},
"_w1DevicesPathHint": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"text": "If you have lots of sensors on different bus masters, you may use one adapter instance per bus master to optimize the query performance. To do so use the direct path to one bus master, e.g. '/sys/bus/w1/devices/w1_bus_master1'."
}
}
},
"sensorsTab": {
"type": "panel",
"label": "Sensors",
"items": {
"sensors": {
"type": "table",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"label": "Sensors",
"uniqueColumns": ["address"],
"items": [
{
"type": "text",
"title": "Address",
"width": "20%",
"attr": "address",
"filter": false,
"sort": false,
"default": "",
"validator": "/^[0-9a-f]{2}-[0-9a-f]{12}$/.test(data.address)",
"validatorNoSaveOnError": true
},
{
"type": "text",
"title": "Remote system ID",
"width": "10%",
"attr": "remoteSystemId",
"filter": false,
"sort": false,
"default": "",
"placeholder": "none",
"hidden": "!globalData.remoteEnabled"
},
{
"type": "text",
"title": "Name",
"width": "20%",
"attr": "name",
"filter": false,
"sort": false,
"default": "",
"placeholder": "Enter a name"
},
{
"type": "text",
"title": "Query interval",
"width": "10%",
"attr": "interval",
"filter": false,
"sort": false,
"default": null,
"placeholder": "default",
"validator": "!data.interval || parseInt(data.interval) > 500",
"validatorNoSaveOnError": true
},
{
"type": "text",
"title": "Unit",
"width": "5%",
"attr": "unit",
"filter": false,
"sort": false,
"default": "°C"
},
{
"type": "number",
"title": "Factor",
"width": "5%",
"attr": "factor",
"filter": false,
"sort": false,
"default": 1
},
{
"type": "number",
"title": "Offset",
"width": "5%",
"attr": "offset",
"filter": false,
"sort": false,
"default": 0
},
{
"type": "number",
"title": "Decimals",
"width": "5%",
"attr": "decimals",
"filter": false,
"sort": false,
"default": 2
},
{
"type": "checkbox",
"title": "Null on error",
"width": "5%",
"attr": "nullOnError",
"filter": false,
"sort": false,
"default": true
},
{
"type": "checkbox",
"title": "Enabled",
"width": "5%",
"attr": "enabled",
"filter": false,
"sort": false,
"default": true
}
]
},
"_searchSensorsBtn": {
"type": "sendTo",
"command": "searchSensorsAdminUi",
"jsonData": "{\"sensors\": ${JSON.stringify(data.sensors)}}",
"xs": 12,
"sm": 12,
"md": 6,
"lg": 3,
"xl": 3,
"label": "Search for sensors",
"icon": "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIC05NjAgOTYwIDk2MCIgd2lkdGg9IjQ4Ij48cGF0aCBzdHlsZT0iZmlsbDogY3VycmVudENvbG9yIiBkPSJNNzk2LTEyMSA1MzMtMzg0cS0zMCAyNi02OS45NTkgNDAuNVQzNzgtMzI5cS0xMDguMTYyIDAtMTgzLjA4MS03NVExMjAtNDc5IDEyMC01ODV0NzUtMTgxcTc1LTc1IDE4MS41LTc1dDE4MSA3NVE2MzItNjkxIDYzMi01ODQuODUgNjMyLTU0MiA2MTgtNTAycS0xNCA0MC00MiA3NWwyNjQgMjYyLTQ0IDQ0Wk0zNzctMzg5cTgxLjI1IDAgMTM4LjEyNS01Ny41VDU3Mi01ODVxMC04MS01Ni44NzUtMTM4LjVUMzc3LTc4MXEtODIuMDgzIDAtMTM5LjU0MiA1Ny41UTE4MC02NjYgMTgwLTU4NXQ1Ny40NTggMTM4LjVRMjk0LjkxNy0zODkgMzc3LTM4OVoiLz48L3N2Zz4=",
"variant": "contained",
"useNative": true,
"tooltip": "Click here to search for sensors and add the found sensors to the list.",
"showProcess": true
},
"_searchSensorsInfo": {
"type": "staticText",
"xs": 12,
"sm": 12,
"md": 6,
"lg": 6,
"xl": 6,
"hidden": "_alive",
"text": "The adapter instance must be started to search for sensors.",
"style": {
"color": "red"
}
},
"_sensorAddHint": {
"type": "staticText",
"text": "You may search for sensors or add them manually by providing their address.",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12
},
"_sensorRemoteHint": {
"type": "staticText",
"text": "If a sensor is connected to a remote system, enter the system ID. Otherwise leave the field empty.",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12
}
}
},
"remoteTab": {
"type": "panel",
"label": "Remote systems",
"items": {
"remoteEnabled": {
"type": "checkbox",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"label": "Enable remote sensors",
"help": "When enabled the adapter starts a server and accepts connections from ioBroker.ds18b20 remote clients."
},
"remotePort": {
"type": "port",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 6,
"lg": 2,
"xl": 2,
"label": "Server port",
"help": "The port to start the server for remote clients on. Default is '1820'.",
"hidden": "!data.remoteEnabled"
},
"remoteKey": {
"type": "text",
"xs": 12,
"sm": 11,
"md": 11,
"lg": 6,
"xl": 6,
"label": "Encryption key",
"help": "Key to encrypt the client connections. This key must be set on all clients. Use the button on the right to create a new key.",
"hidden": "!data.remoteEnabled",
"validator": "/^[0-9a-fA-F]{64}$/.test(data.remoteKey)",
"validatorNoSaveOnError": true
},
"_remoteKeyBtn": {
"type": "sendTo",
"command": "getNewRemoteKey",
"xs": 12,
"sm": 1,
"md": 1,
"lg": 1,
"xl": 1,
"icon": "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIHN0eWxlPSJmaWxsOiBjdXJyZW50Q29sb3IiIGQ9Ik0xNy42NSA2LjM1QzE2LjIgNC45IDE0LjIxIDQgMTIgNGMtNC40MiAwLTcuOTkgMy41OC03Ljk5IDhzMy41NyA4IDcuOTkgOGMzLjczIDAgNi44NC0yLjU1IDcuNzMtNmgtMi4wOGMtLjgyIDIuMzMtMy4wNCA0LTUuNjUgNC0zLjMxIDAtNi0yLjY5LTYtNnMyLjY5LTYgNi02YzEuNjYgMCAzLjE0LjY5IDQuMjIgMS43OEwxMyAxMWg3VjRsLTIuMzUgMi4zNXoiPjwvcGF0aD48L3N2Zz4=",
"variant": "contained",
"useNative": true,
"tooltip": "Click here to create a new random encryption key",
"hidden": "!data.remoteEnabled"
},
"_hr": {
"type": "divider",
"hidden": "!data.remoteEnabled"
},
"_remoteConnectedText": {
"type": "staticText",
"text": "Connected remote systems",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"style": {
"fontSize": "1.3em",
"fontWeight": "bold"
}
},
"_remoteConnectedInfo": {
"type": "textSendTo",
"command": "getRemoteSystemsAdminUi",
"container": "div",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"style": {
"fontFamily": "monospace",
"marginLeft": "2em"
}
},
"_remoteConnectedHint": {
"type": "staticText",
"text": "Hint: Reopen this page to refresh the list of connected remote systems.",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled"
},
"_hr2": {
"type": "divider",
"hidden": "!data.remoteEnabled"
},
"_remoteInstallHint1": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"text": "Remote client setup instructions",
"style": {
"fontSize": "1.3em",
"fontWeight": "bold"
}
},
"_remoteInstallHint2": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"text": "To setup a remote client please make sure Node.js is installed and run the following commands on the remote system. This will create all necessary files in '~/ds18b20-remote/' to run the remote client."
},
"_remoteInstallHintCmd1": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"noTranslation": true,
"text": "mkdir ~/ds18b20-remote",
"style": {
"fontFamily": "monospace",
"marginLeft": "2em",
"paddingBottom": 0
}
},
"_remoteInstallHintCmd2": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"noTranslation": true,
"text": "cd ~/ds18b20-remote",
"style": {
"fontFamily": "monospace",
"marginLeft": "2em",
"paddingTop": 0,
"paddingBottom": 0
}
},
"_remoteInstallHintCmd3": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"noTranslation": true,
"text": "wget -O remote-client-setup.js https://raw.githubusercontent.com/crycode-de/ioBroker.ds18b20/582dac6b7dc00d892ec8ab429efc7a8be27e102e/build/remote/remote-client-setup.js",
"style": {
"fontFamily": "monospace",
"marginLeft": "2em",
"paddingTop": 0,
"paddingBottom": 0
}
},
"_remoteInstallHintCmd4": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"noTranslation": true,
"text": "node remote-client-setup.js",
"style": {
"fontFamily": "monospace",
"marginLeft": "2em",
"paddingTop": 0,
"paddingBottom": 0
}
},
"_remoteInstallHint3": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"text": "After that you have to edit the created '.env' file and fill in at least the host and the encryption key.",
"style": {
"fontWeight": "bold"
}
},
"_remoteInstallHint4": {
"type": "staticText",
"newLine": true,
"xs": 12,
"sm": 12,
"md": 12,
"lg": 12,
"xl": 12,
"hidden": "!data.remoteEnabled",
"text": "Then you may start the remote client manually or as a SystemD service like shown in the setup output."
}
}
}
}
}