[tibber] Add support for average channel (#19111)

Signed-off-by: Christian Kemper <dev@bestof5.de>
This commit is contained in:
Christian Kemper
2025-08-06 11:14:51 +02:00
committed by GitHub
parent 294cfc4963
commit 09c59ac415
7 changed files with 36 additions and 18 deletions
+19 -17
View File
@@ -78,20 +78,21 @@ The items connected to the above channels needs to be stored in e.g. [InfluxDB](
Live information from Tibber Pulse.
All values read-only.
| Channel ID | Type | Description |
|-----------------------|---------------------------|-------------------------------------------------------|
| consumption | Number:Power | Consumption at the moment in watts |
| minimum-consumption | Number:Power | Minimum power consumption since midnight in watts |
| peak-consumption | Number:Power | Peak power consumption since midnight in watts |
| production | Number:Power | Net power production at the moment in watts |
| minimum-production | Number:Power | Minimum net power production since midnight in watts |
| peak-production | Number:Power | Maximum net power production since midnight in watts |
| voltage1 | Number:ElectricPotential | Electric potential on phase 1 |
| voltage2 | Number:ElectricPotential | Electric potential on phase 2 |
| voltage3 | Number:ElectricPotential | Electric potential on phase 3 |
| current1 | Number:ElectricCurrent | Electric current on phase 1 |
| current2 | Number:ElectricCurrent | Electric current on phase 2 |
| current3 | Number:ElectricCurrent | Electric current on phase 3 |
| Channel ID | Type | Description |
|---------------------|---------------------------|------------------------------------------------------|
| consumption | Number:Power | Consumption at the moment in watts |
| minimum-consumption | Number:Power | Minimum power consumption since midnight in watts |
| peak-consumption | Number:Power | Peak power consumption since midnight in watts |
| average-consumption | Number:Power | Average power consumption since midnight in watts |
| production | Number:Power | Net power production at the moment in watts |
| minimum-production | Number:Power | Minimum net power production since midnight in watts |
| peak-production | Number:Power | Maximum net power production since midnight in watts |
| voltage1 | Number:ElectricPotential | Electric potential on phase 1 |
| voltage2 | Number:ElectricPotential | Electric potential on phase 2 |
| voltage3 | Number:ElectricPotential | Electric potential on phase 3 |
| current1 | Number:ElectricCurrent | Electric current on phase 1 |
| current2 | Number:ElectricCurrent | Electric current on phase 2 |
| current3 | Number:ElectricCurrent | Electric current on phase 3 |
### `statistics` group
@@ -444,9 +445,10 @@ Number:EnergyPrice Tibber_API_Spot_Prices "Spot Prices"
Number Tibber_API_Price_Level "Price Level" {channel="tibber:tibberapi:xyz:price#level"}
Number:EnergyPrice Tibber_API_Average "Average Price" {channel="tibber:tibberapi:xyz:price#average"}
Number:Power Tibber_API_Live_Cosnumption "Live Consumption" {channel="tibber:tibberapi:xyz:live#consumption"}
Number:Power Tibber_API_Minimum_Cosnumption "Minimum Consumption" {channel="tibber:tibberapi:xyz:live#minimum-consumption"}
Number:Power Tibber_API_Peak_Cosnumption "Peak Consumption" {channel="tibber:tibberapi:xyz:live#peak-consumption"}
Number:Power Tibber_API_Live_Consumption "Live Consumption" {channel="tibber:tibberapi:xyz:live#consumption"}
Number:Power Tibber_API_Minimum_Consumption "Minimum Consumption" {channel="tibber:tibberapi:xyz:live#minimum-consumption"}
Number:Power Tibber_API_Peak_Consumption "Peak Consumption" {channel="tibber:tibberapi:xyz:live#peak-consumption"}
Number:Power Tibber_API_Average_Consumption "Average Consumption" {channel="tibber:tibberapi:xyz:live#average-consumption"}
Number:Power Tibber_API_Live_Production "Live Production" {channel="tibber:tibberapi:xyz:live#production"}
Number:Power Tibber_API_Minimum_Production "Minimum Production" {channel="tibber:tibberapi:xyz:live#minimum-production"}
Number:Power Tibber_API_Peak_Production "Peak Production" {channel="tibber:tibberapi:xyz:live#peak-production"}
@@ -51,6 +51,7 @@ public class TibberBindingConstants {
public static final String CHANNEL_CONSUMPTION = "consumption";
public static final String CHANNEL_MIN_COSNUMPTION = "minimum-consumption";
public static final String CHANNEL_PEAK_CONSUMPTION = "peak-consumption";
public static final String CHANNEL_AVERAGE_CONSUMPTION = "average-consumption";
public static final String CHANNEL_PRODUCTION = "production";
public static final String CHANNEL_MIN_PRODUCTION = "minimum-production";
public static final String CHANNEL_PEAK_PRODUCTION = "peak-production";
@@ -489,6 +489,8 @@ public class TibberHandler extends BaseThingHandler {
updateChannel(CHANNEL_GROUP_LIVE, CHANNEL_MIN_COSNUMPTION, value, "W");
value = Utils.getJsonValue(jsonData, "maxPower");
updateChannel(CHANNEL_GROUP_LIVE, CHANNEL_PEAK_CONSUMPTION, value, "W");
value = Utils.getJsonValue(jsonData, "averagePower");
updateChannel(CHANNEL_GROUP_LIVE, CHANNEL_AVERAGE_CONSUMPTION, value, "W");
value = Utils.getJsonValue(jsonData, "powerProduction");
updateChannel(CHANNEL_GROUP_LIVE, CHANNEL_PRODUCTION, value, "W");
value = Utils.getJsonValue(jsonData, "minPowerProduction");
@@ -35,6 +35,8 @@ channel-group-type.tibber.live.channel.minimum-production.label = Minimum Produc
channel-group-type.tibber.live.channel.minimum-production.description = Minimum net power production since midnight in watts
channel-group-type.tibber.live.channel.peak-consumption.label = Peak Consumption
channel-group-type.tibber.live.channel.peak-consumption.description = Peak power consumption since midnight in watts
channel-group-type.tibber.live.channel.average-consumption.label = Average Consumption
channel-group-type.tibber.live.channel.average-consumption.description = Average power consumption since midnight in watts
channel-group-type.tibber.live.channel.peak-production.label = Peak Production
channel-group-type.tibber.live.channel.peak-production.description = Maximum net power production since midnight in watts
channel-group-type.tibber.live.channel.production.label = Live Production
@@ -19,6 +19,10 @@
<label>Peak Consumption</label>
<description>Peak power consumption since midnight in watts</description>
</channel>
<channel id="average-consumption" typeId="power">
<label>Average Consumption</label>
<description>Average power consumption since midnight in watts</description>
</channel>
<channel id="production" typeId="power">
<label>Live Production</label>
<description>Net power production at the moment in watts</description>
@@ -16,7 +16,7 @@
<properties>
<property name="vendor">Tibber</property>
<property name="thingTypeVersion">3</property>
<property name="thingTypeVersion">4</property>
</properties>
<config-description>
@@ -168,7 +168,14 @@
<label>Last Hour Production</label>
<description>Net energy produced since last hour shift in kilowatt-hours</description>
</add-channel>
</instruction-set>
<instruction-set targetVersion="4">
<add-channel id="average-consumption" groupIds="live">
<type>tibber:power</type>
<label>Average Consumption</label>
<description>Average power consumption since midnight in watts</description>
</add-channel>
</instruction-set>
</thing-type>