Help with Alexa skill

I’m finding setting up the Alexa skill to be very confusing. I’ve read the docs but I think I’m missing something important. I have a light on a dimmer switch that I want to control via Alexa. I can control it via the OpenHab app so I know that it set up correctly. Here is my very simple layout

If I select the Office light item it looks like this

I selected Add Metadata and I get this:

but even after I have saved this the code tab is empty

I tried following the troubleshooting and Alexa said it doesn’t know about the device so I tried “Alexa discover” and it said that it discovered 2 items but didn’t tell me what they were. It still says that it doesn’t know of a group or device called “Office light” or “Office light dimmer”.

What other troubleshooting steps can I take? I don’t see anything interesting in the logs either.

As far as I can see from a quick check you’re missing the Alexa metadata for the dimmer item. You have to add that first. Then add the metadata for the group and openhab shows the recognized sub-items.

I already had that but I didn’t have a screen shot of it.
I removed all the metadata, then added the dimmer metadata first

and then the light metadata,
Now when I ask Alexa to turn on the Office Light she says “HP OfficeJet printer doesn’t support that.” I don’t seem to be able to get rid of that item even if I delete it or disable it.

In your last example I’m not sure "Office_Light_Dimmer will work for the Name .
The Name will be in the utterance so I’m not sure how you would say that name to Alexa. Why not just call it Office Light?

I would add a switch item and define the Device/Attribute as Light.powerstate.
And keep your Dimmer item with Device/Attribute as light.dimmer

Won’t that conflict with the Office_Light group which contains the Office_Light_Dimmer and the Last_Heard_From points?

Don’t you need a switch item to switch something on and off?
My dimmer group contains a switch and a dimmer item with metadata like this:


And: Why don’t you see your device in the Alexa app under devices? If something is detected you should see it and be able to control it.

The Alexa app? Do you mean the OpenHab app or just the site. It looks like this:

on and I can just drag the slider to turn it on.

You can confirm the 2 devices that was discovered in your Alexa App. Also, it would help if you could provide the utterance voice command you are requesting as well.

There is no need to expose a group endpoint if you are only exposing one attribute. So for your use case, you should only expose your Office_Light_Dimmer item as a Light single endpoint. No need to configure the group.

Keep in mind, when deleting Alexa metadata on the OH side, you also need to clear your discovered devices on the Alexa side as well.

Yes, the Alexa App from the play store or app store. There you can handle your detected devices from openhab (that have the correct metadata).

So I installed the Alexa app on my phone and it shows that Alexa does not see anything other than the device itself, echo and two printers trhat I don’t want it to see. Neither the light, the TV, the sprinkler system nor the printer I do want it to see are listed under Devices.

Is there something special I have to do to have it recognize those items?

I also removed the metadata from the Office Light group and changed the label of Office Light Dimmer to just Office Light.

Yes, you have to install the openhab-skill in the Alexa-app.
And the cloud service has to be running within openhab.

Getting there.

So for others reading this thread later:
I have the Alexa app and the OpenHab app installed on my phone (Android).
I open the Alexa app and select “More” at the bottom of the screen.
From there I select “Skills & Games”.
Next I enter “OpenHab” in the “Search Alexa Skills” area at the top of the screen.
It finds OpenHab and I select it.
I press the “ENABLE TO USE” button and it starts to link the accounts
Now I have to log in to MyOpenHab
Agree to Alexa accessing OpenHab and press Continue
Linking is complete, press Next
Alexa discovers devices.
Select a device and press “Set Up Device”
Follow the instructions

I can now say “Alexa, turn Office Light to 100%”
but if I try “Alexa, turn on Office Light” she says “Office Light doesn’t support that”

Got to do some more reading but good progress.
Thanks Larsen!

That’s because you setup your Office_Light_Dimmer item with the Brigthness attribute only. As I mentioned above, you should directly setup that item as a Light single endpoint and remove the metadata configuration at the group level.

I want to be able to do both. That is I want to be able to say “Set Office Light to 50%” and be able to say “Turn Office Light on”. The Thing has no switch channel, only a dimmer channel and things like dimmer ramp rate.
So I need Alexa to hear “Turn Office Light on” and translate that to “Set Office Light to 100%”.
Well, I added Light.PowerState to the metadata for the Office_Light_Dimmer and that seems to work.

That works too but again exposing your Office_light group item to Alexa is unnecessary in your use case. I would still recommend getting familiar with the single endpoint concept.