Alexa Binding - tag question?

I’ve a custom switch (supports OFF, ON and AUTO). Defined as a String type ITEM.
Works great with Habpanel etc, and the RULE switches on/off the various relays as required.
It’s actually a patio light controller (OFF, ON) is obvious, whereas AUTO switches the feed from the PIR in. I’ve been adding automation to some of my existing legacy lighting.

Now, I would like to add this to Alexa for voice control. I know I can create a routine in Alexa to do what I want, but I don’t want to have automation scripts in multiple places.

Before I got off an over complicate things I just want to check what I’m thinking.

I know how to add tags using the REST API, and normally I would add a Switchable tag.
I can see no way to add a tag to support a switch like this, so I’m thinking about creating a switchable ITEM for the LIGHT (ON/OFF) and a switchable ITEM for the MODE (AUTO/OFF).
It’s a little cumbersome, but it means I can leave what I have on the Habpanel, and just have these new ITEMS for the Alexa integration.

Is this the right way to go?

Cheers,

Steve

You should use v3 metadata configuration using a set of proxy items setup as a group endpoint. It’s also configurable through the REST API. This is how I would configure your light:

items

Group gPatioLight "Patio Light" {alexa="Endpoint.Light"}
String Mode "Mode" (gPatioLight) {alexa="ModeController.mode" [supportedModes="OFF=Off,ON=On,AUTO=Auto",friendlyNames="@Setting.Mode"}
Switch Power "Power" (gPatioLight) {alexa="PowerController.powerState"}

utterances

Alexa, turn on patio light
Alexa, turn off patio light
Alexa, set patio light to on
Alexa, set patio light to off
Alexa, set patio light to auto

1 Like

Thanks for helping here.
I’ve been using proxy groups for a few things, and it helps in a lot of areas.

One thing I as struggling with is setting these tags in REST API.
It’s easy with “Switchable”, but I just can’t get the syntax to work for the more complex control.

I’ve been looking at the JSON file created in /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.items.Item.json and it’s just not looking right.

Anyone maybe have an example of what their item entry in the JSON file looks like with the more complex tags set?

Thanks,

Steve

Here is an example, using the REST API web interface:

2 Likes