Compare commits

..

No commits in common. "4ccc37951de49242ffceecadc47b4194c841a169" and "5022cb7767cce88d860905fde7a55e9ffe78c335" have entirely different histories.

9 changed files with 13 additions and 113 deletions

View File

@ -1,21 +0,0 @@
name: Build & Attach ZIP asset
on:
release:
types: [published]
jobs:
build-zip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create ZIP
run: |
mkdir -p dist
cd custom_components/sws12500
zip -r ../../dist/weather-station.zip . -x "*/__pycache__/*"
- name: Upload ZIP to release
uses: softprops/action-gh-release@v2
with:
files: dist/weather-station.zip

View File

@ -1,6 +1,3 @@
![GitHub Downloads](https://img.shields.io/github/downloads/schizza/SWS-12500-custom-component/total?label=downloads%20%28all%20releases%29)
![Latest release downloads](https://img.shields.io/github/downloads/schizza/SWS-12500-custom-component/latest/total?label=downloads%20%28latest%29)
# Integrates your Sencor SWS 12500 or 16600, GARNI, BRESSER weather stations seamlessly into Home Assistant # Integrates your Sencor SWS 12500 or 16600, GARNI, BRESSER weather stations seamlessly into Home Assistant
This integration will listen for data from your station and passes them to respective sensors. It also provides the ability to push data to Windy API. This integration will listen for data from your station and passes them to respective sensors. It also provides the ability to push data to Windy API.

View File

@ -23,8 +23,12 @@ WSLINK: Final = "wslink"
WINDY_API_KEY = "WINDY_API_KEY" WINDY_API_KEY = "WINDY_API_KEY"
WINDY_ENABLED: Final = "windy_enabled_checkbox" WINDY_ENABLED: Final = "windy_enabled_checkbox"
WINDY_LOGGER_ENABLED: Final = "windy_logger_checkbox" WINDY_LOGGER_ENABLED: Final = "windy_logger_checkbox"
WINDY_NOT_INSERTED: Final = "Data was succefuly sent to Windy, but not inserted by Windy API. Does anyone else sent data to Windy?" WINDY_NOT_INSERTED: Final = (
WINDY_INVALID_KEY: Final = "Windy API KEY is invalid. Send data to Windy is now disabled. Check your API KEY and try again." "Data was succefuly sent to Windy, but not inserted by Windy API. Does anyone else sent data to Windy?"
)
WINDY_INVALID_KEY: Final = (
"Windy API KEY is invalid. Send data to Windy is now disabled. Check your API KEY and try again."
)
WINDY_SUCCESS: Final = ( WINDY_SUCCESS: Final = (
"Windy successfully sent data and data was successfully inserted by Windy API" "Windy successfully sent data and data was successfully inserted by Windy API"
) )
@ -77,12 +81,10 @@ DAILY_RAIN: Final = "daily_rain"
SOLAR_RADIATION: Final = "solar_radiation" SOLAR_RADIATION: Final = "solar_radiation"
INDOOR_TEMP: Final = "indoor_temp" INDOOR_TEMP: Final = "indoor_temp"
INDOOR_HUMIDITY: Final = "indoor_humidity" INDOOR_HUMIDITY: Final = "indoor_humidity"
INDOOR_BATTERY: Final = "indoor_battery"
UV: Final = "uv" UV: Final = "uv"
CH2_TEMP: Final = "ch2_temp" CH2_TEMP: Final = "ch2_temp"
CH2_HUMIDITY: Final = "ch2_humidity" CH2_HUMIDITY: Final = "ch2_humidity"
CH2_CONNECTION: Final = "ch2_connection" CH2_CONNECTION: Final = "ch2_connection"
CH2_BATTERY: Final = "ch2_battery"
CH3_TEMP: Final = "ch3_temp" CH3_TEMP: Final = "ch3_temp"
CH3_HUMIDITY: Final = "ch3_humidity" CH3_HUMIDITY: Final = "ch3_humidity"
CH3_CONNECTION: Final = "ch3_connection" CH3_CONNECTION: Final = "ch3_connection"
@ -91,10 +93,9 @@ CH4_HUMIDITY: Final = "ch4_humidity"
CH4_CONNECTION: Final = "ch4_connection" CH4_CONNECTION: Final = "ch4_connection"
HEAT_INDEX: Final = "heat_index" HEAT_INDEX: Final = "heat_index"
CHILL_INDEX: Final = "chill_index" CHILL_INDEX: Final = "chill_index"
WBGT_TEMP: Final = "wbgt_temp"
REMAP_ITEMS: dict[str, str] = { REMAP_ITEMS: dict = {
"baromin": BARO_PRESSURE, "baromin": BARO_PRESSURE,
"tempf": OUTSIDE_TEMP, "tempf": OUTSIDE_TEMP,
"dewptf": DEW_POINT, "dewptf": DEW_POINT,
@ -116,7 +117,7 @@ REMAP_ITEMS: dict[str, str] = {
"soilmoisture3": CH4_HUMIDITY, "soilmoisture3": CH4_HUMIDITY,
} }
REMAP_WSLINK_ITEMS: dict[str, str] = { REMAP_WSLINK_ITEMS: dict = {
"intem": INDOOR_TEMP, "intem": INDOOR_TEMP,
"inhum": INDOOR_HUMIDITY, "inhum": INDOOR_HUMIDITY,
"t1tem": OUTSIDE_TEMP, "t1tem": OUTSIDE_TEMP,
@ -144,9 +145,6 @@ REMAP_WSLINK_ITEMS: dict[str, str] = {
"t234c2tem": CH3_TEMP, "t234c2tem": CH3_TEMP,
"t234c2hum": CH3_HUMIDITY, "t234c2hum": CH3_HUMIDITY,
"t1bat": OUTSIDE_BATTERY, "t1bat": OUTSIDE_BATTERY,
"inbat": INDOOR_BATTERY,
"t234c1bat": CH2_BATTERY,
"t1wbgt": WBGT_TEMP,
} }
# TODO: Add more sensors # TODO: Add more sensors
@ -159,19 +157,11 @@ REMAP_WSLINK_ITEMS: dict[str, str] = {
DISABLED_BY_DEFAULT: Final = [ DISABLED_BY_DEFAULT: Final = [
CH2_TEMP, CH2_TEMP,
CH2_HUMIDITY, CH2_HUMIDITY,
CH2_BATTERY,
CH3_TEMP, CH3_TEMP,
CH3_HUMIDITY, CH3_HUMIDITY,
CH4_TEMP, CH4_TEMP,
CH4_HUMIDITY, CH4_HUMIDITY,
OUTSIDE_BATTERY, OUTSIDE_BATTERY,
WBGT_TEMP,
]
BATTERY_LIST = [
OUTSIDE_BATTERY,
INDOOR_BATTERY,
CH2_BATTERY,
] ]

View File

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

View File

@ -23,7 +23,6 @@ from .const import (
WIND_DIR, WIND_DIR,
WIND_SPEED, WIND_SPEED,
WSLINK, WSLINK,
BATTERY_LIST,
) )
from .sensors_common import WeatherSensorEntityDescription from .sensors_common import WeatherSensorEntityDescription
from .sensors_weather import SENSOR_TYPES_WEATHER_API from .sensors_weather import SENSOR_TYPES_WEATHER_API
@ -145,7 +144,7 @@ class WeatherSensor(
def icon(self) -> str | None: def icon(self) -> str | None:
"""Return the dynamic icon for battery representation.""" """Return the dynamic icon for battery representation."""
if self.entity_description.key in BATTERY_LIST: if self.entity_description.key == OUTSIDE_BATTERY:
try: try:
return battery_level_to_icon(self.native_value) return battery_level_to_icon(self.native_value)
except Exception: except Exception:

View File

@ -19,8 +19,6 @@ from .const import (
BARO_PRESSURE, BARO_PRESSURE,
CH2_HUMIDITY, CH2_HUMIDITY,
CH2_TEMP, CH2_TEMP,
CH2_BATTERY,
INDOOR_BATTERY,
CH3_HUMIDITY, CH3_HUMIDITY,
CH3_TEMP, CH3_TEMP,
CH4_HUMIDITY, CH4_HUMIDITY,
@ -30,10 +28,8 @@ from .const import (
DEW_POINT, DEW_POINT,
HEAT_INDEX, HEAT_INDEX,
HOURLY_RAIN, HOURLY_RAIN,
INDOOR_BATTERY,
INDOOR_HUMIDITY, INDOOR_HUMIDITY,
INDOOR_TEMP, INDOOR_TEMP,
INDOOR_BATTERY,
MONTHLY_RAIN, MONTHLY_RAIN,
OUTSIDE_BATTERY, OUTSIDE_BATTERY,
OUTSIDE_HUMIDITY, OUTSIDE_HUMIDITY,
@ -48,7 +44,6 @@ from .const import (
WIND_SPEED, WIND_SPEED,
YEARLY_RAIN, YEARLY_RAIN,
UnitOfDir, UnitOfDir,
WBGT_TEMP,
) )
from .sensors_common import WeatherSensorEntityDescription from .sensors_common import WeatherSensorEntityDescription
from .utils import battery_level_to_icon, battery_level_to_text, wind_dir_to_text from .utils import battery_level_to_icon, battery_level_to_text, wind_dir_to_text
@ -132,7 +127,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
WeatherSensorEntityDescription( WeatherSensorEntityDescription(
key=WIND_DIR, key=WIND_DIR,
native_unit_of_measurement=DEGREE, native_unit_of_measurement=DEGREE,
state_class=None, state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.WIND_DIRECTION, device_class=SensorDeviceClass.WIND_DIRECTION,
suggested_display_precision=None, suggested_display_precision=None,
icon="mdi:sign-direction", icon="mdi:sign-direction",
@ -151,7 +146,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
key=RAIN, key=RAIN,
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR, native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY, device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.TOTAL,
suggested_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR, suggested_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
suggested_display_precision=2, suggested_display_precision=2,
icon="mdi:weather-pouring", icon="mdi:weather-pouring",
@ -317,28 +312,4 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
value_fn=lambda data: battery_level_to_text(data), value_fn=lambda data: battery_level_to_text(data),
), ),
WeatherSensorEntityDescription(
key=CH2_BATTERY,
translation_key=CH2_BATTERY,
icon="mdi:battery-unknown",
device_class=SensorDeviceClass.ENUM,
value_fn=lambda data: battery_level_to_text(data),
),
WeatherSensorEntityDescription(
key=INDOOR_BATTERY,
translation_key=INDOOR_BATTERY,
icon="mdi:battery-unknown",
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,7 +116,6 @@
"weekly_rain": { "name": "Týdenní úhrn srážek" }, "weekly_rain": { "name": "Týdenní úhrn srážek" },
"monthly_rain": { "name": "Měsíční úhrn srážek" }, "monthly_rain": { "name": "Měsíční úhrn srážek" },
"yearly_rain": { "name": "Roční úhrn srážek" }, "yearly_rain": { "name": "Roční úhrn srážek" },
"wbgt_temp": { "name": "WBGT index" },
"wind_azimut": { "wind_azimut": {
"name": "Azimut", "name": "Azimut",
"state": { "state": {
@ -145,22 +144,6 @@
"normal": "Normální", "normal": "Normální",
"unknown": "Neznámá / zcela vybitá" "unknown": "Neznámá / zcela vybitá"
} }
},
"indoor_battery": {
"name": "Stav nabití baterie kozole",
"state": {
"low": "Nízká",
"normal": "Normální",
"unknown": "Neznámá / zcela vybitá"
}
},
"ch2_battery": {
"name": "Stav nabití baterie kanálu 2",
"state": {
"low": "Nízká",
"normal": "Normální",
"unknown": "Neznámá / zcela vybitá"
}
} }
} }
}, },

View File

@ -116,7 +116,6 @@
"weekly_rain": { "name": "Weekly precipitation" }, "weekly_rain": { "name": "Weekly precipitation" },
"monthly_rain": { "name": "Monthly precipitation" }, "monthly_rain": { "name": "Monthly precipitation" },
"yearly_rain": { "name": "Yearly precipitation" }, "yearly_rain": { "name": "Yearly precipitation" },
"wbgt_index": { "name": "WBGT index" },
"wind_azimut": { "wind_azimut": {
"name": "Bearing", "name": "Bearing",
"state": { "state": {
@ -145,22 +144,6 @@
"low": "Low", "low": "Low",
"unknown": "Unknown / drained out" "unknown": "Unknown / drained out"
} }
},
"ch2_battery": {
"name": "Channel 2 battery level",
"state": {
"normal": "OK",
"low": "Low",
"unknown": "Unknown / drained out"
}
},
"indoor_battery": {
"name": "Console battery level",
"state": {
"normal": "OK",
"low": "Low",
"unknown": "Unknown / drained out"
}
} }
} }
}, },

View File

@ -1,6 +1,4 @@
{ {
"name": "Sencor SWS 12500 Weather station", "name": "Sencor SWS 12500 Weather station",
"filename": "weather-station.zip", "render_readme": true
"render_readme": true,
"zip_release": true
} }