feat: Greenely Nord Pool Price sensor — SEM-compatible (Solar Energy Management) - #5
Open
tintinz wants to merge 2 commits into
Open
feat: Greenely Nord Pool Price sensor — SEM-compatible (Solar Energy Management)#5tintinz wants to merge 2 commits into
tintinz wants to merge 2 commits into
Conversation
Adds a new MONETARY sensor (Greenely Nord Pool Price) that exposes Greenely's
real spot prices — including 15-minute quarter prices — in the same attribute
format as the popular Nordpool custom component and the Tibber price sensor.
An energy platform can point its EV charging / arbitrage logic from `nordpool`
or `tibber` to this sensor without changing any logic.
Exposed attributes:
- today / tomorrow and raw_today / raw_tomorrow as 96 x 15-minute [ts, price] points
- current_price, min, max, mean, average
- off_peak_1 / peak / off_peak_2 (Nordpool fixed blocks)
- low_price, price_percent_to_average, tomorrow_valid
- Tibber-style price_level (LOW/NORMAL/HIGH) and intraday_price_ranking
Implementation:
- New pure-Python module nordpool_format.py (no HA import) that expands each
hourly entry's quarters_prices {q1..q4} into 15-minute points, with fallback
to the hourly mean when a quarter is missing. Unit-testable standalone.
- Verified against live Greenely data (current 1.15 SEK/kWh, 96 pts today and
tomorrow, tomorrow_valid true) and an on-file unit test.
Bump to v2.4.0.
SEMP Meter (Solar Energy Management) parses the day-ahead curve from
today/tomorrow/raw_today/raw_tomorrow attributes and only accepts list
items that are DICTS with a "start" ISO timestamp and a "value" price
key (tariff_provider._read_prices_list). The previous tuple-pair format
([ts, price]) was silently dropped by SEM, leaving its battery/EV
planning with an empty curve and a fallback constant price.
Change build_price_series to emit each 15-min point as
{"start": "<ISO>", "value": <SEK/kWh>} for today/tomorrow and
raw_today/raw_tomorrow, keeping all other fields (current_price,
min/max/mean/average, off_peak_1/peak/off_peak_2, low_price,
price_percent_to_average, tomorrow_valid, price_level,
intraday_price_ranking) unchanged.
Now both the current-price read (state) and the full day-ahead curve
(attributes) feed SEM directly from the Greenely sensor.
Verified with a concept-proof replaying SEM's exact dict-parse logic
against the emitted attributes: 96/96 today + 96/96 raw_today points
parsed, sorted, timestamps ISO-valid.
Bump manifest to 2.4.1.
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.
Greenely Nord Pool Price sensor — SEM-kompatibel (Solar Energy Management)
En ny
Greenely Nord Pool Price-sensor som låter dig driva SEM (Solar Energy Management)direkt på Greenelys riktiga spotpriser — ingen Nordpool-/Tibber-integration behövs.
🎯 Varför den här PR:en (SEM-fix)
Patriks HA kör SEM (
traktore-org/sem-community) för batteri-toppning/EV-laddning på spotpris.SEM får priskurvan från sensorns
today/tomorrow-attribut, men accepterar bara dict-element(
{"start": <ISO>, "value": <pris>}) — alla andra format ignoreras tyst.Den här PR:en:
GreenelyNordpoolPriceSensorsom bygger 96-punkts (15-min) dag-/imorgonkruvor frånGreenelys
spot-price+quarters_prices.start+value) förtoday/tomorrow/raw_today/raw_tomorrow— så SEM direkt kan konsumera den som dynamisk tariff/priskälla.native_value= aktuellt pris SEK/kWh (läses av SEM som nutidspris frånstate).✅ Verifierat
_read_prices_list-parse-logik replikerad mot vår output →96/96 punkter hämtade, sorterade, ISO-giltiga.
test_sem_parses_curve_from_attributes+test_full_day_series(96 punkter,dict-shape).
7 passed.quarters_prices {q1..q4}per timme).🔗 Länkar
sensor.greenely_nordpool_priceså tar SEM in heladygnskurvan för planering + aktuellt pris direkt från Greenely.
📦 Vad sensorn exponerar
today/tomorrow(96×15-min, dict{"start","value"}),raw_today/raw_tomorrow,current_price,min/max/mean/average,off_peak_1/peak/off_peak_2,low_price,price_percent_to_average,tomorrow_valid, Tibber-price_level,intraday_price_ranking.MONETARY, SEK/kWh.
Baseras på
feat/fix-and-modernize(async-omskrivningen). 2 commits. Bump → 2.4.1.