diff --git a/netatmo/devicepluginnetatmo.cpp b/netatmo/devicepluginnetatmo.cpp index 632c050b..a44364b9 100644 --- a/netatmo/devicepluginnetatmo.cpp +++ b/netatmo/devicepluginnetatmo.cpp @@ -323,7 +323,8 @@ void DevicePluginNetatmo::onOutdoorStatesChanged() device->setStateValue(outdoorTemperatureMaxStateTypeId, outdoor->maxTemperature()); device->setStateValue(outdoorHumidityStateTypeId, outdoor->humidity()); device->setStateValue(outdoorSignalStrengthStateTypeId, outdoor->signalStrength()); - device->setStateValue(outdoorBatteryStateTypeId, outdoor->battery()); + device->setStateValue(outdoorBatteryLevelStateTypeId, outdoor->battery()); + device->setStateValue(outdoorBatteryCriticalStateTypeId, outdoor->battery() < 10); } diff --git a/netatmo/devicepluginnetatmo.json b/netatmo/devicepluginnetatmo.json index cb2a1a08..93f7dae4 100644 --- a/netatmo/devicepluginnetatmo.json +++ b/netatmo/devicepluginnetatmo.json @@ -58,6 +58,7 @@ "Weather", "Sensor" ], + "interfaces": ["temperaturesensor", "humiditysensor", "pressuresensor"], "primaryStateTypeId": "3cb25538-e463-40ae-92f9-8f34f0c06b92", "createMethods": ["auto"], "paramTypes": [ @@ -124,8 +125,10 @@ "displayNameEvent": "humidity changed", "graphRelevant": true, "unit": "Percentage", - "type": "int", - "defaultValue": 0 + "type": "double", + "defaultValue": 0, + "minValue": 0, + "maxValue": 100 }, { "id": "03b0a7b7-987d-4d3b-b3f0-21d9f92ad326", @@ -180,6 +183,7 @@ "Weather", "Sensor" ], + "interfaces": ["temperaturesensor", "humiditysensor", "batterylevel"], "primaryStateTypeId": "3cb25538-e463-40ae-92f9-8f34f0c06b92", "createMethods": ["auto"], "paramTypes": [ @@ -254,8 +258,10 @@ "displayNameEvent": "humidity changed", "graphRelevant": true, "unit": "Percentage", - "type": "int", - "defaultValue": 0 + "type": "double", + "defaultValue": 0, + "minValue": 0, + "maxValue": 100 }, { "id": "0faa3d08-9004-46fb-a5aa-a59b75e454cc", @@ -270,12 +276,22 @@ }, { "id": "15d8fae1-ba47-42e1-994d-530e8017c965", - "name": "battery", + "name": "batteryLevel", "displayName": "battery", "displayNameEvent": "battery changed", "unit": "Percentage", "type": "int", - "defaultValue": 0 + "defaultValue": 0, + "minValue": 0, + "maxValue": 100 + }, + { + "id": "f8aeb144-014d-4ccb-81db-64ffc70f1c97", + "name": "batteryCritical", + "displayName": "battery critical", + "displayNameEvent": "battery critical changed", + "type": "bool", + "defaultValue": false } ] } diff --git a/simulation/devicepluginsimulation.json b/simulation/devicepluginsimulation.json index 241a6628..63b92cd7 100644 --- a/simulation/devicepluginsimulation.json +++ b/simulation/devicepluginsimulation.json @@ -658,6 +658,7 @@ "Weather", "Sensor" ], + "interfaces": ["temperaturesensor", "humiditysensor", "pressuresensor"], "createMethods": ["user"], "paramTypes": [ ], "stateTypes": [ @@ -689,8 +690,10 @@ "displayNameEvent": "Humidity changed", "graphRelevant": true, "unit": "Percentage", - "type": "int", - "defaultValue": 37 + "type": "double", + "defaultValue": 37, + "minValue": 0, + "maxValue": 100 }, { "id": "b13fa34e-b63d-4fa4-a786-e82776ee9cbe", @@ -699,7 +702,7 @@ "displayNameEvent": "Pressure changed", "unit": "MilliBar", "graphRelevant": true, - "type": "int", + "type": "double", "defaultValue": 1006 }, {