Metadata for Alexa price integration

OH4.1.1 release.

I want to ask Alexa about the current price for dynamic energy prices like Tibber.
My item is configured like this:

label: Strompreis
type: Number:Dimensionless
category: ""
groupNames:
  - TibberAPI
tags:
  - Point

The value is in Euro, so currently it’s “0.235” as in 23,5 cents. (That’s the value, the Tibber binding sets).

What Akexa-metadata don I need to set to be able to ask Alexa, what the current price is? I only got *.Level or *.RangeValue to choose from and both don’t seem to do the trick as they expect some kind of percentages and it’s always zero…

Using the RangeValue metadata device attribute should work. However, the skill is limited to what the Alexa API is providing and unfortunately there is no currency unit of measure available. So the best you would get is the decimal number value returned as is. Keep in mind that the skill uses the item state presentation. Make sure to set it if you want limit the number of decimals returned.

1 Like

ok, thanks!
I had to adjust the ranges accordingly:

value: Other.RangeValue
config:
  supportedRange: 0:0.5:0.01

no I get the €-cent values of the current energy costs.

Hopefully amazon does add currency soon enough, but for the time being it’s ok.

Good catch. I don’t recall if the Alexa SMAPI used to round the value returned based on the configured precision. Anyway, I have pushed a change updating the documentation and defaulting the precision for range value read only number item type to the state presentation if available, otherwise 0.01.

The Alexa SMAPI supported units of measure haven’t changed in years. So I wouldn’t bank on them adding any new ones in the future unless it would benefit a new smart home product Amazon intend to sell.

1 Like

Actually, the rounding based on the configured precision only happens when requesting the state by voice. In the Alexa app, the state displayed is the item state returned by OH.