Plugin file
Plugin configuration file
{
"name": "shelly-plus-1pm",
"version": "2.0.0",
"description": "Shelly Plus 1PM with Thinger.io",
"author": "Thinger.io",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/thinger-io/plugins.git",
"directory": "shelly-plus-1pm"
},
"metadata": {
"name": "Shelly Plus 1PM",
"description": "Shelly Plus 1PM with Thinger.io",
"image": "docs/assets/shelly-plus-1pm.png"
},
"resources": {
"products": [
{
"description": "Shelly Plus 1PM with Thinger.io",
"enabled": true,
"name": "Shelly Plus 1PM",
"product": "shelly_plus_1pm",
"profile": {
"api": {
"config": {
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/config\",\n \"method\": \"Shelly.GetConfig\",\n \"id\" : 0\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {
"payload": "{{payload.result}}",
"source": "topic",
"topic": "{{device}}/switch/config/rpc"
}
}
},
"info": {
"description": "Device State",
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/info\",\n \"method\": \"Shelly.GetDeviceInfo\",\n \"id\" : 0\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {
"payload": "{{payload.result}}",
"source": "topic",
"topic": "{{device}}/switch/info/rpc"
}
}
},
"location": {
"description": "Device State",
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/location\",\n \"method\": \"Shelly.DetectLocation\",\n \"id\" : 0\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {
"payload": "{{payload.result}}",
"source": "topic",
"topic": "{{device}}/switch/location/rpc"
}
}
},
"relay": {
"description": "Relay Control",
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/set\",\n \"method\": \"Switch.Set\",\n \"params\" : {\n \"id\" : 0,\n \"on\" : {{payload=property.relay.output}}\n }\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {}
}
},
"status": {
"description": "Device State",
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/status\",\n \"method\": \"Shelly.GetStatus\",\n \"id\" : 0\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {
"payload": "{{payload.result}}",
"source": "topic",
"topic": "{{device}}/switch/status/rpc"
}
}
},
"updates": {
"description": "Device State",
"enabled": true,
"request": {
"data": {
"payload": "{\n \"src\" : \"{{device}}/switch/updates\",\n \"method\": \"Shelly.CheckForUpdate\",\n \"id\" : 0\n}",
"target": "topic",
"topic": "{{device}}/rpc"
}
},
"response": {
"data": {
"payload": "{{payload.result}}",
"source": "topic",
"topic": "{{device}}/switch/updates/rpc"
}
}
}
},
"autoprovisions": {
"shelly_plus_1pm": {
"config": {
"mode": "pattern",
"pattern": "shellyplus1pm-[a-fA-F0-9]+"
},
"description": "Shelly Plus 1PM Autoprovision",
"enabled": true,
"name": "Shelly Plus 1PM"
}
},
"buckets": {
"shelly_plus_1pm_status": {
"data": {
"payload": "{{payload:statusProcessor}}",
"source": "topic",
"topic": "{{device}}/status/switch:0"
},
"description": "Shelly Plus 1PM Status",
"enabled": true
}
},
"code": {
"code": "function statusProcessor(payload){\n return {\n energy: payload.aenergy.total/60/1000,\n power: payload.apower,\n current: payload.current,\n output: payload.output,\n temperature: payload.temperature.tC,\n voltage: payload.voltage\n };\n}",
"environment": "javascript",
"storage": "",
"version": "1.0"
},
"properties": {
"relay": {
"data": {
"payload": "{{payload:statusProcessor}}",
"source": "topic",
"topic": "{{device}}/status/switch:0"
},
"description": "Relay State",
"enabled": true,
"model": {
"source": "value",
"value": "false"
}
}
}
},
"_resources": {
"properties": [
{
"property": "relay",
"value": false
},
{
"property": "dashboard",
"value": {
"description": "Dashboard for Shelly Plus 1PM devices",
"name": "Shelly Plus 1PM",
"properties": {
"background_image": "",
"columns": 12,
"row_height": 40,
"show_template": true,
"template": true
},
"tabs": [
{
"icon": "fas fa-tachometer-alt",
"widgets": [
{
"layout": {
"col": 2,
"row": 0,
"sizeX": 3,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Power Switch"
},
"properties": {
"style": "switch"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"resource": "relay"
},
"device_property": {
"device": "shellyplus1pm",
"property": "relay"
},
"name": "Default",
"source": "device"
}
],
"type": "boolean"
},
{
"layout": {
"col": 8,
"row": 6,
"sizeX": 4,
"sizeY": 11
},
"panel": {
"color": "#ffffffcc",
"title": "Device Location"
},
"properties": {
"center": true,
"hideControls": false,
"latitude": 0,
"longitude": 0,
"mapType": "roadmap",
"showClustering": true,
"showConnected": true,
"showDisconnected": true,
"showOptions": false,
"showSearch": true,
"waypoints": false,
"zoom": 8
},
"sources": [
{
"color": "#0cdf72",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": {
"latitude": "lat",
"longitude": "lon"
},
"resource": "location",
"update": "none"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": {
"latitude": "latitude",
"longitude": "longitude"
},
"property": "location"
},
"name": "Device Location",
"source": "device",
"timespan": {
"magnitude": "minute",
"value": 30
},
"type": "type"
}
],
"type": "map"
},
{
"layout": {
"col": 0,
"row": 0,
"sizeX": 2,
"sizeY": 6
},
"panel": {
"color": "#ffffffcc",
"title": "Shelly Plus 1PM"
},
"properties": {
"refresh_interval": 0
},
"sources": [
{
"color": "#1E313E",
"image_url": "https://raw.githubusercontent.com/thinger-io/plugins/main/shelly-plus-1pm/shelly-plus-1pm.png",
"name": "Default",
"source": "image_url"
}
],
"type": "image"
},
{
"layout": {
"col": 0,
"row": 20,
"sizeX": 12,
"sizeY": 8
},
"panel": {
"color": "#ffffffcc",
"title": "Device Temperature"
},
"properties": {
"axis": true,
"fill": false,
"legend": true,
"multiple_axes": false
},
"sources": [
{
"aggregation": {
"period": "15m",
"type": "mean"
},
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "temperature",
"tags": {
"device": [
"shellyplus1pm-441793a50208"
],
"group": []
}
},
"color": "#ff0000",
"name": "Temperature ºC",
"source": "bucket",
"timespan": {
"magnitude": "day",
"mode": "relative",
"period": "latest",
"value": 1
}
}
],
"type": "chart"
},
{
"layout": {
"col": 8,
"row": 17,
"sizeX": 2,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "New Firmware"
},
"properties": {
"color": "#00aa00",
"colors": [
{
"blink": false,
"color": "#00ff00",
"max": 1,
"min": 1
},
{
"blink": false,
"color": "#ff3705",
"max": 0,
"min": 0
}
],
"size": "35px"
},
"sources": [
{
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_temperature",
"mapping": "overtemperature",
"tags": {
"device": [
"shellyplus1pm"
],
"group": []
}
},
"color": "#1E313E",
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "new_fw",
"property": "state"
},
"name": "Default",
"source": "device_property",
"timespan": {
"mode": "latest"
}
}
],
"type": "led"
},
{
"layout": {
"col": 5,
"row": 14,
"sizeX": 3,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Device Model"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-tablet",
"size": "35px",
"unit_size": "20px",
"weight": "font-thin"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": "model",
"resource": "info"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "model",
"property": "state"
},
"name": "Default",
"source": "device"
}
],
"type": "text"
},
{
"layout": {
"col": 8,
"row": 0,
"sizeX": 4,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "IP Address"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-wifi",
"size": "35px",
"unit_size": "20px",
"weight": "font-normal"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": "wifi.sta_ip",
"resource": "status",
"update": "none"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "ip",
"property": "state"
},
"name": "Default",
"source": "device"
}
],
"type": "text"
},
{
"layout": {
"col": 8,
"row": 3,
"sizeX": 4,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Device MAC"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-ethernet",
"size": "35px",
"unit_size": "20px",
"weight": "font-normal"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": "sys.mac",
"resource": "status",
"update": "none"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "mac",
"property": "state"
},
"name": "Default",
"source": "device"
}
],
"type": "text"
},
{
"layout": {
"col": 2,
"row": 3,
"sizeX": 3,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Device Temperature"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-thermometer-half",
"size": "35px",
"unit": "ºC",
"unit_size": "20px",
"weight": "font-normal"
},
"sources": [
{
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "temperature",
"tags": {
"device": [
"shellyplus1pm-441793a50208"
],
"group": []
}
},
"color": "#1E313E",
"device": {
"id": "shellyplus1pm"
},
"device_property": {
"device": "shellyplus1pm",
"mapping": "id",
"property": "state"
},
"name": "Default",
"source": "bucket",
"timespan": {
"mode": "latest"
}
}
],
"type": "text"
},
{
"layout": {
"col": 0,
"row": 17,
"sizeX": 8,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Firmware Version"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-code-merge",
"size": "35px",
"unit_size": "20px",
"weight": "font-thin"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": "fw_id",
"resource": "info",
"update": "none"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "fw_ver",
"property": "state"
},
"name": "Default",
"source": "device"
}
],
"type": "text"
},
{
"layout": {
"col": 0,
"row": 14,
"sizeX": 5,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Device ID"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-fingerprint",
"size": "35px",
"unit_size": "20px",
"weight": "font-thin"
},
"sources": [
{
"color": "#1E313E",
"device": {
"id": "shellyplus1pm-441793a50208",
"mapping": "id",
"resource": "info",
"update": "none"
},
"device_property": {
"device": "shellyplus1pm-441793a50208",
"mapping": "id",
"property": "state"
},
"name": "Default",
"source": "device"
}
],
"type": "text"
},
{
"layout": {
"col": 10,
"row": 17,
"sizeX": 2,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"title": "Temperature"
},
"properties": {
"color": "#00aa00",
"colors": [
{
"blink": false,
"color": "#00ff00",
"max": 60,
"min": 0
},
{
"blink": false,
"color": "#ff3705",
"max": 100,
"min": 60
}
],
"size": "35px"
},
"sources": [
{
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "temperature",
"tags": {
"device": [
"shellyplus1pm-441793a50208"
],
"group": []
}
},
"color": "#1E313E",
"device": {},
"name": "Default",
"source": "bucket",
"timespan": {
"mode": "latest"
}
}
],
"type": "led"
},
{
"layout": {
"col": 0,
"row": 6,
"sizeX": 8,
"sizeY": 8
},
"panel": {
"color": "#ffffffcc",
"subtitle": "kWh",
"title": "Daily Energy Consumption"
},
"properties": {
"axis": true,
"fill": false,
"legend": false,
"multiple_axes": false,
"options": "var options = {\n series: series,\n chart: {\n type: 'bar'\n },\n plotOptions: {\n bar: {\n horizontal: false,\n columnWidth: '55%',\n endingShape: 'rounded'\n },\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n show: true,\n width: 2,\n colors: ['transparent']\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n }\n },\n yaxis: {\n \"labels\": {\n \"formatter\": function (val) {\n return val.toFixed(2);\n }\n }\n },\n fill: {\n opacity: 1\n },\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};"
},
"sources": [
{
"aggregation": {
"period": "1d",
"type": "max"
},
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "energy",
"tags": {
"device": [],
"group": []
}
},
"color": "#1E313E",
"name": "Default",
"source": "bucket",
"timespan": {
"magnitude": "month",
"mode": "relative",
"period": "latest",
"value": 1
},
"transform": "difference"
}
],
"type": "apex_charts"
},
{
"layout": {
"col": 5,
"row": 0,
"sizeX": 3,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"subtitle": "W",
"title": "Current Power"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-bolt",
"size": "35px",
"unit": "W",
"unit_size": "20px",
"weight": "font-normal"
},
"sources": [
{
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "power",
"tags": {
"device": [],
"group": []
}
},
"color": "#1E313E",
"device": {
"id": "shellyplus1pm"
},
"device_property": {
"device": "shellyplus1pm",
"mapping": "mac",
"property": "state"
},
"name": "Default",
"source": "bucket",
"timespan": {
"mode": "latest"
}
}
],
"type": "text"
},
{
"layout": {
"col": 5,
"row": 3,
"sizeX": 3,
"sizeY": 3
},
"panel": {
"color": "#ffffffcc",
"subtitle": "kWh",
"title": "Energy Consumption"
},
"properties": {
"color": "#000000",
"decimal_places": 2,
"icon": "far fa-infinity",
"size": "35px",
"unit": "kWh",
"unit_size": "20px",
"weight": "font-normal"
},
"sources": [
{
"bucket": {
"backend": "influxdb2",
"id": "shelly_plus_1pm_status",
"mapping": "energy",
"tags": {
"device": [
"shellyplus1pm-441793a50208"
],
"group": []
}
},
"color": "#1E313E",
"device": {
"id": "shellyplus1pm"
},
"device_property": {
"device": "shellyplus1pm",
"mapping": "mac",
"property": "state"
},
"name": "Default",
"source": "bucket",
"timespan": {
"mode": "latest"
}
}
],
"type": "text"
}
]
}
]
}
}
]
}
}
]
}
}