diff --git a/bundles/org.openhab.binding.netatmo/README.md b/bundles/org.openhab.binding.netatmo/README.md index fc7e579fcfb2a..fbbb6a34b7da1 100644 --- a/bundles/org.openhab.binding.netatmo/README.md +++ b/bundles/org.openhab.binding.netatmo/README.md @@ -121,19 +121,77 @@ Number Netatmo_Indoor_CO2 "CO2" { channel = "netatmo:NAMain:home | Channel ID | Item Type | Description | |---------------------|----------------------|----------------------------------------------------------| | Co2 | Number:Dimensionless | Air quality | +| MinCo2 | Number:Dimensionless | Minimum CO2 on current day | +| MinCo2ThisWeek | Number:Dimensionless | Minimum CO2 this week | +| MinCo2ThisMonth | Number:Dimensionless | Minimum CO2 this month | +| MaxCo2 | Number:Dimensionless | Maximum CO2 on current day | +| MaxCo2ThisWeek | Number:Dimensionless | Maximum CO2 this week | +| MaxCo2ThisMonth | Number:Dimensionless | Maximum CO2 this month | +| DateMinCo2 | DateTime | Date when minimum CO2 was reached on current day | +| DateMinCo2ThisWeek | DateTime | Date when minimum CO2 was reached this week | +| DateMinCo2ThisMonth | DateTime | Date when minimum CO2 was reached this month | +| DateMaxCo2 | DateTime | Date when maximum CO2 was reached on current day | +| DateMaxCo2ThisWeek | DateTime | Date when maximum CO2 was reached this week | +| DateMaxCo2ThisMonth | DateTime | Date when maximum CO2 was reached this month | | Temperature | Number:Temperature | Current temperature | | TempTrend | String | Temperature evolution trend (up, down, stable) | | Noise | Number:Dimensionless | Current noise level | +| MinNoise | Number:Dimensionless | Minimum noise on current day | +| MinNoiseThisWeek | Number:Dimensionless | Minimum noise this week | +| MinNoiseThisMonth | Number:Dimensionless | Minimum noise this month | +| MaxNoise | Number:Dimensionless | Maximum noise on current day | +| MaxNoiseThisWeek | Number:Dimensionless | Maximum noise this week | +| MaxNoiseThisMonth | Number:Dimensionless | Maximum noise this month | +| DateMinNoise | DateTime | Date when minimum noise was reached on current day | +| DateMinNoiseThisWeek| DateTime | Date when minimum noise was reached this week | +| DateMinNoiseThisMonth| DateTime | Date when minimum noise was reached this month | +| DateMaxNoise | DateTime | Date when maximum noise was reached on current day | +| DateMaxNoiseThisWeek| DateTime | Date when maximum noise was reached this week | +| DateMaxNoiseThisMonth| DateTime | Date when maximum noise was reached this month | | Pressure | Number:Pressure | Current pressure | +| MinPressure | Number:Pressure | Minimum pressure on current day | +| MinPressureThisWeek | Number:Pressure | Minimum pressure this week | +| MinPressureThisMonth| Number:Pressure | Minimum pressure this month | +| MaxPressure | Number:Pressure | Maximum pressure on current day | +| MaxPressureThisWeek | Number:Pressure | Maximum pressure this week | +| MaxPressureThisMonth| Number:Pressure | Maximum pressure this month | +| DateMinPressure | DateTime | Date when minimum pressure was reached on current day | +| DateMinPressureThisWeek | DateTime | Date when minimum pressure was reached this week | +| DateMinPressureThisMonth| DateTime | Date when minimum pressure was reached this month | +| DateMaxPressure | DateTime | Date when maximum pressure was reached on current day | +| DateMaxPressureThisWeek | DateTime | Date when maximum pressure was reached this week | +| DateMaxPressureThisMonth| DateTime | Date when maximum pressure was reached this month | | PressTrend | String | Pressure evolution trend for last 12h (up, down, stable) | | AbsolutePressure | Number:Pressure | Absolute pressure | | Humidity | Number:Dimensionless | Current humidity | +| MinHumidity | Number:Dimensionless | Minimum humidity on current day | +| MinHumidityThisWeek | Number:Dimensionless | Minimum humidity this week | +| MinHumidityThisMonth| Number:Dimensionless | Minimum humidity this month | +| MaxHumidity | Number:Dimensionless | Maximum humidity on current day | +| MaxHumidityThisWeek | Number:Dimensionless | Maximum humidity this week | +| MaxHumidityThisMonth| Number:Dimensionless | Maximum humidity this month | +| DateMinHumidity | DateTime | Date when minimum humidity was reached on current day | +| DateMinHumidityThisWeek | DateTime | Date when minimum humidity was reached this week | +| DateMinHumidityThisMonth| DateTime | Date when minimum humidity was reached this month | +| DateMaxHumidity | DateTime | Date when maximum humidity was reached on current day | +| DateMaxHumidityThisWeek | DateTime | Date when maximum humidity was reached this week | +| DateMaxHumidityThisMonth| DateTime | Date when maximum humidity was reached this month | | Humidex | Number | Computed Humidex index | | HeatIndex | Number:Temperature | Computed Heat Index | | Dewpoint | Number:Temperature | Computed dewpoint temperature | | DewpointDepression | Number:Temperature | Computed dewpoint depression | | MinTemp | Number:Temperature | Minimum temperature on current day | +| MinTempThisWeek | Number:Temperature | Minimum temperature this week | +| MinTempThisMonth | Number:Temperature | Minimum temperature this month | | MaxTemp | Number:Temperature | Maximum temperature on current day | +| MaxTempThisWeek | Number:Temperature | Maximum temperature this week | +| MaxTempThisMonth | Number:Temperature | Maximum temperature this month | +| DateMinTemp | DateTime | Date when minimum temperature was reached on current day | +| DateMinTempThisWeek | DateTime | Date when minimum temperature was reached this week | +| DateMinTempThisMonth| DateTime | Date when minimum temperature was reached this month | +| DateMaxTemp | DateTime | Date when maximum temperature was reached on current day | +| DateMaxTempThisWeek | DateTime | Date when maximum temperature was reached this week | +| DateMaxTempThisMonth| DateTime | Date when maximum temperature was reached this month | | DateMinTemp | DateTime | Date when minimum temperature was reached on current day | | DateMaxTemp | DateTime | Date when maximum temperature was reached on current day | | TimeStamp | DateTime | Timestamp when data was measured | @@ -159,14 +217,34 @@ Number Netatmo_Outdoor_Temperature "Temperature" { channel = "netatmo:NAModule1: | Temperature | Number:Temperature | Current temperature | | TempTrend | String | Temperature evolution trend (up, down, stable) | | Humidity | Number:Dimensionless | Current humidity | +| MinHumidity | Number:Dimensionless | Minimum humidity on current day | +| MinHumidityThisWeek | Number:Dimensionless | Minimum humidity this week | +| MinHumidityThisMonth| Number:Dimensionless | Minimum humidity this month | +| MaxHumidity | Number:Dimensionless | Maximum humidity on current day | +| MaxHumidityThisWeek | Number:Dimensionless | Maximum humidity this week | +| MaxHumidityThisMonth| Number:Dimensionless | Maximum humidity this month | +| DateMinHumidity | DateTime | Date when minimum humidity was reached on current day | +| DateMinHumidityThisWeek | DateTime | Date when minimum humidity was reached this week | +| DateMinHumidityThisMonth| DateTime | Date when minimum humidity was reached this month | +| DateMaxHumidity | DateTime | Date when maximum humidity was reached on current day | +| DateMaxHumidityThisWeek | DateTime | Date when maximum humidity was reached this week | +| DateMaxHumidityThisMonth| DateTime | Date when maximum humidity was reached this month | | Humidex | Number | Computed Humidex index | | HeatIndex | Number:Temperature | Computed Heat Index | | Dewpoint | Number:Temperature | Computed dewpoint temperature | | DewpointDepression | Number:Temperature | Computed dewpoint depression | | MinTemp | Number:Temperature | Minimum temperature on current day | +| MinTempThisWeek | Number:Temperature | Minimum temperature this week | +| MinTempThisMonth | Number:Temperature | Minimum temperature this month | | MaxTemp | Number:Temperature | Maximum temperature on current day | +| MaxTempThisWeek | Number:Temperature | Maximum temperature this week | +| MaxTempThisMonth | Number:Temperature | Maximum temperature this month | | DateMinTemp | DateTime | Date when minimum temperature was reached on current day | +| DateMinTempThisWeek | DateTime | Date when minimum temperature was reached this week | +| DateMinTempThisMonth| DateTime | Date when minimum temperature was reached this month | | DateMaxTemp | DateTime | Date when maximum temperature was reached on current day | +| DateMaxTempThisWeek | DateTime | Date when maximum temperature was reached this week | +| DateMaxTempThisMonth| DateTime | Date when maximum temperature was reached this month | | TimeStamp | DateTime | Timestamp when data was measured | | LastMessage | DateTime | Last message emitted by the module | | LowBattery | Switch | Low battery | @@ -189,17 +267,49 @@ Number Netatmo_Indoor2_Temperature "Temperature" { channel = "netatmo:NAModule4: | Channel ID | Item Type | Description | |---------------------|----------------------|----------------------------------------------------------| | Co2 | Number:Dimensionless | Air quality | +| MinCo2 | Number:Dimensionless | Minimum CO2 on current day | +| MinCo2ThisWeek | Number:Dimensionless | Minimum CO2 this week | +| MinCo2ThisMonth | Number:Dimensionless | Minimum CO2 this month | +| MaxCo2 | Number:Dimensionless | Maximum CO2 on current day | +| MaxCo2ThisWeek | Number:Dimensionless | Maximum CO2 this week | +| MaxCo2ThisMonth | Number:Dimensionless | Maximum CO2 this month | +| DateMinCo2 | DateTime | Date when minimum CO2 was reached on current day | +| DateMinCo2ThisWeek | DateTime | Date when minimum CO2 was reached this week | +| DateMinCo2ThisMonth | DateTime | Date when minimum CO2 was reached this month | +| DateMaxCo2 | DateTime | Date when maximum CO2 was reached on current day | +| DateMaxCo2ThisWeek | DateTime | Date when maximum CO2 was reached this week | +| DateMaxCo2ThisMonth | DateTime | Date when maximum CO2 was reached this month | | Temperature | Number:Temperature | Current temperature | | TempTrend | String | Temperature evolution trend (up, down, stable) | | Humidity | Number:Dimensionless | Current humidity | +| MinHumidity | Number:Dimensionless | Minimum humidity on current day | +| MinHumidityThisWeek | Number:Dimensionless | Minimum humidity this week | +| MinHumidityThisMonth| Number:Dimensionless | Minimum humidity this month | +| MaxHumidity | Number:Dimensionless | Maximum humidity on current day | +| MaxHumidityThisWeek | Number:Dimensionless | Maximum humidity this week | +| MaxHumidityThisMonth| Number:Dimensionless | Maximum humidity this month | +| DateMinHumidity | DateTime | Date when minimum humidity was reached on current day | +| DateMinHumidityThisWeek | DateTime | Date when minimum humidity was reached this week | +| DateMinHumidityThisMonth| DateTime | Date when minimum humidity was reached this month | +| DateMaxHumidity | DateTime | Date when maximum humidity was reached on current day | +| DateMaxHumidityThisWeek | DateTime | Date when maximum humidity was reached this week | +| DateMaxHumidityThisMonth| DateTime | Date when maximum humidity was reached this month | | Humidex | Number | Computed Humidex index | | HeatIndex | Number:Temperature | Computed Heat Index | | Dewpoint | Number:Temperature | Computed dewpoint temperature | | DewpointDepression | Number:Temperature | Computed dewpoint depression | | MinTemp | Number:Temperature | Minimum temperature on current day | +| MinTempThisWeek | Number:Temperature | Minimum temperature this week | +| MinTempThisMonth | Number:Temperature | Minimum temperature this month | | MaxTemp | Number:Temperature | Maximum temperature on current day | +| MaxTempThisWeek | Number:Temperature | Maximum temperature this week | +| MaxTempThisMonth | Number:Temperature | Maximum temperature this month | | DateMinTemp | DateTime | Date when minimum temperature was reached on current day | +| DateMinTempThisWeek | DateTime | Date when minimum temperature was reached this week | +| DateMinTempThisMonth| DateTime | Date when minimum temperature was reached this month | | DateMaxTemp | DateTime | Date when maximum temperature was reached on current day | +| DateMaxTempThisWeek | DateTime | Date when maximum temperature was reached this week | +| DateMaxTempThisMonth| DateTime | Date when maximum temperature was reached this month | | TimeStamp | DateTime | Timestamp when data was measured | | LastMessage | DateTime | Last message emitted by the module | | LowBattery | Switch | Low battery | @@ -224,6 +334,8 @@ Number Netatmo_Rain_Current "Rain [%.1f mm]" { channel = "netatmo:NAModule3:home | Rain | Number:Length | Quantity of water | | SumRain1 | Number:Length | Quantity of water on last hour | | SumRain24 | Number:Length | Quantity of water on last day | +| SumRainThisWeek | Number:Length | Quantity of water this week | +| SumRainThisMonth | Number:Length | Quantity of water this month | | TimeStamp | DateTime | Timestamp when data was measured | | LastMessage | DateTime | Last message emitted by the module | | LowBattery | Switch | Low battery | @@ -410,8 +522,9 @@ All these channels except welcomePersonAtHome are read only. // Bridge configuration: Bridge netatmo:netatmoapi:home "Netatmo API" [ clientId="*********", clientSecret="**********", username = "mail@example.com", password = "******", readStation=true, readThermostat=false] { // Thing configuration: - Thing NAMain inside "Netatmo Inside" [ id="aa:aa:aa:aa:aa:aa" ] + Thing NAMain inside "Netatmo Inside" [ id="aa:aa:aa:aa:aa:aa" ] Thing NAModule1 outside "Netatmo Outside" [ id="bb:bb:bb:bb:bb:bb", parentId="aa:aa:aa:aa:aa:aa" ] + Thing NAModule3 outside "Netatmo Rain" [ id="cc:cc:cc:cc:cc:cc", parentId="aa:aa:aa:aa:aa:aa" ] } ``` @@ -420,148 +533,209 @@ Bridge netatmo:netatmoapi:home "Netatmo API" [ clientId="*********", clientSecre ``` # Indoor Module -Number:Temperature Netatmo_Indoor_Temperature "Temperature [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Temperature" } -Number:Dimensionless Netatmo_Indoor_Humidity "Humidity [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Humidity" } -Number Netatmo_Indoor_Humidex "Humidex [%.0f]" { channel = "netatmo:NAMain:home:inside:Humidex" } -Number:Temperature Netatmo_Indoor_HeatIndex "HeatIndex [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:HeatIndex" } -Number:Temperature Netatmo_Indoor_Dewpoint "Dewpoint [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Dewpoint" } -Number:Temperature Netatmo_Indoor_DewpointDepression "DewpointDepression [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:DewpointDepression" } -Number:Dimensionless Netatmo_Indoor_Co2 "Co2 [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Co2" } -Number:Pressure Netatmo_Indoor_Pressure "Pressure [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Pressure" } -Number:Pressure Netatmo_Indoor_AbsolutePressure "AbsolutePressure [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:AbsolutePressure" } -Number:Dimensionless Netatmo_Indoor_Noise "Noise [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Noise" } -Number Netatmo_Indoor_WifiStatus "WifiStatus [%s]" { channel = "netatmo:NAMain:home:inside:WifiStatus" } -DateTime Netatmo_Indoor_TimeStamp "TimeStamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:TimeStamp" } -Location Netatmo_Indoor_Location "Location" { channel = "netatmo:NAMain:home:inside:Location" } -DateTime Netatmo_Indoor_LastStatusStore "LastStatusStore [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:LastStatusStore" } +Number:Temperature Indoor_Temp "Temperature [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Temperature" } +Number:Temperature Indoor_Min_Temp "Min Temperature Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinTemp" } +Number:Temperature Indoor_Min_Temp_This_Week "Min Temperature This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinTempThisWeek" } +Number:Temperature Indoor_Min_Temp_This_Month "Min Temperature This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinTempThisMonth" } +Number:Temperature Indoor_Max_Temp "Max Temperature Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxTemp" } +Number:Temperature Indoor_Max_Temp_This_Week "Max Temperature This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxTempThisWeek" } +Number:Temperature Indoor_Max_Temp_This_Month "Max Temperature This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxTempThisMonth" } +DateTime Indoor_Min_Temp_TS "Min Temperature Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinTemp" } +DateTime Indoor_Min_Temp_This_Week_TS "Min Temperature This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinTempThisWeek" } +DateTime Indoor_Min_Temp_This_Month_TS "Min Temperature This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinTempThisMonth" } +DateTime Indoor_Max_Temp_TS "Max Temperature Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxTemp" } +DateTime Indoor_Max_Temp_This_Week_TS "Max Temperature This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxTempThisWeek" } +DateTime Indoor_Max_Temp_This_Month_TS "Max Temperature This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxTempThisMonth" } +Number:Dimensionless Indoor_Humidity "Humidity [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Humidity" } +Number:Dimensionless Indoor_Min_Humidity "Min Humidity Today [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinHumidity" } +Number:Dimensionless Indoor_Min_Humidity_This_Week "Min Humidity This Week [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinHumidityThisWeek" } +Number:Dimensionless Indoor_Min_Humidity_This_Month "Min Humidity This Month [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinHumidityThisMonth" } +Number:Dimensionless Indoor_Max_Humidity "Max Humidity Today [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxHumidity" } +Number:Dimensionless Indoor_Max_Humidity_This_Week "Max Humidity This Week [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxHumidityThisWeek" } +Number:Dimensionless Indoor_Max_Humidity_This_Month "Max Humidity This Month [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxHumidityThisMonth" } +DateTime Indoor_Min_Humidity_TS "Min Humidity Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinHumidity" } +DateTime Indoor_Min_Humidity_This_Week_TS "Min Humidity This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinHumidityThisWeek" } +DateTime Indoor_Min_Humidity_This_Month_TS "Min Humidity This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinHumidityThisMonth" } +DateTime Indoor_Max_Humidity_TS "Max Humidity Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxHumidity" } +DateTime Indoor_Max_Humidity_This_Week_TS "Max Humidity This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxHumidityThisWeek" } +DateTime Indoor_Max_Humidity_This_Month_TS "Max Humidity This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxHumidityThisMonth" } +Number Indoor_Humidex "Humidex [%.0f]" { channel = "netatmo:NAMain:home:inside:Humidex" } +Number:Temperature Indoor_HeatIndex "HeatIndex [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:HeatIndex" } +Number:Temperature Indoor_Dewpoint "Dewpoint [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Dewpoint" } +Number:Temperature Indoor_DewpointDepression "DewpointDepression [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:DewpointDepression" } +Number:Dimensionless Indoor_Co2 "CO2 [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Co2" } +Number:Dimensionless Indoor_Min_Co2 "Min CO2 Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinCo2" } +Number:Dimensionless Indoor_Min_Co2_This_Week "Min CO2 This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinCo2ThisWeek" } +Number:Dimensionless Indoor_Min_Co2_This_Month "Min CO2 This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinCo2ThisMonth" } +Number:Dimensionless Indoor_Max_Co2 "Max CO2 Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxCo2" } +Number:Dimensionless Indoor_Max_Co2_This_Week "Max CO2 This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxCo2ThisWeek" } +Number:Dimensionless Indoor_Max_Co2_This_Month "Max CO2 This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxCo2ThisMonth" } +DateTime Indoor_Min_Co2_TS "Min CO2 Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinCo2" } +DateTime Indoor_Min_Co2_This_Week_TS "Min CO2 This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinCo2ThisWeek" } +DateTime Indoor_Min_Co2_This_Month_TS "Min CO2 This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinCo2ThisMonth" } +DateTime Indoor_Max_Co2_TS "Max CO2 Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxCo2" } +DateTime Indoor_Max_Co2_This_Week_TS "Max CO2 This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxCo2ThisWeek" } +DateTime Indoor_Max_Co2_This_Month_TS "Max CO2 This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxCo2ThisMonth" } +Number:Pressure Indoor_Pressure "Pressure [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:Pressure" } +Number:Pressure Indoor_Min_Pressure "Min Pressure Today [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinPressure" } +Number:Pressure Indoor_Min_Pressure_This_Week "Min Pressure This Week [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinPressureThisWeek" } +Number:Pressure Indoor_Min_Pressure_This_Month "Min Pressure This Month [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MinPressureThisMonth" } +Number:Pressure Indoor_Max_Pressure "Max Pressure Today [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxPressure" } +Number:Pressure Indoor_Max_Pressure_This_Week "Max Pressure This Week [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxPressureThisWeek" } +Number:Pressure Indoor_Max_Pressure_This_Month "Max Pressure This Month [%d %unit%]" { channel = "netatmo:NAMain:home:inside:MaxPressureThisMonth" } +DateTime Indoor_Min_Pressure_TS "Min Pressure Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinPressure" } +DateTime Indoor_Min_Pressure_This_Week_TS "Min Pressure This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinPressureThisWeek" } +DateTime Indoor_Min_Pressure_This_Month_TS "Min Pressure This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinPressureThisMonth" } +DateTime Indoor_Max_Pressure_TS "Max Pressure Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxPressure" } +DateTime Indoor_Max_Pressure_This_Week_TS "Max Pressure This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxPressureThisWeek" } +DateTime Indoor_Max_Pressure_This_Month_TS "Max Pressure This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxPressureThisMonth" } +Number:Pressure Indoor_AbsolutePressure "AbsolutePressure [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:AbsolutePressure" } +Number:Dimensionless Indoor_Noise "Noise [%d %unit%]" { channel = "netatmo:NAMain:home:inside:Noise" } +Number:Dimensionless Indoor_Min_Noise "Min Noise Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinNoise" } +Number:Dimensionless Indoor_Min_Noise_This_Week "Min Noise This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinNoiseThisWeek" } +Number:Dimensionless Indoor_Min_Noise_This_Month "Min Noise This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MinNoiseThisMonth" } +Number:Dimensionless Indoor_Max_Noise "Max Noise Today [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxNoise" } +Number:Dimensionless Indoor_Max_Noise_This_Week "Max Noise This Week [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxNoiseThisWeek" } +Number:Dimensionless Indoor_Max_Noise_This_Month "Max Noise This Month [%.1f %unit%]" { channel = "netatmo:NAMain:home:inside:MaxNoiseThisMonth" } +DateTime Indoor_Min_Noise_TS "Min Noise Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinNoise" } +DateTime Indoor_Min_Noise_This_Week_TS "Min Noise This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinNoiseThisWeek" } +DateTime Indoor_Min_Noise_This_Month_TS "Min Noise This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMinNoiseThisMonth" } +DateTime Indoor_Max_Noise_TS "Max Noise Today [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxNoise" } +DateTime Indoor_Max_Noise_This_Week_TS "Max Noise This Week [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxNoiseThisWeek" } +DateTime Indoor_Max_Noise_This_Month_TS "Max Noise This Month [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:DateMaxNoiseThisMonth" } +Number Indoor_WifiStatus "WifiStatus [%s]" { channel = "netatmo:NAMain:home:inside:WifiStatus" } +DateTime Indoor_TimeStamp "TimeStamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:TimeStamp" } +Location Indoor_Location "Location" { channel = "netatmo:NAMain:home:inside:Location" } +DateTime Indoor_LastStatusStore "LastStatusStore [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAMain:home:inside:LastStatusStore" } # Outdoor Module -Number:Temperature Netatmo_Outdoor_Temperature "Temperature [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:Temperature" } -String Netatmo_Outdoor_TempTrend "TempTrend [%s]" { channel = "netatmo:NAModule1:home:outside:TempTrend" } -Number:Dimensionless Netatmo_Outdoor_Humidity "Humidity [%d %unit%]" { channel = "netatmo:NAModule1:home:outside:Humidity" } -Number Netatmo_Outdoor_Humidex "Humidex [%.0f]" { channel = "netatmo:NAModule1:home:outside:Humidex" } -Number:Temperature Netatmo_Outdoor_HeatIndex "HeatIndex [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:HeatIndex" } -Number:Temperature Netatmo_Outdoor_Dewpoint "Dewpoint [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:Dewpoint" } -Number:Temperature Netatmo_Outdoor_DewpointDepression "DewpointDepression [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:DewpointDepression" } -Number Netatmo_Outdoor_RfStatus "RfStatus [%.0f / 5]" { channel = "netatmo:NAModule1:home:outside:RfStatus" } -Switch Netatmo_Outdoor_LowBattery "LowBattery [%s]" { channel = "netatmo:NAModule1:home:outside:LowBattery" } -Number Netatmo_Outdoor_BatteryVP "BatteryVP [%.0f %%]" { channel = "netatmo:NAModule1:home:outside:BatteryVP" } -DateTime Netatmo_Outdoor_TimeStamp "TimeStamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAModule1:home:outside:TimeStamp" } -DateTime Netatmo_Outdoor_LastMessage "LastMessage [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAModule1:home:outside:LastMessage" } +Number:Temperature Outdoor_Temperature "Temperature [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:Temperature" } +String Outdoor_TempTrend "TempTrend [%s]" { channel = "netatmo:NAModule1:home:outside:TempTrend" } +Number:Dimensionless Outdoor_Humidity "Humidity [%d %unit%]" { channel = "netatmo:NAModule1:home:outside:Humidity" } +Number Outdoor_Humidex "Humidex [%.0f]" { channel = "netatmo:NAModule1:home:outside:Humidex" } +Number:Temperature Outdoor_HeatIndex "HeatIndex [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:HeatIndex" } +Number:Temperature Outdoor_Dewpoint "Dewpoint [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:Dewpoint" } +Number:Temperature Outdoor_DewpointDepression "DewpointDepression [%.1f %unit%]" { channel = "netatmo:NAModule1:home:outside:DewpointDepression" } +Number Outdoor_RfStatus "RfStatus [%.0f / 5]" { channel = "netatmo:NAModule1:home:outside:RfStatus" } +Switch Outdoor_LowBattery "LowBattery [%s]" { channel = "netatmo:NAModule1:home:outside:LowBattery" } +Number Outdoor_BatteryVP "BatteryVP [%.0f %%]" { channel = "netatmo:NAModule1:home:outside:BatteryVP" } +DateTime Outdoor_TimeStamp "TimeStamp [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAModule1:home:outside:TimeStamp" } +DateTime Outdoor_LastMessage "LastMessage [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel = "netatmo:NAModule1:home:outside:LastMessage" } + +# Rain Module +Number:Length Rain_Hour "Rain Last Hour [%.02f %unit%]" {channel="netatmo:NAModule3:home:rain:SumRain1"} +Number:Length Rain_Today "Rain Today [%.02f %unit%]" {channel="netatmo:NAModule3:home:rain:SumRain24"} +Number:Length Rain_Week "Rain This Week [%.02f %unit%]" {channel="netatmo:NAModule3:home:rain:SumRainThisWeek"} +Number:Length Rain_Month "Rain This Month [%.02f %unit%]" {channel="netatmo:NAModule3:home:rain:SumRainThisMonth"} +Number Rain_BatteryVP "Rain battery status [%d%%]" {channel="netatmo:NAModule3:home:rain:BatteryVP"} ``` ## sitemaps/netatmo.sitemap ``` -sitemap netatmo label="Netatmo" -{ +sitemap netatmo label="Netatmo" { Frame label="Indoor" { - Text item=Netatmo_Indoor_Temperature - Text item=Netatmo_Indoor_Humidity - Text item=Netatmo_Indoor_Humidex valuecolor=[<20.1="green",<29.1="blue",<28.1="yellow",<45.1="orange",<54.1="red",>54.1="maroon"] - Text item=Netatmo_Indoor_HeatIndex - Text item=Netatmo_Indoor_Dewpoint - Text item=Netatmo_Indoor_DewpointDepression - Text item=Netatmo_Indoor_Co2 valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] - Text item=Netatmo_Indoor_Pressure - Text item=Netatmo_Indoor_AbsolutePressure - Text item=Netatmo_Indoor_Noise - Text item=Netatmo_Indoor_WifiStatus - Text item=Netatmo_Indoor_TimeStamp - Text item=Netatmo_Indoor_Location - Text item=Netatmo_Indoor_LastStatusStore + Text item=Indoor_Temp + Text item=Indoor_Min_Temp + Text item=Indoor_Min_Temp_This_Week + Text item=Indoor_Min_Temp_This_Month + Text item=Indoor_Max_Temp + Text item=Indoor_Max_Temp_This_Week + Text item=Indoor_Max_Temp_This_Month + Text item=Indoor_Min_Temp_TS + Text item=Indoor_Min_Temp_This_Week_TS + Text item=Indoor_Min_Temp_This_Month_TS + Text item=Indoor_Max_Temp_TS + Text item=Indoor_Max_Temp_This_Week_TS + Text item=Indoor_Max_Temp_This_Month_TS + Text item=Indoor_Humidity + Text item=Indoor_Min_Humidity + Text item=Indoor_Min_Humidity_This_Week + Text item=Indoor_Min_Humidity_This_Month + Text item=Indoor_Max_Humidity + Text item=Indoor_Max_Humidity_This_Week + Text item=Indoor_Max_Humidity_This_Month + Text item=Indoor_Min_Humidity_TS + Text item=Indoor_Min_Humidity_This_Week_TS + Text item=Indoor_Min_Humidity_This_Month_TS + Text item=Indoor_Max_Humidity_TS + Text item=Indoor_Max_Humidity_This_Week_TS + Text item=Indoor_Max_Humidity_This_Month_TS + Text item=Indoor_Humidex valuecolor=[<20.1="green",<29.1="blue",<28.1="yellow",<45.1="orange",<54.1="red",>54.1="maroon"] + Text item=Indoor_HeatIndex + Text item=Indoor_Dewpoint + Text item=Indoor_DewpointDepression + Text item=Indoor_Co2 valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Min_Co2 valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Min_Co2_This_Week valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Min_Co2_This_Month valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Max_Co2 valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Max_Co2_This_Week valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Max_Co2_This_Month valuecolor=[<800="green",<1000="orange",<1400="red",>1399="maroon"] + Text item=Indoor_Min_Co2_TS + Text item=Indoor_Min_Co2_This_Week_TS + Text item=Indoor_Min_Co2_This_Month_TS + Text item=Indoor_Max_Co2_TS + Text item=Indoor_Max_Co2_This_Week_TS + Text item=Indoor_Max_Co2_This_Month_TS + Text item=Indoor_Pressure + Text item=Indoor_Min_Pressure + Text item=Indoor_Min_Pressure_This_Week + Text item=Indoor_Min_Pressure_This_Month + Text item=Indoor_Max_Pressure + Text item=Indoor_Max_Pressure_This_Week + Text item=Indoor_Max_Pressure_This_Month + Text item=Indoor_Min_Pressure_TS + Text item=Indoor_Min_Pressure_This_Week_TS + Text item=Indoor_Min_Pressure_This_Month_TS + Text item=Indoor_Max_Pressure_TS + Text item=Indoor_Max_Pressure_This_Week_TS + Text item=Indoor_Max_Pressure_This_Month_TS + Text item=Indoor_AbsolutePressure + Text item=Indoor_Noise + Text item=Indoor_Min_Noise + Text item=Indoor_Min_Noise_This_Week + Text item=Indoor_Min_Noise_This_Month + Text item=Indoor_Max_Noise + Text item=Indoor_Max_Noise_This_Week + Text item=Indoor_Max_Noise_This_Month + Text item=Indoor_Min_Noise_TS + Text item=Indoor_Min_Noise_This_Week_TS + Text item=Indoor_Min_Noise_This_Month_TS + Text item=Indoor_Max_Noise_TS + Text item=Indoor_Max_Noise_This_Week_TS + Text item=Indoor_Max_Noise_This_Month_TS + Text item=Indoor_WifiStatus + Text item=Indoor_TimeStamp + Text item=Indoor_Location + Text item=Indoor_LastStatusStore + } + Frame label="Outdoor" { + Text item=Outdoor_Temperature + Text item=Outdoor_TempTrend + Text item=Outdoor_Humidity + Text item=Outdoor_Humidex valuecolor=[<20.1="green",<29.1="blue",<28.1="yellow",<45.1="orange",<54.1="red",>54.1="maroon"] + Text item=Outdoor_HeatIndex + Text item=Outdoor_Dewpoint + Text item=Outdoor_DewpointDepression + Text item=Outdoor_RfStatus + Text item=Outdoor_LowBattery + Text item=Outdoor_BatteryVP + Text item=Outdoor_TimeStamp + Text item=Outdoor_LastMessage } - Frame label="Outdoor" { - Text item=Netatmo_Outdoor_Temperature - Text item=Netatmo_Outdoor_TempTrend - Text item=Netatmo_Outdoor_Humidity - Text item=Netatmo_Outdoor_Humidex - Text item=Netatmo_Outdoor_HeatIndex - Text item=Netatmo_Outdoor_Dewpoint - Text item=Netatmo_Outdoor_DewpointDepression - Text item=Netatmo_Outdoor_RfStatus - Text item=Netatmo_Outdoor_LowBattery - Text item=Netatmo_Outdoor_BatteryVP valuecolor=[>60="green",>45="orange",>36="red",>0="maroon"] - Text item=Netatmo_Outdoor_TimeStamp - Text item=Netatmo_Outdoor_LastMessage + Frame label="Rain" { + Text item=Rain_Hour + Text item=Rain_Today + Text item=Rain_Week + Text item=Rain_Month + Text item=Rain_BatteryVP } } ``` -# Common problems - - -## Missing Certificate Authority - -This version of the binding has been modified to avoid the need to import StartCom certificate in the local JDK certificate store. - -``` -javax.net.ssl.SSLHandshakeException: -sun.security.validator.ValidatorException: -PKIX path building failed: -sun.security.provider.certpath.SunCertPathBuilderException: -unable to find valid certification path to requested target -``` - -can be solved by installing the StartCom CA Certificate into the local JDK like this: - -* Download the certificate from https://www.startssl.com/certs/ca.pem or use wget https://www.startssl.com/certs/ca.pem -* Then import it into the keystore (the password is "changeit") - -``` -$JAVA_HOME/bin/keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias StartCom-Root-CA -file ca.pem -``` - -If `$JAVA_HOME` is not set then run the command: - -``` -update-alternatives --list java -``` - -This should output something similar to: - -``` -/usr/lib/jvm/java-8-oracle/jre/bin/java -``` - -Use everything before /jre/... to set the JAVA_HOME environment variable: - -``` -export JAVA_HOME=/usr/lib/jvm/java-8-oracle -``` - -After you set the environment variable, try: - -``` -ls -l $JAVA_HOME/jre/lib/security/cacerts -``` - -If it is set correctly then you should see something similar to: - -``` --rw-r--r-- 1 root root 101992 Nov 4 10:54 /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -``` - -Now try and rerun the keytool command. -If you didn't get errors, you should be good to go [source](http://jinahya.wordpress.com/2013/04/28/installing-the-startcom-ca-certifcate-into-the-local-jdk/). - -Alternative approach if above solution does not work: - -``` -sudo keytool -delete -alias StartCom-Root-CA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -``` - -Download the certificate from https://api.netatmo.net to `$JAVA_HOME/jre/lib/security/` and save it as api.netatmo.net.crt (X.509 / PEM). - -``` -sudo $JAVA_HOME/bin/keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias StartCom-Root-CA -file api.netatmo.net.crt -``` - -The password is "changeit". - - # Sample data If you want to evaluate this binding but have not got a Netatmo station yourself diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java index 2b11702fe745c..b27d6e3554365 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java @@ -33,6 +33,8 @@ * This class holds various channel values conversion methods * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ @NonNullByDefault public class ChannelTypeUtils { @@ -46,6 +48,10 @@ public static ZonedDateTime toZonedDateTime(Integer netatmoTS) { return ZonedDateTime.ofInstant(i, ZoneId.systemDefault()); } + public static State toDateTimeType(@Nullable Float netatmoTS) { + return netatmoTS == null ? UnDefType.NULL : toDateTimeType(toZonedDateTime(netatmoTS.intValue())); + } + public static State toDateTimeType(@Nullable Integer netatmoTS) { return netatmoTS == null ? UnDefType.NULL : toDateTimeType(toZonedDateTime(netatmoTS)); } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java index e575b05764bf7..7c31dbe87c36d 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java @@ -25,6 +25,8 @@ * across the whole binding. * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ @NonNullByDefault public class NetatmoBindingConstants { @@ -41,6 +43,37 @@ public class NetatmoBindingConstants { public static final String WEBHOOK_APP = "app_security"; + // Scale for Weather Station /getmeasure + public static final String THIRTY_MINUTES = "30min"; + public static final String ONE_HOUR = "1hour"; + public static final String THREE_HOURS = "3hours"; + public static final String ONE_DAY = "1day"; + public static final String ONE_WEEK = "1week"; + public static final String ONE_MONTH = "1month"; + + // Type for Weather Station /getmeasure + public static final String DATE_MIN_CO2 = "date_min_co2"; + public static final String DATE_MAX_CO2 = "date_max_co2"; + public static final String DATE_MIN_HUM = "date_min_hum"; + public static final String DATE_MAX_HUM = "date_max_hum"; + public static final String DATE_MIN_NOISE = "date_min_noise"; + public static final String DATE_MAX_NOISE = "date_max_noise"; + public static final String DATE_MIN_PRESSURE = "date_min_pressure"; + public static final String DATE_MAX_PRESSURE = "date_max_pressure"; + public static final String DATE_MIN_TEMP = "date_min_temp"; + public static final String DATE_MAX_TEMP = "date_max_temp"; + public static final String MIN_CO2 = "min_co2"; + public static final String MAX_CO2 = "max_co2"; + public static final String MIN_HUM = "min_hum"; + public static final String MAX_HUM = "max_hum"; + public static final String MIN_NOISE = "min_noise"; + public static final String MAX_NOISE = "max_noise"; + public static final String MIN_PRESSURE = "min_pressure"; + public static final String MAX_PRESSURE = "max_pressure"; + public static final String MIN_TEMP = "min_temp"; + public static final String MAX_TEMP = "max_temp"; + public static final String SUM_RAIN = "sum_rain"; + // List of Bridge Type UIDs public static final ThingTypeUID APIBRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "netatmoapi"); @@ -67,6 +100,12 @@ public class NetatmoBindingConstants { public static final String CHANNEL_TEMPERATURE = "Temperature"; public static final String CHANNEL_TEMP_TREND = "TempTrend"; public static final String CHANNEL_HUMIDITY = "Humidity"; + public static final String CHANNEL_MAX_HUMIDITY = "MaxHumidity"; + public static final String CHANNEL_MAX_HUMIDITY_THIS_WEEK = "MaxHumidityThisWeek"; + public static final String CHANNEL_MAX_HUMIDITY_THIS_MONTH = "MaxHumidityThisMonth"; + public static final String CHANNEL_MIN_HUMIDITY = "MinHumidity"; + public static final String CHANNEL_MIN_HUMIDITY_THIS_WEEK = "MinHumidityThisWeek"; + public static final String CHANNEL_MIN_HUMIDITY_THIS_MONTH = "MinHumidityThisMonth"; public static final String CHANNEL_HUMIDEX = "Humidex"; public static final String CHANNEL_TIMEUTC = "TimeStamp"; public static final String CHANNEL_DEWPOINT = "Dewpoint"; @@ -75,18 +114,70 @@ public class NetatmoBindingConstants { public static final String CHANNEL_LAST_STATUS_STORE = "LastStatusStore"; public static final String CHANNEL_LAST_MESSAGE = "LastMessage"; public static final String CHANNEL_LOCATION = "Location"; + public static final String CHANNEL_DATE_MAX_CO2 = "DateMaxCo2"; + public static final String CHANNEL_DATE_MAX_CO2_THIS_WEEK = "DateMaxCo2ThisWeek"; + public static final String CHANNEL_DATE_MAX_CO2_THIS_MONTH = "DateMaxCo2ThisMonth"; + public static final String CHANNEL_DATE_MIN_CO2 = "DateMinCo2"; + public static final String CHANNEL_DATE_MIN_CO2_THIS_WEEK = "DateMinCo2ThisWeek"; + public static final String CHANNEL_DATE_MIN_CO2_THIS_MONTH = "DateMinCo2ThisMonth"; + public static final String CHANNEL_DATE_MAX_HUMIDITY = "DateMaxHumidity"; + public static final String CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK = "DateMaxHumidityThisWeek"; + public static final String CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH = "DateMaxHumidityThisMonth"; + public static final String CHANNEL_DATE_MIN_HUMIDITY = "DateMinHumidity"; + public static final String CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK = "DateMinHumidityThisWeek"; + public static final String CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH = "DateMinHumidityThisMonth"; + public static final String CHANNEL_DATE_MAX_NOISE = "DateMaxNoise"; + public static final String CHANNEL_DATE_MAX_NOISE_THIS_WEEK = "DateMaxNoiseThisWeek"; + public static final String CHANNEL_DATE_MAX_NOISE_THIS_MONTH = "DateMaxNoiseThisMonth"; + public static final String CHANNEL_DATE_MIN_NOISE = "DateMinNoise"; + public static final String CHANNEL_DATE_MIN_NOISE_THIS_WEEK = "DateMinNoiseThisWeek"; + public static final String CHANNEL_DATE_MIN_NOISE_THIS_MONTH = "DateMinNoiseThisMonth"; + public static final String CHANNEL_DATE_MAX_PRESSURE = "DateMaxPressure"; + public static final String CHANNEL_DATE_MAX_PRESSURE_THIS_WEEK = "DateMaxPressureThisWeek"; + public static final String CHANNEL_DATE_MAX_PRESSURE_THIS_MONTH = "DateMaxPressureThisMonth"; + public static final String CHANNEL_DATE_MIN_PRESSURE = "DateMinPressure"; + public static final String CHANNEL_DATE_MIN_PRESSURE_THIS_WEEK = "DateMinPressureThisWeek"; + public static final String CHANNEL_DATE_MIN_PRESSURE_THIS_MONTH = "DateMinPressureThisMonth"; public static final String CHANNEL_DATE_MAX_TEMP = "DateMaxTemp"; + public static final String CHANNEL_DATE_MAX_TEMP_THIS_WEEK = "DateMaxTempThisWeek"; + public static final String CHANNEL_DATE_MAX_TEMP_THIS_MONTH = "DateMaxTempThisMonth"; public static final String CHANNEL_DATE_MIN_TEMP = "DateMinTemp"; + public static final String CHANNEL_DATE_MIN_TEMP_THIS_WEEK = "DateMinTempThisWeek"; + public static final String CHANNEL_DATE_MIN_TEMP_THIS_MONTH = "DateMinTempThisMonth"; public static final String CHANNEL_MAX_TEMP = "MaxTemp"; + public static final String CHANNEL_MAX_TEMP_THIS_WEEK = "MaxTempThisWeek"; + public static final String CHANNEL_MAX_TEMP_THIS_MONTH = "MaxTempThisMonth"; public static final String CHANNEL_MIN_TEMP = "MinTemp"; + public static final String CHANNEL_MIN_TEMP_THIS_WEEK = "MinTempThisWeek"; + public static final String CHANNEL_MIN_TEMP_THIS_MONTH = "MinTempThisMonth"; public static final String CHANNEL_ABSOLUTE_PRESSURE = "AbsolutePressure"; public static final String CHANNEL_CO2 = "Co2"; + public static final String CHANNEL_MAX_CO2 = "MaxCo2"; + public static final String CHANNEL_MAX_CO2_THIS_WEEK = "MaxCo2ThisWeek"; + public static final String CHANNEL_MAX_CO2_THIS_MONTH = "MaxCo2ThisMonth"; + public static final String CHANNEL_MIN_CO2 = "MinCo2"; + public static final String CHANNEL_MIN_CO2_THIS_WEEK = "MinCo2ThisWeek"; + public static final String CHANNEL_MIN_CO2_THIS_MONTH = "MinCo2ThisMonth"; public static final String CHANNEL_NOISE = "Noise"; + public static final String CHANNEL_MAX_NOISE = "MaxNoise"; + public static final String CHANNEL_MAX_NOISE_THIS_WEEK = "MaxNoiseThisWeek"; + public static final String CHANNEL_MAX_NOISE_THIS_MONTH = "MaxNoiseThisMonth"; + public static final String CHANNEL_MIN_NOISE = "MinNoise"; + public static final String CHANNEL_MIN_NOISE_THIS_WEEK = "MinNoiseThisWeek"; + public static final String CHANNEL_MIN_NOISE_THIS_MONTH = "MinNoiseThisMonth"; public static final String CHANNEL_PRESSURE = "Pressure"; + public static final String CHANNEL_MAX_PRESSURE = "MaxPressure"; + public static final String CHANNEL_MAX_PRESSURE_THIS_WEEK = "MaxPressureThisWeek"; + public static final String CHANNEL_MAX_PRESSURE_THIS_MONTH = "MaxPressureThisMonth"; + public static final String CHANNEL_MIN_PRESSURE = "MinPressure"; + public static final String CHANNEL_MIN_PRESSURE_THIS_WEEK = "MinPressureThisWeek"; + public static final String CHANNEL_MIN_PRESSURE_THIS_MONTH = "MinPressureThisMonth"; public static final String CHANNEL_PRESS_TREND = "PressTrend"; public static final String CHANNEL_RAIN = "Rain"; public static final String CHANNEL_SUM_RAIN1 = "SumRain1"; public static final String CHANNEL_SUM_RAIN24 = "SumRain24"; + public static final String CHANNEL_SUM_RAIN_THIS_WEEK = "SumRainThisWeek"; + public static final String CHANNEL_SUM_RAIN_THIS_MONTH = "SumRainThisMonth"; public static final String CHANNEL_WIND_ANGLE = "WindAngle"; public static final String CHANNEL_WIND_STRENGTH = "WindStrength"; public static final String CHANNEL_MAX_WIND_STRENGTH = "MaxWindStrength"; diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java index 5c6424ca538e4..8ee52bcfafdf1 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java @@ -15,6 +15,7 @@ import static org.eclipse.smarthome.core.library.unit.MetricPrefix.*; import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; +import java.util.List; import java.util.Map; import java.util.Optional; @@ -27,6 +28,7 @@ import javax.measure.quantity.Temperature; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.library.unit.SIUnits; import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; @@ -51,6 +53,7 @@ * common behaviors of all netatmo things * * @author Gaël L'hopital - Initial contribution OH2 version + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules * */ public abstract class AbstractNetatmoThingHandler extends BaseThingHandler { @@ -174,4 +177,31 @@ protected void updateProperties(Integer firmware, String modelId) { } updateProperties(properties); } + + public void updateMeasurements() { + } + + public void getMeasurements(NetatmoBridgeHandler handler, String device, @Nullable String module, String scale, + List types, List channels, Map channelMeasurements) { + if (types.size() != channels.size()) { + throw new IllegalArgumentException("types and channels lists are different sizes."); + } + + List measurements = handler.getStationMeasureResponses(device, module, scale, types); + if (measurements.size() != types.size()) { + throw new IllegalArgumentException("types and measurements lists are different sizes."); + } + + int i = 0; + for (Float measurement : measurements) { + channelMeasurements.put(channels.get(i++), measurement); + } + } + + public void addMeasurement(List channels, List types, String channel, String type) { + if (isLinked(channel)) { + channels.add(channel); + types.add(type); + } + } } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java index ffd7c8503b774..f3045a45262ee 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java @@ -15,6 +15,7 @@ import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -46,6 +47,7 @@ import com.squareup.okhttp.OkHttpClient; import io.swagger.client.ApiClient; +import io.swagger.client.CollectionFormats.CSVParams; import io.swagger.client.api.HealthyhomecoachApi; import io.swagger.client.api.PartnerApi; import io.swagger.client.api.StationApi; @@ -54,6 +56,7 @@ import io.swagger.client.auth.OAuth; import io.swagger.client.auth.OAuthFlow; import io.swagger.client.model.NAHealthyHomeCoachDataBody; +import io.swagger.client.model.NAMeasureBodyElem; import io.swagger.client.model.NAStationDataBody; import io.swagger.client.model.NAThermostatDataBody; import io.swagger.client.model.NAWelcomeHomeData; @@ -67,6 +70,7 @@ * {@link NetatmoBridgeHandler} to request informations about their status * * @author Gaël L'hopital - Initial contribution OH2 version + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules * */ public class NetatmoBridgeHandler extends BaseBridgeHandler { @@ -257,6 +261,15 @@ public NAStationDataBody getStationsDataBody(String equipmentId) { return data; } + public List getStationMeasureResponses(String equipmentId, String moduleId, String scale, + List<@NonNull String> types) { + List data = getStationApi() + .getmeasure(equipmentId, scale, new CSVParams(types), moduleId, null, "last", 1, true, false).getBody(); + updateStatus(ThingStatus.ONLINE); + NAMeasureBodyElem element = data.get(0); + return element != null ? element.getValue().get(0) : Collections.emptyList(); + } + public NAHealthyHomeCoachDataBody getHomecoachDataBody(String equipmentId) { NAHealthyHomeCoachDataBody data = getHomeCoachApi().gethomecoachsdata(equipmentId).getBody(); updateStatus(ThingStatus.ONLINE); diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java index 9be83c2a3355f..e944c3f21320a 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java @@ -15,11 +15,19 @@ import static org.openhab.binding.netatmo.internal.ChannelTypeUtils.*; import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.State; import org.openhab.binding.netatmo.internal.WeatherUtils; +import org.openhab.binding.netatmo.internal.handler.AbstractNetatmoThingHandler; import org.openhab.binding.netatmo.internal.handler.NetatmoDeviceHandler; +import org.openhab.binding.netatmo.internal.handler.NetatmoModuleHandler; import io.swagger.client.model.NADashboardData; import io.swagger.client.model.NAMain; @@ -30,8 +38,11 @@ * weather station equipments (both modules and devices) * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ public class NAMainHandler extends NetatmoDeviceHandler { + private Map channelMeasurements = new ConcurrentHashMap<>(); public NAMainHandler(Thing thing) { super(thing); @@ -48,6 +59,16 @@ protected NAMain updateReadings() { result.getModules().forEach(child -> childs.put(child.getId(), child)); } } + + updateMeasurements(); + + childs.keySet().forEach((childId) -> { + Optional childHandler = getBridgeHandler().findNAThing(childId); + childHandler.map(NetatmoModuleHandler.class::cast).ifPresent(naChildModule -> { + naChildModule.updateMeasurements(); + }); + }); + return result; } @@ -56,6 +77,93 @@ protected void updateProperties(NAMain deviceData) { updateProperties(deviceData.getFirmware(), deviceData.getType()); } + @Override + public void updateMeasurements() { + updateDayMeasurements(); + updateWeekMeasurements(); + updateMonthMeasurements(); + } + + private void updateDayMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_NOISE, MIN_NOISE); + addMeasurement(channels, types, CHANNEL_MAX_NOISE, MAX_NOISE); + addMeasurement(channels, types, CHANNEL_MIN_PRESSURE, MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_MAX_PRESSURE, MAX_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_NOISE, DATE_MIN_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_NOISE, DATE_MAX_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_PRESSURE, DATE_MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_PRESSURE, DATE_MAX_PRESSURE); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getId(), null, ONE_DAY, types, channels, channelMeasurements); + } + } + + private void updateWeekMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2_THIS_WEEK, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2_THIS_WEEK, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_WEEK, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_WEEK, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_NOISE_THIS_WEEK, MIN_NOISE); + addMeasurement(channels, types, CHANNEL_MAX_NOISE_THIS_WEEK, MAX_NOISE); + addMeasurement(channels, types, CHANNEL_MIN_PRESSURE_THIS_WEEK, MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_MAX_PRESSURE_THIS_WEEK, MAX_PRESSURE); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_WEEK, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_WEEK, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2_THIS_WEEK, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2_THIS_WEEK, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_NOISE_THIS_WEEK, DATE_MIN_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_NOISE_THIS_WEEK, DATE_MAX_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_PRESSURE_THIS_WEEK, DATE_MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_PRESSURE_THIS_WEEK, DATE_MAX_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_WEEK, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_WEEK, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getId(), null, ONE_WEEK, types, channels, channelMeasurements); + } + } + + private void updateMonthMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2_THIS_MONTH, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2_THIS_MONTH, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_MONTH, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_MONTH, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_NOISE_THIS_MONTH, MIN_NOISE); + addMeasurement(channels, types, CHANNEL_MAX_NOISE_THIS_MONTH, MAX_NOISE); + addMeasurement(channels, types, CHANNEL_MIN_PRESSURE_THIS_MONTH, MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_MAX_PRESSURE_THIS_MONTH, MAX_PRESSURE); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_MONTH, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_MONTH, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2_THIS_MONTH, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2_THIS_MONTH, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_NOISE_THIS_MONTH, DATE_MIN_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_NOISE_THIS_MONTH, DATE_MAX_NOISE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_PRESSURE_THIS_MONTH, DATE_MIN_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MAX_PRESSURE_THIS_MONTH, DATE_MAX_PRESSURE); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_MONTH, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_MONTH, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getId(), null, ONE_MONTH, types, channels, channelMeasurements); + } + } + @Override protected State getNAThingProperty(String channelId) { if (device != null) { @@ -107,6 +215,72 @@ protected State getNAThingProperty(String channelId) { } } } + + switch (channelId) { + case CHANNEL_MIN_CO2: + case CHANNEL_MIN_CO2_THIS_WEEK: + case CHANNEL_MIN_CO2_THIS_MONTH: + case CHANNEL_MAX_CO2: + case CHANNEL_MAX_CO2_THIS_WEEK: + case CHANNEL_MAX_CO2_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_CO2_UNIT); + case CHANNEL_MIN_HUMIDITY: + case CHANNEL_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_MAX_HUMIDITY: + case CHANNEL_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_MAX_HUMIDITY_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_HUMIDITY_UNIT); + case CHANNEL_MIN_NOISE: + case CHANNEL_MIN_NOISE_THIS_WEEK: + case CHANNEL_MIN_NOISE_THIS_MONTH: + case CHANNEL_MAX_NOISE: + case CHANNEL_MAX_NOISE_THIS_WEEK: + case CHANNEL_MAX_NOISE_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_NOISE_UNIT); + case CHANNEL_MIN_PRESSURE: + case CHANNEL_MIN_PRESSURE_THIS_WEEK: + case CHANNEL_MIN_PRESSURE_THIS_MONTH: + case CHANNEL_MAX_PRESSURE: + case CHANNEL_MAX_PRESSURE_THIS_WEEK: + case CHANNEL_MAX_PRESSURE_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_PRESSURE_UNIT); + case CHANNEL_MIN_TEMP_THIS_WEEK: + case CHANNEL_MIN_TEMP_THIS_MONTH: + case CHANNEL_MAX_TEMP_THIS_WEEK: + case CHANNEL_MAX_TEMP_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_TEMPERATURE_UNIT); + case CHANNEL_DATE_MIN_CO2: + case CHANNEL_DATE_MIN_CO2_THIS_WEEK: + case CHANNEL_DATE_MIN_CO2_THIS_MONTH: + case CHANNEL_DATE_MAX_CO2: + case CHANNEL_DATE_MAX_CO2_THIS_WEEK: + case CHANNEL_DATE_MAX_CO2_THIS_MONTH: + case CHANNEL_DATE_MIN_NOISE: + case CHANNEL_DATE_MIN_NOISE_THIS_WEEK: + case CHANNEL_DATE_MIN_NOISE_THIS_MONTH: + case CHANNEL_DATE_MAX_NOISE: + case CHANNEL_DATE_MAX_NOISE_THIS_WEEK: + case CHANNEL_DATE_MAX_NOISE_THIS_MONTH: + case CHANNEL_DATE_MIN_HUMIDITY: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MAX_HUMIDITY: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MIN_PRESSURE: + case CHANNEL_DATE_MIN_PRESSURE_THIS_WEEK: + case CHANNEL_DATE_MIN_PRESSURE_THIS_MONTH: + case CHANNEL_DATE_MAX_PRESSURE: + case CHANNEL_DATE_MAX_PRESSURE_THIS_WEEK: + case CHANNEL_DATE_MAX_PRESSURE_THIS_MONTH: + case CHANNEL_DATE_MIN_TEMP_THIS_WEEK: + case CHANNEL_DATE_MIN_TEMP_THIS_MONTH: + case CHANNEL_DATE_MAX_TEMP_THIS_WEEK: + case CHANNEL_DATE_MAX_TEMP_THIS_MONTH: + return toDateTimeType(channelMeasurements.get(channelId)); + } + return super.getNAThingProperty(channelId); } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java index 3f883d790e2eb..e570ac9f74258 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java @@ -15,6 +15,11 @@ import static org.openhab.binding.netatmo.internal.ChannelTypeUtils.*; import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.State; import org.openhab.binding.netatmo.internal.WeatherUtils; @@ -28,8 +33,11 @@ * capable of reporting temperature and humidity * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ public class NAModule1Handler extends NetatmoModuleHandler { + private Map channelMeasurements = new ConcurrentHashMap<>(); public NAModule1Handler(Thing thing) { super(thing); @@ -40,6 +48,58 @@ protected void updateProperties(NAStationModule moduleData) { updateProperties(moduleData.getFirmware(), moduleData.getType()); } + @Override + public void updateMeasurements() { + updateDayMeasurements(); + updateWeekMeasurements(); + updateMonthMeasurements(); + } + + private void updateDayMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY, MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY, DATE_MAX_HUM); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_DAY, types, channels, channelMeasurements); + } + } + + private void updateWeekMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_WEEK, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_WEEK, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_WEEK, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_WEEK, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_WEEK, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_WEEK, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_WEEK, types, channels, channelMeasurements); + } + } + + private void updateMonthMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_MONTH, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_MONTH, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_MONTH, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_MONTH, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_MONTH, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_MONTH, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_MONTH, types, channels, + channelMeasurements); + } + } + @Override protected State getNAThingProperty(String channelId) { if (module != null) { @@ -81,6 +141,33 @@ protected State getNAThingProperty(String channelId) { } } } + + switch (channelId) { + case CHANNEL_MIN_HUMIDITY: + case CHANNEL_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_MAX_HUMIDITY: + case CHANNEL_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_MAX_HUMIDITY_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_HUMIDITY_UNIT); + case CHANNEL_MIN_TEMP_THIS_WEEK: + case CHANNEL_MIN_TEMP_THIS_MONTH: + case CHANNEL_MAX_TEMP_THIS_WEEK: + case CHANNEL_MAX_TEMP_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_TEMPERATURE_UNIT); + case CHANNEL_DATE_MIN_HUMIDITY: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MAX_HUMIDITY: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MIN_TEMP_THIS_WEEK: + case CHANNEL_DATE_MIN_TEMP_THIS_MONTH: + case CHANNEL_DATE_MAX_TEMP_THIS_WEEK: + case CHANNEL_DATE_MAX_TEMP_THIS_MONTH: + return toDateTimeType(channelMeasurements.get(channelId)); + } + return super.getNAThingProperty(channelId); } } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java index 65e9d23e0eae9..27ae505b6baf7 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java @@ -15,6 +15,12 @@ import static org.openhab.binding.netatmo.internal.ChannelTypeUtils.*; import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.State; import org.openhab.binding.netatmo.internal.handler.NetatmoModuleHandler; @@ -27,8 +33,11 @@ * capable of measuring precipitation * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ public class NAModule3Handler extends NetatmoModuleHandler { + private Map channelMeasurements = new ConcurrentHashMap<>(); public NAModule3Handler(Thing thing) { super(thing); @@ -39,6 +48,21 @@ protected void updateProperties(NAStationModule moduleData) { updateProperties(moduleData.getFirmware(), moduleData.getType()); } + @Override + public void updateMeasurements() { + List<@NonNull String> types = Arrays.asList(SUM_RAIN); + + if (isLinked(CHANNEL_SUM_RAIN_THIS_WEEK)) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_WEEK, types, + Arrays.asList(CHANNEL_SUM_RAIN_THIS_WEEK), channelMeasurements); + } + + if (isLinked(CHANNEL_SUM_RAIN_THIS_MONTH)) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_MONTH, types, + Arrays.asList(CHANNEL_SUM_RAIN_THIS_MONTH), channelMeasurements); + } + } + @Override protected State getNAThingProperty(String channelId) { if (module != null) { @@ -56,6 +80,13 @@ protected State getNAThingProperty(String channelId) { } } } + + switch (channelId) { + case CHANNEL_SUM_RAIN_THIS_WEEK: + case CHANNEL_SUM_RAIN_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_RAIN_UNIT); + } + return super.getNAThingProperty(channelId); } } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java index 4cd92c068aae8..d6af322edb830 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java @@ -15,6 +15,11 @@ import static org.openhab.binding.netatmo.internal.ChannelTypeUtils.*; import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.State; import org.openhab.binding.netatmo.internal.WeatherUtils; @@ -28,8 +33,11 @@ * indoor module capable of reporting temperature, humidity and CO2 level * * @author Gaël L'hopital - Initial contribution + * @author Rob Nielsen - Added day, week, and month measurements to the weather station and modules + * */ public class NAModule4Handler extends NetatmoModuleHandler { + private Map channelMeasurements = new ConcurrentHashMap<>(); public NAModule4Handler(Thing thing) { super(thing); @@ -40,6 +48,70 @@ protected void updateProperties(NAStationModule moduleData) { updateProperties(moduleData.getFirmware(), moduleData.getType()); } + @Override + public void updateMeasurements() { + updateDayMeasurements(); + updateWeekMeasurements(); + updateMonthMeasurements(); + } + + private void updateDayMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY, MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY, DATE_MAX_HUM); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_DAY, types, channels, channelMeasurements); + } + } + + private void updateWeekMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2_THIS_WEEK, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2_THIS_WEEK, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_WEEK, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_WEEK, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_WEEK, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_WEEK, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2_THIS_WEEK, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2_THIS_WEEK, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_WEEK, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_WEEK, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_WEEK, types, channels, channelMeasurements); + } + } + + private void updateMonthMeasurements() { + List channels = new ArrayList<>(); + List types = new ArrayList<>(); + addMeasurement(channels, types, CHANNEL_MIN_CO2_THIS_MONTH, MIN_CO2); + addMeasurement(channels, types, CHANNEL_MAX_CO2_THIS_MONTH, MAX_CO2); + addMeasurement(channels, types, CHANNEL_MIN_HUMIDITY_THIS_MONTH, MIN_HUM); + addMeasurement(channels, types, CHANNEL_MAX_HUMIDITY_THIS_MONTH, MAX_HUM); + addMeasurement(channels, types, CHANNEL_MIN_TEMP_THIS_MONTH, MIN_TEMP); + addMeasurement(channels, types, CHANNEL_MAX_TEMP_THIS_MONTH, MAX_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MIN_CO2_THIS_MONTH, DATE_MIN_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MAX_CO2_THIS_MONTH, DATE_MAX_CO2); + addMeasurement(channels, types, CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH, DATE_MIN_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH, DATE_MAX_HUM); + addMeasurement(channels, types, CHANNEL_DATE_MIN_TEMP_THIS_MONTH, DATE_MIN_TEMP); + addMeasurement(channels, types, CHANNEL_DATE_MAX_TEMP_THIS_MONTH, DATE_MAX_TEMP); + if (!channels.isEmpty()) { + getMeasurements(getBridgeHandler(), getParentId(), getId(), ONE_MONTH, types, channels, + channelMeasurements); + } + } + @Override protected State getNAThingProperty(String channelId) { if (module != null) { @@ -83,6 +155,46 @@ protected State getNAThingProperty(String channelId) { } } } + + switch (channelId) { + case CHANNEL_MIN_CO2: + case CHANNEL_MIN_CO2_THIS_WEEK: + case CHANNEL_MIN_CO2_THIS_MONTH: + case CHANNEL_MAX_CO2: + case CHANNEL_MAX_CO2_THIS_WEEK: + case CHANNEL_MAX_CO2_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_CO2_UNIT); + case CHANNEL_MIN_HUMIDITY: + case CHANNEL_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_MAX_HUMIDITY: + case CHANNEL_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_MAX_HUMIDITY_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_HUMIDITY_UNIT); + case CHANNEL_MIN_TEMP_THIS_WEEK: + case CHANNEL_MIN_TEMP_THIS_MONTH: + case CHANNEL_MAX_TEMP_THIS_WEEK: + case CHANNEL_MAX_TEMP_THIS_MONTH: + return toQuantityType(channelMeasurements.get(channelId), API_TEMPERATURE_UNIT); + case CHANNEL_DATE_MIN_CO2: + case CHANNEL_DATE_MIN_CO2_THIS_WEEK: + case CHANNEL_DATE_MIN_CO2_THIS_MONTH: + case CHANNEL_DATE_MAX_CO2: + case CHANNEL_DATE_MAX_CO2_THIS_WEEK: + case CHANNEL_DATE_MAX_CO2_THIS_MONTH: + case CHANNEL_DATE_MIN_HUMIDITY: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MIN_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MAX_HUMIDITY: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_WEEK: + case CHANNEL_DATE_MAX_HUMIDITY_THIS_MONTH: + case CHANNEL_DATE_MIN_TEMP_THIS_WEEK: + case CHANNEL_DATE_MIN_TEMP_THIS_MONTH: + case CHANNEL_DATE_MAX_TEMP_THIS_WEEK: + case CHANNEL_DATE_MAX_TEMP_THIS_MONTH: + return toDateTimeType(channelMeasurements.get(channelId)); + } + return super.getNAThingProperty(channelId); } } diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml index f0a91f7d47853..c02f86bb64983 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml @@ -1,5 +1,6 @@ - @@ -33,6 +34,22 @@ + + Number:Temperature + + Minimum Temperature this week + Temperature + + + + + Number:Temperature + + Minimum Temperature this month + Temperature + + + Number:Temperature @@ -41,6 +58,22 @@ + + Number:Temperature + + Maximum Temperature this week + Temperature + + + + + Number:Temperature + + Maximum Temperature this month + Temperature + + + String @@ -107,6 +140,48 @@ + + DateTime + + Date when minimum CO2 was reached on current day + + + + + DateTime + + Date when minimum CO2 was reached this week + + + + + DateTime + + Date when minimum CO2 was reached this month + + + + + DateTime + + Date when maximum CO2 was reached on current day + + + + + DateTime + + Date when maximum CO2 was reached this week + + + + + DateTime + + Date when maximum CO2 was reached this month + + + DateTime @@ -114,6 +189,20 @@ + + DateTime + + Date when minimum temperature was reached this week + + + + + DateTime + + Date when minimum temperature was reached this month + + + DateTime @@ -121,6 +210,146 @@ + + DateTime + + Date when maximum temperature was reached this week + + + + + DateTime + + Date when maximum temperature was reached this month + + + + + DateTime + + Date when minimum humidity was reached on current day + + + + + DateTime + + Date when minimum humidity was reached this week + + + + + DateTime + + Date when minimum humidity was reached this month + + + + + DateTime + + Date when maximum humidity was reached on current day + + + + + DateTime + + Date when maximum humidity was reached this week + + + + + DateTime + + Date when maximum humidity was reached this month + + + + + DateTime + + Date when minimum noise was reached on current day + + + + + DateTime + + Date when minimum noise was reached this week + + + + + DateTime + + Date when minimum noise was reached this month + + + + + DateTime + + Date when maximum noise was reached on current day + + + + + DateTime + + Date when maximum noise was reached this week + + + + + DateTime + + Date when maximum noise was reached this month + + + + + DateTime + + Date when minimum pressure was reached on current day + + + + + DateTime + + Date when minimum pressure was reached this week + + + + + DateTime + + Date when minimum pressure was reached this month + + + + + DateTime + + Date when maximum pressure was reached on current day + + + + + DateTime + + Date when maximum pressure was reached this week + + + + + DateTime + + Date when maximum pressure was reached this month + + + DateTime @@ -162,6 +391,48 @@ + + Number:Dimensionless + + Minimum CO2 on current day + + + + + Number:Dimensionless + + Minimum CO2 this week + + + + + Number:Dimensionless + + Minimum CO2 this month + + + + + Number:Dimensionless + + Maximum CO2 on current day + + + + + Number:Dimensionless + + Maximum CO2 this week + + + + + Number:Dimensionless + + Maximum CO2 this month + + + Number:Dimensionless @@ -170,6 +441,54 @@ + + Number:Dimensionless + + Minimum Noise on current day + Noise + + + + + Number:Dimensionless + + Minimum Noise this week + Noise + + + + + Number:Dimensionless + + Minimum Noise this month + Noise + + + + + Number:Dimensionless + + Maximum Noise on current day + Noise + + + + + Number:Dimensionless + + Maximum Noise this week + Noise + + + + + Number:Dimensionless + + Maximum Noise this month + Noise + + + String @@ -193,6 +512,54 @@ + + Number:Pressure + + Minimum Pressure on current day + Pressure + + + + + Number:Pressure + + Minimum Pressure this week + Pressure + + + + + Number:Pressure + + Minimum Pressure this month + Pressure + + + + + Number:Pressure + + Maximum Pressure on current day + Pressure + + + + + Number:Pressure + + Maximum Pressure this week + Pressure + + + + + Number:Pressure + + Maximum Pressure this month + Pressure + + + String @@ -212,7 +579,7 @@ Heat planning currently used - + Number:Pressure @@ -230,6 +597,54 @@ + + Number:Dimensionless + + Minimum Humidity on current day + Humidity + + + + + Number:Dimensionless + + Minimum Humidity this week + Humidity + + + + + Number:Dimensionless + + Minimum Humidity this month + Humidity + + + + + Number:Dimensionless + + Maximum Humidity on current day + Humidity + + + + + Number:Dimensionless + + Minimum Humidity this week + Humidity + + + + + Number:Dimensionless + + Maximum Humidity this month + Humidity + + + Number @@ -285,6 +700,22 @@ + + Number:Length + + Quantity of water this week + Rain + + + + + Number:Length + + Quantity of water this month + Rain + + + Number:Angle diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml index 1f37077a063d1..977c85d16e4d4 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml @@ -13,33 +13,89 @@ This represents the main indoor module capable of reporting temperature,humidity,pressure,air quality and sound level - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + 86,71,56 auto - + id @@ -57,15 +113,35 @@ + + + + + + + + + + + + + + + + + + - + + + @@ -76,7 +152,7 @@ 90,80,70,60 3600,4500,6000 - + id @@ -95,9 +171,9 @@ - + - + @@ -108,7 +184,7 @@ 90,80,70,60 3950,4770,6000 - + id @@ -123,10 +199,12 @@ This represents the Rain Gauge capable of measuring precipitation - - - - + + + + + + @@ -137,7 +215,7 @@ 90,80,70,60 3600,4500,6000 - + id @@ -152,19 +230,51 @@ This represents an additional indoor module capable of reporting temperature, humidity and CO2 level - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + +