Commit Graph

115 Commits (ecowitt_support)

Author SHA1 Message Date
SchiZzA 1ad10b4b1e
fixed: Menu options 2026-05-27 21:34:32 +02:00
SchiZzA b9815713a0
fix value in wslink sensors
Fix VOCLevel value
2026-05-27 21:30:11 +02:00
SchiZzA 211965dd52
Ecowitt support
Update setiing (config_flow and translations) for Ecowitt settings.
Also updated utils.py to accept None for value.
2026-05-27 21:27:13 +02:00
SchiZzA 9288ae4a64
Updated config flow
Updated config flow's initial setup.
Ecowitt stations does not require `API_ID` and `API_KEY`, so we need to
separate Ecowitt setup from PWS/WSLink setup.
2026-05-27 17:27:10 +02:00
SchiZzA cc50f9babb
fix: Corrected RAIN and DAILYRAIN for PWS protocol.
The `RAININ` suppose to be accumulated rainfall in 60 minutes. So the
unit must be in `mm/h` or `in/h`.
In the opposite `DAILYRAIN` is rain in the day do far, represented in
accumulated `mm` or `in`.
2026-05-24 22:19:53 +02:00
SchiZzA 21dfa61cd5
Add HCHO / VOC air-quality sensors (T9 module)
Support the WSLink t9 air-quality module:
  - t9hcho (formaldehyde, ppb),
  - t9voclv (VOC level 1-5 -> ENUM state)
  - t9bat (0-5 battery -> percentage).

  The t9hcho/t9voclv/t9bat values are dropped when
  t9cn reports the module as disconnected,
  so no empty entities are created.

  - const: HCHO/VOC/T9_BATTERY keys, VOCLevel enum +
  VOC_LEVEL_MAP, BATTERY_NON_BINARY, CONNECTION_GATED_SENSORS,
  REMAP_WSLINK_ITEMS entries
  - utils: voc_level_to_text(),
  battery_5step_to_pct(), connection gating
  - sensors_wslink: HCHO / VOC / T9_BATTERY entity
  descriptions
  - translations (en, cs): hcho, voc (+ states),
  t9_battery
  - tests: tests/conftest.py +
  tests/test_t9_air_quality.py
2026-05-24 22:19:30 +02:00
SchiZzA 1d2c1b4be3
Introduce SWSRuntimeData dataclass for typed entry.runtime_data.
Adds the SWSRuntimeData dataclass and SWSConfigEntry type alias so
  per-entry state can move from loosely-typed hass.data[DOMAIN][entry_id]
  dicts to HA 2025+ typed entry.runtime_data. The legacy ENTRY_* string
  keys are kept in place for now so callers can be migrated incrementally.

  This commit is not final update. Just preparing for future complete refactor.
2026-05-11 13:49:40 +02:00
SchiZzA 202447405f
Typos corrected. 2026-04-11 17:37:53 +02:00
schizza 15e9df00ca
Implement Ecowitt protocol support and dynamic binary sensor discovery.
- Integrate aioecowitt to parse incoming weather station payloads and map sensors to the SWS pipeline.
- Add a new webhook endpoint at /weatherhub/{webhook_id} with support for dynamic route resolution.
- Expand battery binary sensor definitions and implement logic for dynamic entity creation.
- Bump version to 2.0.0-pre1.
2026-04-11 16:37:17 +02:00
SchiZzA 50fe9e35fe
Add Ecowitt compatibility and deprecate legacy battery sensors. 2026-04-10 18:35:33 +02:00
SchiZzA 7f72497e9e
Update version to 2.0.pre0 2026-03-23 18:35:29 +01:00
SchiZzA e737fb16d3
Use configured WSLink add-on port for health/status endpoints. 2026-03-23 18:32:02 +01:00
SchiZzA 159d465db5
Improve sensor value parsing and add battery binary sensors.
- Introduce `to_int`/`to_float` helpers to safely handle None/blank payload values.
- Use the converters across weather/wslink sensor descriptions and simplify wind direction handling.
- Add low-battery binary sensor entities and definitions.
2026-03-23 18:21:05 +01:00
SchiZzA 9d5fafa8d0
Add configuration options for WSLink Addon port. 2026-03-23 18:14:46 +01:00
SchiZzA 63660006ea
Add health diagnostics coordinator and routing snapshot
Track ingress/forwarding status, expose detailed health sensors and translations, and include redacted diagnostics data.
2026-03-14 17:39:52 +01:00
SchiZzA 39b16afcbc
Update constants to more readable form. 2026-03-05 11:47:52 +01:00
SchiZzA f0554573ce
Make routes method-aware and update related tests
Include HTTP method in route keys and dispatch, and fix
Routes.show_enabled.
Update register_path to accept a HealthCoordinator and adjust router
stubs in tests. Update WindyPush tests to use response objects
(status/text)
and adapt related exception/notification expectations.
2026-03-04 07:53:26 +01:00
SchiZzA 995f607cf7
Improve Windy error handling and retry logic 2026-03-03 14:17:34 +01:00
SchiZzA 3e573087a2
Add multiple health sensors and device info
Introduce HealthSensorEntityDescription and a tuple of sensor
descriptions for integration status, source IP, base URL and addon
response. Instantiate one HealthDiagnosticSensor per description in
async_setup_entry. Update HealthDiagnosticSensor to accept a
description, derive unique_id from description.key and add a cached
device_info returning a SERVICE-type device. Adjust imports.
2026-03-02 22:08:40 +01:00
SchiZzA 6a4eed2ff9
Validate hass data with py_typecheck.checked
Replace manual isinstance checks and casts with py_typecheck.checked()
to validate hass and entry data and return early on errors. Simplify
add_new_sensors by unwrapping values, renaming vars, and passing the
coordinator to WeatherSensor
2026-03-02 22:08:01 +01:00
SchiZzA b3aae77132
Replace casts with checked type helpers
Use checked and checked_or to validate option and hass.data types,
remove unsafe typing.cast calls, simplify coordinator and entry_data
handling, and cache boolean option flags for Windy and Pocasí checks
2026-03-02 22:06:09 +01:00
SchiZzA 7d1494f29b
Removed extended debugging info from sensors. Added descriptive method on route info. 2026-03-01 17:32:36 +01:00
SchiZzA 01058a07b4
Add WSLink support for additional sensor channels
- Extend constants and WSLink key remapping for channels 3–8 (temp, humidity, battery and connection)
- Add new WSLink sensor entity descriptions for the extra channel readings
- Update English translations for the newly added channel sensors and battery states
2026-03-01 16:56:46 +01:00
SchiZzA f06f8b31ae
Align Windy resend with Stations API response handling
- Add WINDY_MAX_RETRIES constant and use it consistently when deciding to disable resending
- Refactor Windy response verification to rely on HTTP status codes per stations.windy.com API
- Improve error handling for missing password, duplicate payloads and rate limiting
- Enhance retry logging and disable Windy resend via persistent notification on repeated failures
2026-03-01 13:51:17 +01:00
SchiZzA 95663fd78b
Stabilize webhook routing and config updates
- Register aiohttp webhook routes once and switch the active dispatcher handler on option changes
- Make the internal route registry method-aware (GET/POST) and improve enabled-route logging
- Fix OptionsFlow initialization by passing the config entry and using safe defaults for credentials
- Harden Windy resend by validating credentials early, auto-disabling the feature on invalid responses, and notifying the user
- Update translations for Windy credential validation errors
2026-03-01 12:48:23 +01:00
SchiZzA cc1afaa218
Organize imports in `__init__.py` 2026-02-26 17:59:25 +01:00
SchiZzA 9255820a13
Added support for GET and POST endpoints. 2026-02-26 17:58:12 +01:00
SchiZzA 1bbeab1ffe
Add health diagnostic sensor and extensive tests for sws12500
integration

- Introduce HealthDiagnosticSensor for device health status reporting
- Add new constants and data keys for health sensor integration
- Wire health_sensor module into sensor platform setup
- Refactor sensor descriptions to improve derived sensor handling
- Implement pytest fixtures and comprehensive tests covering:
  - Config flows and options validation
  - Data reception and authentication
  - Sensor platform setup and dynamic sensor addition
  - Push integration with Pocasi.cz and Windy API
  - Route dispatching and error handling
  - Utilities, conversions, and translation functions
2026-02-21 11:29:40 +01:00
SchiZzA 214b8581b0
Remove numpy dependency and simplify range checks in heat_index function 2026-02-06 18:32:56 +01:00
SchiZzA c84e112073
Fix typo in fallback handler name from unregistred to unregistered 2026-02-06 18:22:31 +01:00
SchiZzA fa3b5aa523
Anonymize data payload in PocasiPush logging 2026-02-06 18:20:17 +01:00
SchiZzA f608ab4991
Remove verify_ssl=False from async_get_clientsession calls 2026-02-06 18:14:02 +01:00
SchiZzA 0c67b8d2ab
Update Windy integration to use station ID and password authentication
- Replace API key with station ID and password for authentication
- Change Windy API endpoint to v2 observation update
- Adapt data conversion for WSLink to Windy format
- Update config flow and translations accordingly
2026-02-06 15:16:05 +01:00
SchiZzA 1fec8313d4
Refactor SWS12500 integration for push-based updates
- Add detailed architecture overview in __init__.py
- Introduce shared runtime keys in data.py to avoid key conflicts
- Implement dual route dispatcher for webhook endpoint selection
- Enhance sensor platform for dynamic sensor addition without reloads
- Rename battery level "unknown" to "drained" with updated icons
- Improve utils.py with centralized helpers for remapping and discovery
- Update translations and strings for consistency
2026-01-27 09:21:27 +01:00
SchiZzA a3dc3d0d53
Improve data validation and error logging in utils.py 2026-01-18 21:48:24 +01:00
SchiZzA 234840e115
Rename battery_level_to_text to battery_level and update docstring 2026-01-18 19:36:33 +01:00
SchiZzA a20369bab3
Fix logging of unregistered route to include path 2026-01-18 19:35:51 +01:00
SchiZzA 08b812e558
Improve type safety, add data validation, and refactor route handling
- Add typing and runtime checks with py_typecheck for config options and
  incoming data
- Enhance authentication validation and error handling in data
  coordinator
- Refactor Routes class with better dispatch logic and route
  enabling/disabling
- Clean up async functions and improve logging consistency
- Add type hints and annotations throughout the integration
- Update manifest to include typecheck-runtime dependency
2026-01-18 17:53:28 +01:00
SchiZzA 39cd852b36
Merge remote-tracking branch 'origin/stable' into ecowitt_support 2025-12-22 16:43:04 +01:00
SchiZzA 743e62c6dd
Fix Heat Index and Chill Index
Fixed computing Heat and Chill index in cases that outside senosor
battery is drained and station stop sending data for outside temp,
humidity and wind.
2025-12-22 11:47:02 +01:00
SchiZzA 466d41f1bb
Config_flow for Ecowitt 2025-12-09 12:01:32 +01:00
SchiZzA e34f73a467
Refactor config_flow, add support for Ecowitt configuration 2025-12-07 17:07:11 +01:00
SchiZzA e482fcea2b
Fix typecheck issues 2025-11-17 00:28:37 +01:00
SchiZzA 0679f1e559
Fix typos, fix await in windy_func 2025-11-16 19:18:29 +01:00
SchiZzA de346ed914
Fix: Retain dat for other options, while configuring Pocasi CZ 2025-11-16 19:02:24 +01:00
SchiZzA 7950e1be46
Add Pocasi CZ push to server support
Added `pocasi_cz.py` component to handle resending data to Pocasi CZ
server.
2025-11-16 18:37:01 +01:00
SchiZzA 0d47e14834
Add Počasí Meteo CZ integration to options flow and constants
Introduce new config step for Počasí Meteo CZ with validation and UI
schema. Define related constants and translation keys for setting up
data forwarding.
2025-11-16 15:37:13 +01:00
SchiZzA 92eadbb4e2
Typo update 2025-11-16 14:09:16 +01:00
SchiZzA 040f70c027
Adds translation keys.
Updated cs.json, en.json, strings,json
2025-11-16 13:38:11 +01:00
SchiZzA 67d8acf9cc
Add constants for `pocasimeteo_cz`
const `POCASI_CZ_URL` added to constants. cont `POCASI_CZ_SEDN_INTERVAL`
and POCASI_CZ_SEND_MINIMUM are added to contants.
2025-11-16 13:13:41 +01:00