Added support for 15 minute price resolution (#1031)

* 15min prices WIP

* WIP more changes for 15min prices

* More work on 15min pricing

* Fixed some errors

* Some changes after testing

* Graphical changes for 15min pricing

* Adjustments on MQTT handlers after switching to 15min prices

* Reverted some MQTT changes

* Adapted HA integration for 15min pricing

* Adapted JSON payload for 15min

* Adjustments during testing

* Set default price interval

* Fixed refresh of price graph when data changes

* Bugfixes

* Fixed some issues with raw payload

* Adjustments for meter timestamp from Kamstrup

* Updated readme

* Added detailed breakdown of payloads coming from Norwegian meters

* Minor changes relating to price

* Fixed byte alignment on price config

* Changes to support RC upgraders
This commit is contained in:
Gunnar Skjold
2025-11-13 15:10:54 +01:00
committed by GitHub
parent ffd8d46f2e
commit c648546b61
44 changed files with 1073 additions and 637 deletions

View File

@@ -207,10 +207,12 @@ struct PriceServiceConfig {
char entsoeToken[37];
char area[17];
char currency[4];
uint32_t unused1;
bool enabled;
uint8_t resolutionInMinutes;
uint16_t unused2;
}; // 64
uint16_t unused3;
bool enabled;
uint16_t unused6;
};
struct EnergyAccountingConfig {
uint16_t thresholds[10];
@@ -237,14 +239,14 @@ struct UiConfig {
}; // 15
struct UpgradeInformation {
char fromVersion[8];
char toVersion[8];
char fromVersion[16];
char toVersion[16];
uint32_t size;
uint16_t block_position;
uint8_t retry_count;
uint8_t reboot_count;
int8_t errorCode;
}; // 25
}; // 41+3
struct CloudConfig {
bool enabled;

View File

@@ -655,6 +655,9 @@ bool AmsConfiguration::getPriceServiceConfig(PriceServiceConfig& config) {
clearPriceServiceConfig(config);
return false;
}
if(config.resolutionInMinutes != 15 && config.resolutionInMinutes != 60) {
config.resolutionInMinutes = 60;
}
return true;
} else {
clearPriceServiceConfig(config);
@@ -669,6 +672,7 @@ bool AmsConfiguration::setPriceServiceConfig(PriceServiceConfig& config) {
priceChanged |= strcmp(config.area, existing.area) != 0;
priceChanged |= strcmp(config.currency, existing.currency) != 0;
priceChanged |= config.enabled != existing.enabled;
priceChanged |= config.resolutionInMinutes != existing.resolutionInMinutes;
} else {
priceChanged = true;
}
@@ -688,9 +692,8 @@ void AmsConfiguration::clearPriceServiceConfig(PriceServiceConfig& config) {
memset(config.entsoeToken, 0, 37);
memset(config.area, 0, 17);
memset(config.currency, 0, 4);
config.unused1 = 1000;
config.enabled = false;
config.unused2 = 0;
config.resolutionInMinutes = 60;
}
bool AmsConfiguration::isPriceServiceChanged() {