Can Alexa Skill read an OH-parameter value?

Hi All,

Can Alexa Skill read an OH-parameter value?

My OH-configuration has a parameter that stores the volume of rainwater in liter in
the cistern. Is it possible to configure this item so that Alexa reads this parameter when asked “what is the volume of rainwater”? Does somebody have an example that works?

It works perfectly for ‘temperature’ and ‘humidity’, but these parameters are predefined. I assume something with RangeController.rangeValue could be done but I’m not getting there.

This is what I tried based on the documentation.

Number:Volume RegenPutInhoud "Regenwasser [%d liter]" <water> {alexa="RangeController.rangeValue" [nonControllable=true, unitOfMeasure="Volume.Liters"]}

Thx,
Jan

Can you use a rule and copy to a temp or humidity item? Just ask what’s temp
 you then just know it’s liters vs degrees?

@Jan_Mechelen Could you describe what do you mean by “I’m not getting there”? You are on the right track in using the RangeController interface.

With your item example, you should be able to ask “what is the state of rainwater”

If you care about having “volume” support, you should specify it as friendly name translated in your language if necessary. That way, you can ask “what is the volume of rainwater” or “what is the state of rainwater volume”.

Number:Volume RegenPutInhoud "Regenwasser [%d liter]" <water> {alexa="RangeController.rangeValue" [friendlyNames="Volume", nonControllable=true, unitOfMeasure="Volume.Liters"]}

@Jan_Mechelen did it work out for you?

I have a similar problem on OH3 with a number item:

The item is a number and the alexa config looks like this:

value: RangeController.rangeValue
config:
  supportedRange: 0:500:1
  nonControllable: true
  language: de
  friendlyNames: Zucker,Blutzucker 

The “device” shows up in the alexa app and everything looks fine. But I can’t ask for that device.

“Alexa, what is the state of Zucker?” or “Alexa, what is the value of Zucker Wert?” or any combination of that doesn’t give me the right answer. Alexa tells me something about sugar. :wink:

Is that because of the ambiguous naming of the item?

Yes probably because of the term “zucker” is present in the item name along with friendly names. You have to keep in mind that friendlyNames is naming the range component of your device “Zuckerwert”. You don’t need to include the device name in your request when the friendly names are clearly distinct. However, in some cases you need to include it (e.g. Zucker of Zuckerwert).

Have you tried a dummy term by any chance? Another option would be to leave friendlyNames undefined and you should be able to call that device with the name Zuckerwert. Also, make sure to check your Alexa voice history to see what was understood.

I renamed my Item. Now it’s called “Blutzucker” and is knows in the Alexa-App under that name. I also removed the friendly name.
I think my Echo Show doesn’t know this “Device” even though they are in the same group. The voice history shows that my question was understood correctly. I tried:
What is the value of Blutzucker?
Answer: "I found the following on the Web
 [in German of course]

{\"spokenAnswerSsml\":\"Folgendes habe ich im Web gefunden und ĂŒbersetzt. Laut hubpages.com: Die einfache Funktion von Zucker im Blut bestand zunĂ€chst darin, Energie zu liefern.<\\/p><\\/prosody>AnswerSsml<\\/promptId>SmartDJ.MusicQA<\\/namespace>de_DE<\\/locale>default<\\/overrideId>809dfcd2-2807-4eaf-93e9-1130c2db01fa<\\/variant>1<\\/weight>Adm-20160403_211532-21<\\/stageVersion><p xmlns:ivona=\\\"http://www.ivona.com/2009/12/ssml\\\" xmlns:amazon=\\\"https://amazon.com/ssml/2017-01-01/\\\">Folgendes habe ich im Web gefunden und ĂŒbersetzt. Laut hubpages.com: <break time=\\\"0.5s\\\"/> Die einfache Funktion von Zucker im Blut bestand zunĂ€chst darin, Energie zu liefern.</p><\\/answer>AnswerSsml<\\/promptID>SmartDJ.MusicQA<\\/namespace><\\/promptData><\\/promptMetadata><\\/metadata><\\/speak>\",
\"entryType\":\"Knowledge\",\"answerText\":\"Folgendes habe ich im Web gefunden und ĂŒbersetzt. Laut hubpages.com: Die einfache Funktion von Zucker im Blut bestand zunĂ€chst darin, Energie zu liefern.\",\"answered\":true,\"validForGUI\":true,\"searchQueryText\":\"\",\"domains\":[],\"spokenAnswerText\":\"Folgendes habe ich im Web gefunden und ĂŒbersetzt. Laut hubpages.com: Die einfache Funktion von Zucker im Blut bestand zunĂ€chst darin, Energie zu liefern.\",
\"understood\":true,\"questionText\":\"wie ist der wert von blutzucker\"}]}`

Similar behaviour for the question “What is the status of Blutzucker?”
Alexa answers: “Sorry I’m not sure”

You need to use the term “status” or “state” otherwise it won’t trigger a smart home skill request on the Alexa side.

Can you provide the updated item definition? Also, did you remove your previous discovered device from your Alexa account?

I also used “Zustand” which means state without success.

I removed the old “Zuckerwert” und discovered “BLutzzucker” from scratch.

[Is there any other way to provide item definitions?]

The Alexa-Metadata looks like

value: RangeController.rangeValue
config:
  supportedRange: 0:500:1
  nonControllable: true
  language: de

So I went ahead and tried it myself and it is driving me insane :slight_smile: While I assumed it would be straight forward, it doesn’t seem that the direct translation of the English translation is working in German for this endpoint type. The lack of German utterance examples in the Alexa developer API documentation doesn’t help on top of it.

At this point, I am not sure what to recommend for your issue. You can try to use less common words to see if it makes a difference.

In the meantime, I have opened a case with the Alexa developer support team. Let’s see what they come back with.

The way you are providing the information below is fine. You don’t need to include the screenshot. Just include the item name and its label should be fine.

Ok, thanks for your support!!

I accomplished this using Node-Red along with OH. My son always wanted to know what the temperature of the swimming pool was, and this was a value OH knew coming from the Autelis binding.

I then was able to craft the question and response in Node-Red which meant I could ask the way I wanted and get the answer back spoken as desired.

So the issue I experienced might actually be related to the Alexa simulator I am using to test other languages. It might actually work on your end. You can check the example below and update your item the same way friendlyNames="Wert".

Amazon finally released a bug fix for RangeController Non-Controllable requests in German.

Please could you give an example of how you solved the problem with a node, to be able to import it
Thank you

I had the same problem with energy consumption, energy production, pollen levels, UV index, “heating index”, etc
 and ended up by writing a custom skill.
If you are ok to keep your skill for your use only and are happy to hard code item names or credentials, knowing a bit of javascript is quite easy to develop a skill with the online alexa development console.
Of course it’s not a solution you are going to publish on the store, but it works and is quite funny. With 600 lines of code I could do a lot of stuff and now I can ask things like “alexa, ask Jarvis if heating is on” and get back answers like “The heating is on in 3 rooms: living room, bathroom and studio, and the heating has been on for 5.7% of the time in the last 24 hours”.

If anyone is interested I can tell my story with some more details.
ciao.

1 Like

Yes, my config is working now. I can ask Alexa: “Alexa, what is the value of Blutzucker?” in German: “Alexa, was ist der Wert von Blutzucker?”

The Alexa-Metadata is:

value: RangeController.rangeValue
config:
  supportedRange: 0:500:1
  nonControllable: true
  language: de
  friendlyNames: Wert
1 Like