feat: modernize Greenely integration (async API, current price sensor, bug fixes) v2.3.0 - #2
Open
tintinz wants to merge 4 commits into
Open
feat: modernize Greenely integration (async API, current price sensor, bug fixes) v2.3.0#2tintinz wants to merge 4 commits into
tintinz wants to merge 4 commits into
Conversation
…g fixes - Rewrite GreenelyApi as a fully async httpx.AsyncClient client (fixes 'Blocking call to load_verify_locations in event loop') - Add Greenely Current Price sensor (MONETARY, SEK/kWh) for the Energy dashboard and automations - Fix config flow crash on unresolvable facility (fixes '500 Internal Server Error', adds CannotConnect handling) - Move price conversion to a single testable helper (prices.py) with consistent raw->SEK/kWh mapping - Make all sensors async, fix services JSON output bug - Bump to v2.2.0, add unit tests and API verification tool
homeassistant.const in HA 2026.7 does not export CURRENCY_EURO_CENT,
which caused ImportError -> setup_error when the sensor platform loaded.
Also drop reliance on CURRENCY_SWEDISH_KRONA for safety.
Use the explicit constant UNIT_SEK_PER_KWH ("SEK/kWh") instead.
Bump to v2.2.1.
Keep only tools/verify_greenely.py which is documented in the README. Temp websocket/REST debug scripts used during troubleshooting are not meant to ship in the integration.
Greenely now provides quarter-of-hour spot prices in the hourly spot-price
payload (quarters_prices: {quarter1..quarter4}). Adds a new MONETARY sensor
`sensor.greenely_current_quarter_price` exposing the current 15-minute price
in SEK/kWh, falling back to the hourly mean when a quarter is missing.
Verified against live data (e.g. 0.398 SEK/kWh for the current quarter vs
0.4048 hourly mean). Bump to v2.3.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moderniserar Greenely Home Assistant-integrationen till v2.3.0:
sensor.greenely_current_quarter_priceTesting
Notes
Bygger vidare på samma
greenely-domän (fork, ej rename) för att undvika domänkrock.