Skip to content

Commit

Permalink
Migrate naming convention
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Laursen <[email protected]>
  • Loading branch information
jlaur committed Mar 21, 2023
1 parent 942e20c commit 2581fc3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
38 changes: 19 additions & 19 deletions bundles/org.openhab.binding.energidataservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ To obtain the Global Location Number of your grid company:

### Channel Group `electricity`

| Channel | Type | Description | Advanced |
|------------------------------|--------|------------------------------------------------------------------------------------------------|----------|
| currentSpotPrice | Number | Spot price in DKK or EUR per kWh for current hour | no |
| currentNetTariff | Number | Net tariff in DKK per kWh for current hour. Only available when `gridCompanyGLN` is configured | no |
| currentSystemTariff | Number | System tariff in DKK per kWh for current hour | no |
| currentElectricityTax | Number | Electricity tax in DKK per kWh for current hour | no |
| currentTransmissionNetTariff | Number | Transmission net tariff in DKK per kWh for current hour | no |
| hourlyPrices | String | JSON array with hourly prices from 12 hours ago and onward | yes |
| Channel | Type | Description | Advanced |
|---------------------------------|--------|------------------------------------------------------------------------------------------------|----------|
| current-spot-price | Number | Spot price in DKK or EUR per kWh for current hour | no |
| current-net-tariff | Number | Net tariff in DKK per kWh for current hour. Only available when `gridCompanyGLN` is configured | no |
| current-system-tariff | Number | System tariff in DKK per kWh for current hour | no |
| current-electricity-tax | Number | Electricity tax in DKK per kWh for current hour | no |
| current-transmission-net-tariff | Number | Transmission net tariff in DKK per kWh for current hour | no |
| hourly-prices | String | JSON array with hourly prices from 12 hours ago and onward | yes |

_Please note:_ There is no channel providing the total price.
Instead, create a group item with `SUM` as aggregate function and add the individual price items as children.
Expand All @@ -65,11 +65,11 @@ Once installed, simply select "Value-Added Tax" as Profile when linking an item.

#### Current Net Tariff

Discounts are automatically taken into account for channel `currentNetTariff` so that it represents the actual price.
Discounts are automatically taken into account for channel `current-net-tariff` so that it represents the actual price.

The tariffs are downloaded using pre-configured filters for the different [Grid Company GLN's](#global-location-number-of-the-grid-company).
If your company is not in the list, or the filters are not working, they can be manually overridden.
To override filters, the channel `currentNetTariff` has the following configuration parameters:
To override filters, the channel `current-net-tariff` has the following configuration parameters:

| Name | Type | Description | Default | Required | Advanced |
|-----------------|---------|----------------------------------------------------------------------------------------------------------------------------|---------|----------|----------|
Expand Down Expand Up @@ -102,7 +102,7 @@ _Nord Energi Net:_

#### Hourly Prices

The format of the `hourlyPrices` JSON array is as follows:
The format of the `hourly-prices` JSON array is as follows:

```json
[
Expand Down Expand Up @@ -132,14 +132,14 @@ Historic prices older than 12 hours are removed from the JSON array each hour.

## Thing Actions

Thing actions can be used to perform calculations as well as import prices directly into rules without deserializing JSON from the [hourlyPrices](#hourly-prices) channel.
Thing actions can be used to perform calculations as well as import prices directly into rules without deserializing JSON from the [hourly-prices](#hourly-prices) channel.
This is more convenient, much faster, and provides automatic summation of the price elements of interest.

Actions use cached data for performing operations.
Since data is only fetched when an item is linked to a channel, there might not be any cached data available.
In this case the data will be fetched on demand and cached afterwards.
The first action triggered on a given day may therefore be a bit slower, and is also prone to failing if the server call fails for any reason.
This potential problem can be prevented by linking the indivial channels to items, or by linking the `hourlyPrices` channel to an item.
This potential problem can be prevented by linking the indivial channels to items, or by linking the `hourly-prices` channel to an item.

### `calculateCheapestPeriod`

Expand Down Expand Up @@ -325,12 +325,12 @@ Thing energidataservice:service:energidataservice "Energi Data Service" [ priceA

```java
Group:Number:SUM CurrentTotalPrice "Current Total Price" <price>
Number CurrentSpotPrice "Current Spot Price" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#currentSpotPrice" [profile="transform:VAT"] }
Number CurrentNetTariff "Current Net Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#currentNetTariff" [profile="transform:VAT"] }
Number CurrentSystemTariff "Current System Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#currentSystemTariff" [profile="transform:VAT"] }
Number CurrentElectricityTax "Current Electricity Tax" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#currentElectricityTax" [profile="transform:VAT"] }
Number CurrentTransmissionNetTariff "Current Transmission Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#currentTransmissionNetTariff" [profile="transform:VAT"] }
String HourlyPrices "Hourly Prices" <price> { channel="energidataservice:service:energidataservice:electricity#hourlyPrices" }
Number CurrentSpotPrice "Current Spot Price" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#current-spot-price" [profile="transform:VAT"] }
Number CurrentNetTariff "Current Net Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#current-net-tariff" [profile="transform:VAT"] }
Number CurrentSystemTariff "Current System Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#current-system-tariff" [profile="transform:VAT"] }
Number CurrentElectricityTax "Current Electricity Tax" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#current-electricity-tax" [profile="transform:VAT"] }
Number CurrentTransmissionNetTariff "Current Transmission Tariff" <price> (CurrentTotalPrice) { channel="energidataservice:service:energidataservice:electricity#current-transmission-net-tariff" [profile="transform:VAT"] }
String HourlyPrices "Hourly Prices" <price> { channel="energidataservice:service:energidataservice:electricity#hourly-prices" }
```

### Thing Actions Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ public class EnergiDataServiceBindingConstants {

// List of all Channel ids
public static final String CHANNEL_CURRENT_SPOT_PRICE = CHANNEL_GROUP_ELECTRICITY
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "currentSpotPrice";
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "current-spot-price";
public static final String CHANNEL_CURRENT_NET_TARIFF = CHANNEL_GROUP_ELECTRICITY
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "currentNetTariff";
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "current-net-tariff";
public static final String CHANNEL_CURRENT_SYSTEM_TARIFF = CHANNEL_GROUP_ELECTRICITY
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "currentSystemTariff";
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "current-system-tariff";
public static final String CHANNEL_CURRENT_ELECTRICITY_TAX = CHANNEL_GROUP_ELECTRICITY
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "currentElectricityTax";
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "current-electricity-tax";
public static final String CHANNEL_CURRENT_TRANSMISSION_NET_TARIFF = CHANNEL_GROUP_ELECTRICITY
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "currentTransmissionNetTariff";
+ ChannelUID.CHANNEL_GROUP_SEPARATOR + "current-transmission-net-tariff";
public static final String CHANNEL_HOURLY_PRICES = CHANNEL_GROUP_ELECTRICITY + ChannelUID.CHANNEL_GROUP_SEPARATOR
+ "hourlyPrices";
+ "hourly-prices";

public static final Set<String> ELECTRICITY_CHANNELS = Set.of(CHANNEL_CURRENT_SPOT_PRICE,
CHANNEL_CURRENT_NET_TARIFF, CHANNEL_CURRENT_SYSTEM_TARIFF, CHANNEL_CURRENT_ELECTRICITY_TAX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ thing-type.config.energidataservice.service.priceArea.option.DK2 = East of the G

channel-group-type.energidataservice.electricity.label = Electricity
channel-group-type.energidataservice.electricity.description = Channels related to electricity
channel-group-type.energidataservice.electricity.channel.currentElectricityTax.label = Current Electricity Tax
channel-group-type.energidataservice.electricity.channel.currentElectricityTax.description = Electricity Tax in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.currentNetTariff.label = Current Net Tariff
channel-group-type.energidataservice.electricity.channel.currentNetTariff.description = Net tariff in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.currentSpotPrice.label = Current Spot Price
channel-group-type.energidataservice.electricity.channel.currentSpotPrice.description = Spot price in DKK or EUR per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.currentSystemTariff.label = Current System Tariff
channel-group-type.energidataservice.electricity.channel.currentSystemTariff.description = System tariff in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.currentTransmissionNetTariff.label = Current Transmission Tariff
channel-group-type.energidataservice.electricity.channel.currentTransmissionNetTariff.description = Transmission Net Tariff in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.current-electricity-tax.label = Current Electricity Tax
channel-group-type.energidataservice.electricity.channel.current-electricity-tax.description = Electricity Tax in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.current-net-tariff.label = Current Net Tariff
channel-group-type.energidataservice.electricity.channel.current-net-tariff.description = Net tariff in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.current-spot-price.label = Current Spot Price
channel-group-type.energidataservice.electricity.channel.current-spot-price.description = Spot price in DKK or EUR per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.current-system-tariff.label = Current System Tariff
channel-group-type.energidataservice.electricity.channel.current-system-tariff.description = System tariff in DKK per kWh for current hour.
channel-group-type.energidataservice.electricity.channel.current-transmission-net-tariff.label = Current Transmission Tariff
channel-group-type.energidataservice.electricity.channel.current-transmission-net-tariff.description = Transmission Net Tariff in DKK per kWh for current hour.

# channel types

channel-type.energidataservice.datahubPrice.label = Datahub Price
channel-type.energidataservice.datahubPrice.description = Datahub price.
channel-type.energidataservice.hourlyPrices.label = Hourly Prices
channel-type.energidataservice.hourlyPrices.description = JSON array with hourly prices from 12 hours ago and onward.
channel-type.energidataservice.spotPrice.label = Spot Price
channel-type.energidataservice.spotPrice.description = Spot price.
channel-type.energidataservice.datahub-price.label = Datahub Price
channel-type.energidataservice.datahub-price.description = Datahub price.
channel-type.energidataservice.hourly-prices.label = Hourly Prices
channel-type.energidataservice.hourly-prices.description = JSON array with hourly prices from 12 hours ago and onward.
channel-type.energidataservice.spot-price.label = Spot Price
channel-type.energidataservice.spot-price.description = Spot price.

# channel types config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
<label>Electricity</label>
<description>Channels related to electricity</description>
<channels>
<channel id="currentSpotPrice" typeId="spotPrice">
<channel id="current-spot-price" typeId="spot-price">
<label>Current Spot Price</label>
<description>Spot price in DKK or EUR per kWh for current hour.</description>
</channel>
<channel id="currentNetTariff" typeId="datahubPrice">
<channel id="current-net-tariff" typeId="datahub-price">
<label>Current Net Tariff</label>
<description>Net tariff in DKK per kWh for current hour.</description>
</channel>
<channel id="currentSystemTariff" typeId="datahubPrice">
<channel id="current-system-tariff" typeId="datahub-price">
<label>Current System Tariff</label>
<description>System tariff in DKK per kWh for current hour.</description>
</channel>
<channel id="currentElectricityTax" typeId="datahubPrice">
<channel id="current-electricity-tax" typeId="datahub-price">
<label>Current Electricity Tax</label>
<description>Electricity Tax in DKK per kWh for current hour.</description>
</channel>
<channel id="currentTransmissionNetTariff" typeId="datahubPrice">
<channel id="current-transmission-net-tariff" typeId="datahub-price">
<label>Current Transmission Tariff</label>
<description>Transmission Net Tariff in DKK per kWh for current hour.</description>
</channel>
<channel id="hourlyPrices" typeId="hourlyPrices"/>
<channel id="hourly-prices" typeId="hourly-prices"/>
</channels>
</channel-group-type>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

<channel-type id="spotPrice">
<channel-type id="spot-price">
<item-type>Number</item-type>
<label>Spot Price</label>
<description>Spot price.</description>
<category>Price</category>
<state readOnly="true" pattern="%.9f"></state>
</channel-type>

<channel-type id="datahubPrice">
<channel-type id="datahub-price">
<item-type>Number</item-type>
<label>Datahub Price</label>
<description>Datahub price.</description>
Expand All @@ -21,7 +21,7 @@
<config-description-ref uri="channel-type:energidataservice:datahub-price"/>
</channel-type>

<channel-type id="hourlyPrices" advanced="true">
<channel-type id="hourly-prices" advanced="true">
<item-type>String</item-type>
<label>Hourly Prices</label>
<description>JSON array with hourly prices from 12 hours ago and onward.</description>
Expand Down

0 comments on commit 2581fc3

Please sign in to comment.