Adds WBGT temperature sensor via WSLink

Adds the Wet Bulb Globe Temperature (WBGT) sensor to the integration, pulling data via the WSLink API.

Corrects the state class for rain and wind direction.
77-wbgt-temperature-sensor-wslink-api-parameter-t1wbgt
schizza 2025-10-26 21:39:31 +01:00
parent 1d8928bf12
commit 06a8a7ff1b
No known key found for this signature in database
5 changed files with 19 additions and 3 deletions

View File

@ -91,6 +91,7 @@ CH4_HUMIDITY: Final = "ch4_humidity"
CH4_CONNECTION: Final = "ch4_connection"
HEAT_INDEX: Final = "heat_index"
CHILL_INDEX: Final = "chill_index"
WBGT_TEMP: Final = "wbgt_temp"
REMAP_ITEMS: dict[str, str] = {
@ -145,6 +146,7 @@ REMAP_WSLINK_ITEMS: dict[str, str] = {
"t1bat": OUTSIDE_BATTERY,
"inbat": INDOOR_BATTERY,
"t234c1bat": CH2_BATTERY,
"t1wbgt": WBGT_TEMP,
}
# TODO: Add more sensors
@ -163,6 +165,7 @@ DISABLED_BY_DEFAULT: Final = [
CH4_TEMP,
CH4_HUMIDITY,
OUTSIDE_BATTERY,
WBGT_TEMP,
]
BATTERY_LIST = [

View File

@ -10,6 +10,6 @@
"issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues",
"requirements": [],
"ssdp": [],
"version": "1.6.7",
"version": "1.6.8",
"zeroconf": []
}

View File

@ -48,6 +48,7 @@ from .const import (
WIND_SPEED,
YEARLY_RAIN,
UnitOfDir,
WBGT_TEMP,
)
from .sensors_common import WeatherSensorEntityDescription
from .utils import battery_level_to_icon, battery_level_to_text, wind_dir_to_text
@ -131,7 +132,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
WeatherSensorEntityDescription(
key=WIND_DIR,
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
state_class=None,
device_class=SensorDeviceClass.WIND_DIRECTION,
suggested_display_precision=None,
icon="mdi:sign-direction",
@ -150,7 +151,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
key=RAIN,
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
state_class=SensorStateClass.TOTAL,
state_class=SensorStateClass.MEASUREMENT,
suggested_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
suggested_display_precision=2,
icon="mdi:weather-pouring",
@ -330,4 +331,14 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.ENUM,
value_fn=lambda data: battery_level_to_text(data),
),
WeatherSensorEntityDescription(
key=WBGT_TEMP,
translation_key=WBGT_TEMP,
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
suggested_display_precision=2,
value_fn=lambda data: cast("int", data),
),
)

View File

@ -116,6 +116,7 @@
"weekly_rain": { "name": "Týdenní úhrn srážek" },
"monthly_rain": { "name": "Měsíční úhrn srážek" },
"yearly_rain": { "name": "Roční úhrn srážek" },
"wbgt_temp": { "name": "WBGT index" },
"wind_azimut": {
"name": "Azimut",
"state": {

View File

@ -116,6 +116,7 @@
"weekly_rain": { "name": "Weekly precipitation" },
"monthly_rain": { "name": "Monthly precipitation" },
"yearly_rain": { "name": "Yearly precipitation" },
"wbgt_index": { "name": "WBGT index" },
"wind_azimut": {
"name": "Bearing",
"state": {