peledies / homebridge-ambient-weather-sensors

Apache License 2.0
2 stars 2 forks source link

Add AQIN sensor values #6

Open solmssen opened 9 months ago

solmssen commented 9 months ago

Is your feature request related to a problem? Please describe: I am delighted by the clean and easy usage of the plugin, but I am very interested in being able to expose more of the data my AWN system provides to Apple Home - currently we have temp, humidity, and solar radiation, and I would love to pull in the CO2 and PM2.5 and PM10 data from my AQIN sensor to HomeKit.

Describe the solution you'd like: Add these additional data types if and as supported by HomeKit - CO2, PM2.5, and PM10.

Describe alternatives you've considered: I've been thinking about trying to use a Siri Shortcut to read the API and parse the info.

Additional context: I have a WS-2000 with the AQIN sensor - when I call the API, the data section of the JSON looks like this:

    "lastData": {
        "aqi_pm25_24h_aqin": 17,
        "aqi_pm25_aqin": 8,
        "baromabsin": 29.636,
        "baromrelin": 29.636,
        "batt_co2": 1,
        "batt1": 1,
        "batt2": 1,
        "battin": 1,
        "battout": 1,
        "co2_in_24h_aqin": 685,
        "co2_in_aqin": 650,
        "dailyrainin": 0.181,
        "date": "2024-01-20T20:58:00.000Z",
        "dateutc": 1705784280000,
        "dewPoint": 52.41,
        "dewPoint1": 56.7,
        "dewPoint2": 57.4,
        "dewPointin": 58.2,
        "eventrainin": 0.181,
        "feelsLike": 55.6,
        "feelsLike1": 74.7,
        "feelsLike2": 73.3,
        "feelsLikein": 75.9,
        "hourlyrainin": 0,
        "humidity": 89,
        "humidity1": 53,
        "humidity2": 57,
        "humidityin": 54,
        "lastRain": "2024-01-20T20:40:00.000Z",
        "maxdailygust": 6.93,
        "monthlyrainin": 0.181,
        "pm_in_humidity_aqin": 54,
        "pm_in_temp_aqin": 77.5,
        "pm10_in_24h_aqin": 4.3,
        "pm10_in_aqin": 1.8,
        "pm25_in_24h_aqin": 4,
        "pm25_in_aqin": 1.8,
        "solarradiation": 124.46,
        "temp1f": 75,
        "temp2f": 73.6,
        "tempf": 55.6,
        "tempinf": 76.1,
        "tz": "America/Los_Angeles",
        "uv": 1,
        "weeklyrainin": 0.181,
        "winddir": 72,
        "winddir_avg10m": 66,
        "windgustmph": 6.93,
        "windspeedmph": 1.57,
        "yearlyrainin": 0.181
    },

So you're picking up the tempf, tempinf, temp1f, temp2f, and even the pm_in_temp_aqin (from the AQIN sensor!) values and exposing them to HomeKit, and the equivalent humidity values, and the solarradiation value. If there's a way to expose the aqi_pm25_aqin, co2_in_aqin, pm10_in_aqin, and pm25_in_aqin values in a way that makes sense, that would be really useful. Even just the CO2 would be great! You've mentioned adding the wind speed and direction, and the barometric pressure - this would also be lovely and I am looking forward to that.

Thanks again for your hard work on this plugin - it's really great!

solmssen commented 9 months ago

I added a lightning sensor, and if this is useful, it added the following items to the JSON:

        "batt_lightning": 0,
        "lightning_day": 0,
        "lightning_distance": 0.62,
        "lightning_hour": 0,