Hi all, I recently setup with success the Amazon Alexa Smart Home Skill allowing me to control via voice recognition the switch items I defined in my items file.
That is, if I say “Alexa, turn on applique”, the switch item GF_LivingRoom_Light is set to ON, as Alexa recognize the label I assigned to each item
Now, I have also String items normally used for feedback (e.g. measured global power consumption, heating running/idle,…) which are not set by user, but just by system.
The question is: How can I retrieve the value of such items saying something like “Alexa, what is the consumption?” getting back from Alexa "I, consumption is five hundred and seventy-two watt"
I dig and dig in Amazon Alexa Smart Home Skill but could not find the way.
I can also replace String with Contact (or Number) if needed.
For the G_Porch_PowerLoadValue item, you can use the RangeValue generic attribute to accomplish that to a certain degree as the unit of measure “Watts” is not supported by the Alexa API as of yet. The item type should be Number.
As far as G_Porch_PowerLoadAlarm, if it’s a toggle on/off then use ToggleState. The item type should probably be Switch otherwise you will need to map the on/off state in metadata parameters.
but I cannot still figure out what I need to ask to Alexa to retrieve back the current numeric value (no problem if it comes without unit of measurement).
If I ask *Alexa, what is the consumo" (means consumption), Alexa answers with a off-topic wikipedia definition.
What should I ask???
for G_Porch_PowerLoadAlarm if I replace String with Switch I obtain in openHAB app the usual toggle left/right switch, but in this case it would be unwanted/confusing as it shouldn’t be imposed by user (user has to just read its ON/OFF state)
If I solve the Alexa retrieving when item is Number (G_Porch_PowerLoadValue case), I could turn also G_Porch_PowerLoadAlarm to Number
You have to include the capability name, which defaults to “range value” since it’s a single endpoint. So you should be asking Alexa, what’s the consumption range value
You may want to set both functionalities as a group endpoint.
every question I ask, in any form, in any language, swapping the terms in any way, Alexa answers with wikipedia/off-topic content (not with the current value as before).
Have you any hint for retrieving status when items are in group? Else I must remove the group.
Remark:
I need to use Number rather than String for G_Porch_PowerLoadValue else I lose the persistency graph in OH, not available when item is String
I need to use String rather than Switch for G_Porch_PowerLoadAlarm since this represents a STATUS (just feedback to the user)
In other words:
item is string (wanted, as user can only read it)
That’s because you translated the Alexa metadata syntax. It should be {alexa="Other"}. Only user-defined label names can be translated.
You do know that you can configure a read-only Switch as a Text element in your sitemap page.
Text item=G_Porch_PowerLoadAlarm
If you intend to use a String for that item, then you will have to define the on/off mappings in the metadata parameters as indicated in the ToggleState documentation.
No, I really miss it and slowly realize my sitemap was all mixed up (too many copy-paste without deeper knowledge). Now I am fixing, also observing some example projects with their sitemap/items/rules