Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S40 Weather Support #271

Closed
PeteRager opened this issue Oct 3, 2023 · 5 comments · Fixed by #272
Closed

S40 Weather Support #271

PeteRager opened this issue Oct 3, 2023 · 5 comments · Fixed by #272

Comments

@PeteRager
Copy link
Owner

PeteRager commented Oct 3, 2023

The S40 makes weather data available and it would be helpful to have some of this information available in HA.

As a specific example, the dew point measurement - is used by the S40 to prevent external ventilation when the measurement is above the configured threshold - as a result having this data would allow better insite into why ventilation is not running.

The weather data includes current data for now, hourly data and 10 day forecast; as well as some environmental information (like dew point). Since hourly data and 10 day forecasts are already available in HA, there is limited value in providing it through this integration. The focus will be on providing the environmental data.

The full message is included at the end , the subset for the environmental data is here

                        "env": {
                            "airQuality": "moderate",
                            "tree": "moderate",
                            "weed": "moderate",
                            "grass": "moderate",
                            "mold": "high",
                            "uvIndex": "low",
                            "humidity": 84,
                            "windSpeed": 1.0,
                            "windSpeedK": 2.0,
                            "cloudCoverage": 97,
                            "Dewpoint": 64.0,
                            "DewpointC": 18.0
                        }

The proposed list of sensors is:

sensor.*_env_air_quality returns airQuality
States: "hazardous","very unhealthy", "unhealthy", "unhealthy sensitive", "moderate", "good"
Unavailable: airQuality == ("error");

sensor.*_env_tree returns tree
States: "low","moderate","high","very high", "extreme"
Unavailable: tree = "error";

sensor.*_env_grass returns grass
States: "low","moderate","high","very high", "extreme"
Unavailable: grass = "error";

sensor.*_env_mold returns mold
States: "low","moderate","high","very high", "extreme"
Unavailable: mold = "error";

sensor.*_env_dewpoint - returns Dewpoint or DewpointC based on HA active unit system

sensor.*_env_wind_speed - returns windSpeed or windSpeedK based on HA active unit system

sensor.*_env_uv_index - returns uvIndex

sensor.*_env_cloud_coverage returns cloudCoverage

sensor.*_env_humidity returns humidity

There is also an isValid member of the weather message - this will be used to control sensor availability. If isValid is false, sensors will be unavailable.

2023-09-21 17:11:22,383 [MainThread  ] [DEBUG]  {
    "messages": [
        {
            "MessageId": 0,
            "SenderID": "**redacted**",
            "TargetID": "homeassistant",
            "MessageType": "PropertyChange",
            "Data": {
                "weather": {
                    "publisher": {
                        "publisherName": "remote"
                    },
                    "status": {
                        "isValid": true,
                        "city": "**redacted**",
                        "state": "IL",
                        "current": [
                            {
                                "temperature": 69.0,
                                "temperatureC": 21.0,
                                "temperatureLow": 61.0,
                                "temperatureLowC": 16.0,
                                "temperatureHigh": 74.0,
                                "temperatureHighC": 23.0,
                                "iconId": 7,
                                "time": 1695331380,
                                "id": 0,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 98,
                                "atmosPressure": 30.15,
                                "rainProbability": 96,
                                "sunrise": 1695296340,
                                "sunset": 1695340320
                            }
                        ],
                        "hourly": [
                            {
                                "temperature": 70.0,
                                "temperatureC": 21.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 12,
                                "time": 1695333600,
                                "id": 0,
                                "iconDescription": "Rain showers",
                                "cloudCoverage": 97,
                                "atmosPressure": 0.0,
                                "rainProbability": 66,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 69.0,
                                "temperatureC": 21.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 4,
                                "time": 1695337200,
                                "id": 1,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 70,
                                "atmosPressure": 0.0,
                                "rainProbability": 49,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 68.0,
                                "temperatureC": 20.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 36,
                                "time": 1695340800,
                                "id": 2,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 70,
                                "atmosPressure": 0.0,
                                "rainProbability": 47,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 66.0,
                                "temperatureC": 19.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 38,
                                "time": 1695344400,
                                "id": 3,
                                "iconDescription": "Mostly cloudy",
                                "cloudCoverage": 89,
                                "atmosPressure": 0.0,
                                "rainProbability": 44,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 65.0,
                                "temperatureC": 18.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 7,
                                "time": 1695348000,
                                "id": 4,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 90,
                                "atmosPressure": 0.0,
                                "rainProbability": 48,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 64.0,
                                "temperatureC": 18.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 12,
                                "time": 1695351600,
                                "id": 5,
                                "iconDescription": "Rain showers",
                                "cloudCoverage": 93,
                                "atmosPressure": 0.0,
                                "rainProbability": 52,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 64.0,
                                "temperatureC": 18.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 7,
                                "time": 1695355200,
                                "id": 6,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 96,
                                "atmosPressure": 0.0,
                                "rainProbability": 43,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 64.0,
                                "temperatureC": 18.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 12,
                                "time": 1695358800,
                                "id": 7,
                                "iconDescription": "Rain showers",
                                "cloudCoverage": 98,
                                "atmosPressure": 0.0,
                                "rainProbability": 51,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 64.0,
                                "temperatureC": 18.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 7,
                                "time": 1695362400,
                                "id": 8,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 98,
                                "atmosPressure": 0.0,
                                "rainProbability": 43,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 63.0,
                                "temperatureC": 17.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 12,
                                "time": 1695366000,
                                "id": 9,
                                "iconDescription": "Rain showers",
                                "cloudCoverage": 96,
                                "atmosPressure": 0.0,
                                "rainProbability": 51,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 63.0,
                                "temperatureC": 17.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 7,
                                "time": 1695369600,
                                "id": 10,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 92,
                                "atmosPressure": 0.0,
                                "rainProbability": 47,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 63.0,
                                "temperatureC": 17.0,
                                "temperatureLow": 0.0,
                                "temperatureLowC": 0.0,
                                "temperatureHigh": 0.0,
                                "temperatureHighC": 0.0,
                                "iconId": 7,
                                "time": 1695373200,
                                "id": 11,
                                "iconDescription": "Cloudy",
                                "cloudCoverage": 90,
                                "atmosPressure": 0.0,
                                "rainProbability": 44,
                                "sunrise": null,
                                "sunset": null
                            }
                        ],
                        "daily": [
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 61.0,
                                "temperatureLowC": 16.0,
                                "temperatureHigh": 74.0,
                                "temperatureHighC": 23.0,
                                "iconId": 12,
                                "time": 1695297600,
                                "id": 0,
                                "iconDescription": "Rain showers",
                                "cloudCoverage": 91,
                                "atmosPressure": 0.0,
                                "rainProbability": 96,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 59.0,
                                "temperatureLowC": 15.0,
                                "temperatureHigh": 78.0,
                                "temperatureHighC": 26.0,
                                "iconId": 4,
                                "time": 1695384000,
                                "id": 1,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 68,
                                "atmosPressure": 0.0,
                                "rainProbability": 40,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 57.0,
                                "temperatureLowC": 14.0,
                                "temperatureHigh": 79.0,
                                "temperatureHighC": 26.0,
                                "iconId": 4,
                                "time": 1695470400,
                                "id": 2,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 46,
                                "atmosPressure": 0.0,
                                "rainProbability": 3,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 56.0,
                                "temperatureLowC": 13.0,
                                "temperatureHigh": 73.0,
                                "temperatureHighC": 23.0,
                                "iconId": 4,
                                "time": 1695556800,
                                "id": 3,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 50,
                                "atmosPressure": 0.0,
                                "rainProbability": 8,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 58.0,
                                "temperatureLowC": 14.0,
                                "temperatureHigh": 70.0,
                                "temperatureHighC": 21.0,
                                "iconId": 4,
                                "time": 1695643200,
                                "id": 4,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 79,
                                "atmosPressure": 0.0,
                                "rainProbability": 19,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 55.0,
                                "temperatureLowC": 13.0,
                                "temperatureHigh": 70.0,
                                "temperatureHighC": 21.0,
                                "iconId": 3,
                                "time": 1695729600,
                                "id": 5,
                                "iconDescription": "Partly cloudy",
                                "cloudCoverage": 31,
                                "atmosPressure": 0.0,
                                "rainProbability": 18,
                                "sunrise": null,
                                "sunset": null
                            },
                            {
                                "temperature": 0.0,
                                "temperatureC": 0.0,
                                "temperatureLow": 52.0,
                                "temperatureLowC": 11.0,
                                "temperatureHigh": 70.0,
                                "temperatureHighC": 21.0,
                                "iconId": 1,
                                "time": 1695816000,
                                "id": 6,
                                "iconDescription": "Clear",
                                "cloudCoverage": 0,
                                "atmosPressure": 0.0,
                                "rainProbability": 11,
                                "sunrise": null,
                                "sunset": null
                            }
                        ],
                        "env": {
                            "airQuality": "moderate",
                            "tree": "moderate",
                            "weed": "moderate",
                            "grass": "moderate",
                            "mold": "high",
                            "uvIndex": "low",
                            "humidity": 84,
                            "windSpeed": 1.0,
                            "windSpeedK": 2.0,
                            "cloudCoverage": 97,
                            "Dewpoint": 64.0,
                            "DewpointC": 18.0
                        }
                    }
                }
            }
        }
    ]
}
@stu247
Copy link

stu247 commented Oct 4, 2023

I like this. Do we know what are the valid values for the first four? From my log file I can see the following:

$ grep mold s40_local.log|sort -u
"mold": "high",
"mold": "low",
$ grep grass s40_local.log|sort -u
"grass": "moderate",
$ grep weed s40_local.log|sort -u
"weed": "low",
"weed": "moderate",
$ grep tree s40_local.log|sort -u
"tree": "low",
"tree": "moderate",
$ grep airQuality s40_local.log|sort -u
"airQuality": "good",
"airQuality": "moderate",
$

My assumption is that mold, grass, weed, and tree all have the same valid values, but airQuality has its own set of valid values.

@PeteRager
Copy link
Owner Author

PeteRager commented Oct 4, 2023

Great questions. I searched around in the the install app and found these:

Here are the constants for air quality

        AIRQUALITYHAZARDOUS("hazardous"),
        AIRQUALITYVERYUNHEALTHY("very unhealthy"),
        AIRQUALITYUNHEALTHY("unhealthy"),
        AIRQUALITYUNHEALTHYSENSITIVE("unhealthy sensitive"),
        AIRQUALITYMODERATE("moderate"),
        AIRQUALITYGOOD("good"),
        AIRQUALITYERROR("error");

Mold

        MOLDLOW("low"),
        MOLDMODERATE("moderate"),
        MOLDHIGH("high"),
        MOLDVERYHIGH("very high"),
        MOLDEXTREME("extreme"),
        MOLDERROR("error");

Tree

        TREELOW("low"),
        TREEMODERATE("moderate"),
        TREEHIGH("high"),
        TREEVERYHIGH("very high"),
        TREEEXTREME("extreme"),
        TREEERROR("error");

Grass

        GRASSLOW("low"),
        GRASSMODERATE("moderate"),
        GRASSHIGH("high"),
        GRASSVERYHIGH("very high"),
        GRASSEXTREME("extreme"),
        GRASSERROR("error");

As a result I'm now considering individual sensors, so we can make them go unavailable when the state = error
Updated the spec in first comment.

@stu247
Copy link

stu247 commented Oct 4, 2023

That's a good way to handle the error value.

@PeteRager
Copy link
Owner Author

API - pull request - PeteRager/lennoxs30api#70

@PeteRager PeteRager linked a pull request Oct 5, 2023 that will close this issue
@PeteRager
Copy link
Owner Author

https://github.com/PeteRager/lennoxs30/releases/tag/2023.10.0

Check it out when you have time. report any issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants