Energi Data Service Binding [4.0.0.0;4.1.0.0)

Nice, so you should already be able to automate the switching between full and reduced electricity tax.

Yes, see Energi Data Service - Bindings | openHAB.

Yes, that’s the recommended way also mentioned as an example here: Energi Data Service - Bindings | openHAB

Correct. :slight_smile: If you want something estimated, you could of course use consumption from previous year and calculate average from that - but naturally it wouldn’t represent the correct actual price.

See Energi Data Service - Bindings | openHAB

1 Like

I will give it a try one of these days, and give you a shout when running into problems :slight_smile:

1 Like

Here we go:

Pull request is here:

I can provide you with a JAR, just let me know which openHAB version you are using (4.0 or 4.1).

I upgraded from 3.x to 4x a few weeks ago. Im not quite sure which version Im actually running right now, beside its 4.x something :slight_smile:
Will check later today when I get back from work.

Hi Jacob.

Im running openHAB 4.0.0 Release Build. I will probably be upgrading to 4.0.3 soon. But I guess its the same binding version to use?

Yes. There’s also a 4.0-compatible JAR here with a channel for reduced tax:
org.openhab.binding.energidataservice-4.1.0-SNAPSHOT.jar

Please note that this channel may disappear again as I’m still considering how to best support this.

Exposing tax as two separate channels is very flexible since the raw data is simply provided, and you can use it however you’d like.

The downside is that the binding doesn’t know which rate is being used, which makes thing actions more complex, because you’d have to specify which price elements to include in the total price. Therefore I’m leaning towards having only a single channel exposed, and let the user control which rate to use. The requirement here is that it must be possible to flip this setting from rules, so that you can automate it to switch to reduced rate when passing 4000 kWh within a year.

I think that rules out configuration, because file-based configuration cannot be updated by the binding.

A channel could be used, but this would also introduce some complexity because you will probably need a persisted item for this with restoreOnStartup, and configuration is somewhat more complex because it’s not part of the UI where you’d usually find such options.

If you have any ideas, let me know. As you can probably tell, I’m still struggling to get this part right.

I understand your concern… Its a typical danish mess to do these reduce taxes, and hard to calculate when trying to calculate fulll price in an hour.

It is indeed a hard one… But I wonder if anyone else has managed it… I doubt I´m the only one :slight_smile:

Hi Jacob.
Maybe I have misunderstood this binding.
I installed the binding last night, configured the Thing, made the default items (from your example)… Only to discovered nothing happens. None of the items has updated at all.

Are the scripts necessary to receive/update data?

No. Can you show your configuration and/or paste logs?

This is the THing configuration:

UID: energidataservice:service:9cb682c5e9
label: Energi Data Service
thingTypeUID: energidataservice:service
configuration:
  gridCompanyGLN: "5790000705184"
  energinetGLN: "5790000432752"
  priceArea: DK2
  currencyCode: DKK

My items:

Group:Number:SUM TotalPrice   "Current Total Price"         <price>

Number SpotPrice              "Current Spot Price [%.1f kr]"          <price>   (TotalPrice)       { channel="energidataservice:service:9cb682c5e9:electricity#spot-price" }
Number NetTariff              "Current Net Tariff [%.1f kr]"          <price>   (TotalPrice)       { channel="energidataservice:service:9cb682c5e9:electricity#net-tariff" }
Number SystemTariff           "Current System Tariff [%.1f kr]"       <price>   (TotalPrice)       { channel="energidataservice:service:9cb682c5e9:electricity#system-tariff" }
Number ElectricityTax         "Current Electricity Tax [%.1f kr]"     <price>   (TotalPrice)       { channel="energidataservice:service:9cb682c5e9:electricity#electricity-tax" }
Number TransmissionNetTariff  "Current Transmission Tariff [%.1f kr]" <price>   (TotalPrice)       { channel="energidataservice:service:9cb682c5e9:electricity#transmission-net-tariff" }
// String HourlyPrices        "Hourly Prices [%.1f kr]"               <price>                      { channel="energidataservice:service:9cb682c5e9:electricity#hourly-prices" }

The only warning I get in the logfile is this. And a bit kinda strange, since I have removed the VAT profile from the items. Yet I get this warning.

2023-09-25 18:46:53.893 [WARN ] [.thing.internal.CommunicationManager] - No ProfileFactory found which supports profile 'transform:VAT' for link 'SpotPrice -> energidataservice:service:9cb682c5e9:electricity#spot-price'
2023-09-25 18:46:53.895 [WARN ] [.thing.internal.CommunicationManager] - No ProfileFactory found which supports profile 'transform:VAT' for link 'NetTariff -> energidataservice:service:9cb682c5e9:electricity#net-tariff'
2023-09-25 18:46:53.896 [WARN ] [.thing.internal.CommunicationManager] - No ProfileFactory found which supports profile 'transform:VAT' for link 'SystemTariff -> energidataservice:service:9cb682c5e9:electricity#system-tariff'
2023-09-25 18:46:53.897 [WARN ] [.thing.internal.CommunicationManager] - No ProfileFactory found which supports profile 'transform:VAT' for link 'ElectricityTax -> energidataservice:service:9cb682c5e9:electricity#electricity-tax'
2023-09-25 18:46:53.898 [WARN ] [.thing.internal.CommunicationManager] - No ProfileFactory found which supports profile 'transform:VAT' for link 'TransmissionNetTariff -> energidataservice:service:9cb682c5e9:electricity#transmission-net-tariff'

That’s probably the reason. You might be experiencing a file reloading problem. You can try to rename your .items file (e.g. add _ at the end) and back again. Or restart openHAB.

HMMM… I thought openHAB had this fixed years ago. Back then renaming each item was required.

I tried rename the items file… Didnt change anything. Still get the warning of the missing tranformation VAT. I probably have to rename each item again :frowning:

EDIT - Renaming all items made it work.

I might getting old here. But I simply cant get the Group item to work. Its empty for god know what reason, and stay empty,

Are you aware of any issues with Group (SUM) in OH 4.0.0 ?

No. I can only propose to try to configure the items in the UI to rule out syntax issues with your items file.

I think there is a cache problem somewhere. The item works fine when looking at it in UI, but not in Sitemap. No need to deal with it anymore, as I´ll be creating a widget to use in a page for UI :slight_smile:

Next I need to add VAT. I have to admit, I didnt really understand the part of the VAT transformation.
Am I suppose to create the VAT script myself? In your doc you link to an transformation VAT. But I cant seem to find it.

Ps Regarding the reduced tax, I will be using the full tax, untill I figure how to calculate the reduce tax,
But whats missing right now, is a channel for adding extra cost to the spotprice, (from the eletric company). I´m supscriped to Modstrøm… But I had to admit, I have no idea how much extra they add. I think its 18.75øre/kWh. But because of my subscription, its only between 17-21 insted of 24hours. Again this simply makes it even more difficult to calculate the correct full price, which is so damn typical for Denmark :frowning:

I’m not sure I understand. I checked the link from the documentation, and it’s working. You simply need to install the VAT transformation (like you would install a binding). When installed, you can select the VAT profile on your channel<->item link, and the VAT will be included automatically.

This is also documented:

So you can simply create another item for this fee for your electricity supplier and include it in the TotalPrice group.

Found it…
Its kinda weird… When searcing for “VAT” in the Transformation it found nothing.
Then I read the add-ons names, and one of them named “Valued-Add-Tax”, which ofocuse is VAT :slight_smile:
But after installing it, its named “Moms Transformation” :rofl:

No wonder things can be a little difficult sometimes :smile:

I may have overlooked that.

Using a manual updated item could be used. And then use a rule to set the value for the item dependng of the hour of the day, due to my subscription to Modstrøm. I think thats the easiest way.

Whoops, I should probably consolidate as either VAT or Value-Added Tax. Thanks for noticing.

Yes, this part I cannot “fix” without removing the Danish translation. It happens because translations are not available until the add-on has been installed. It’s a bit unfortunate. The unavailability of such metadata before installation is also related to other issues:

A PoC for the discovery issue is currently in progress. It will be interesting to see the final outcome and if this will pave the way for resolving some other issues as well.

Exactly. However, it’s new to me that some electricity suppliers have dynamic rates during the day. I thought that only applied to spot prices (obviously) and net tariffs. Be aware that internal calculations in the binding will not consider such externally supplied rates. So far this wasn’t a problem, since you really just want to get the cheapest price, and with fixed rates, the fee of the electricity supplier would not make any difference.

This is probably good to have in mind for:

I know… Its just fun to see a binding/tranformation changin name like that… I couldnt find it at first after installation, before i discovered the name change :sweat_smile:

Modstrøm is not really a good electricity company.
I have thought about changing many times, cause some of their price settings is not quite obvious. They have this extra fee to the spotprice, which is normal. But then they have something called (System Tarif - Yes the same name as the real System tarif), which is just a plain “extra extra” fee. This so called System Tarif is not obvious mentioned anywhere. And some consumers thinks its some exstra costs from the Eletricity (net) due to the naming… Its really bad. But thats just Modstrøm.

Is there anyway to check if the VAT has been added… I installed the tranformation, and just added the VAT to the profile. But none of my items has changed in value ??

This is my items file:

Group:Number:SUM TotalPriceA   "Current Total Price [%.2f kr]"         <price> 

Number SpotPriceA              "Current Spot Price [%.2f kr]"          <price>   (TotalPriceA)       { channel="energidataservice:service:9cb682c5e9:electricity#spot-price" [profile="transform:VAT"] }
Number NetTariffA              "Current Net Tariff [%.2f kr]"          <price>   (TotalPriceA)       { channel="energidataservice:service:9cb682c5e9:electricity#net-tariff" [profile="transform:VAT"] }
Number SystemTariffA           "Current System Tariff [%.2f kr]"       <price>   (TotalPriceA)       { channel="energidataservice:service:9cb682c5e9:electricity#system-tariff" [profile="transform:VAT"] }
Number ElectricityTaxA         "Current Electricity Tax [%.2f kr]"     <price>   (TotalPriceA)       { channel="energidataservice:service:9cb682c5e9:electricity#electricity-tax" [profile="transform:VAT"] }
Number TransmissionNetTariffA  "Current Transmission Tariff [%.2f kr]" <price>   (TotalPriceA)       { channel="energidataservice:service:9cb682c5e9:electricity#transmission-net-tariff" [profile="transform:VAT"] }
// String HourlyPrices            "Hourly Prices [%.1f kr]"               <price>                       { channel="energidataservice:service:9cb682c5e9:electricity#hourly-prices" }

EDIT - Restart of openHAB fixed it.