Official Alexa Smart Home Skill for openHAB 2

@Kai thats helpful to know, v3 still supports the current tagging syntax, but there was talk about how long that would be supported for once metadata became common. I know there are a few threads on github around tags and metadata, but I wonder if need need one more discussion about how both are used together as its not clear to me what the expected use is for both going forward. In any case, tagging will not be deprecated in the skill for sure.

The Alexa API does not support stop, open or close yet. Rollershutters are treated like dimmable controls, so on, off or %. If they do add this in the future we will of course support it.

1 Like

You can make Echo respond to any speech you want using “Routines” in the Alexa App (not the browser version).
Create a new routine.
Decide what speech you want
Link the speech to an Alexa-enabled openHAB routine (virtual switches and rules are useful here).

I used to have to say “Alexa, turn on the terrace door shutter UP”.

Now I say, “Alexa, open the terrace shutter”.

2 Likes

Could you please share your Item definition and rule. I tried to achieve the same but just get a „sorry the device does not support that“ from Alexa.

Thanks but I get the same Alexa response as Hans … ‘device not supported’.

I guess you must mean set a dummy light switch up on the BUS and use Alexa to Routine to operate that and then when that switches On, Off use either a rule or a scenario to switch the real blind actuator Up or Down

I have used virtual Switches for my rules, tagged them as „Switchable“, but Alexa sees them as Lightbulbs and tries to switch them on and set brightness to 100/0 percent

Sure.
I ought to point out that using routines, Alexa doesn’t analyse the text string for values etc so it’s one string for one command. What that means is that if you want the shutters at 50%, you’ll need a routine with a string which explicitly states “Alexa, set shutter to 50%” and if you want your shutters at 30%, you’ll need a new routine created which states “Alexa, set shutter to 30%” .

My example is with a security roller shutter which I only want totally up or totally down.
My example is a bit complicated too as the shutter is Bubendorff and you cannot access the RF codes themselves so I use an Arduino to set the old remote switch levels to 0V or 3V3 and MQTT for the Arduino to talk to openHAB via wifi.
It was one of the first things I did with openHAB and I’m going to improve it - one day.

Items:

Switch virShutterTerraceDoorUP "Terrace door shutter up" [ "Switchable" ] 
Switch virShutterTerraceDoorDOWN "Terrace door shutter down" [ "Switchable" ]

Switch ShutterTerraceDoorUP    {mqtt=">[mosquitto:house/shutters/TerraceDoor/up:command:ON:UP]"} 
Switch ShutterTerraceDoorDOWN  {mqtt=">[mosquitto:house/shutters/TerraceDoor/down:command:ON:DOWN]"} 

Rule:

rule "terrace door shutter UP"

when

	Item virShutterTerraceDoorUP changed

then

	if (virShutterTerraceDoorUP.state == ON ) {
		
		sendCommand(virShutterTerraceDoorDOWN, OFF)
		sendCommand(ShutterTerraceDoorUP, ON)
		   createTimer(now.plusSeconds(2)) [|
		   	sendCommand(virShutterTerraceDoorUP, OFF)
		   	logInfo("Shutters","Terrace door shutter up through openHab")
        ]
	}

end

rule "terrace door shutter DOWN"

when

	Item virShutterTerraceDoorDOWN changed

then

	if (virShutterTerraceDoorDOWN.state == ON ) {
		sendCommand(virShutterTerraceDoorUP, OFF)
		sendCommand(ShutterTerraceDoorDOWN, ON)
			createTimer(now.plusSeconds(2)) [|
				sendCommand(virShutterTerraceDoorDOWN, OFF)
				logInfo("Shutters","Terrace door shutter down through openHab")
        ]
	}

end

Next you need to discover the Devices in the Alexa app.

After that, in the smartphone/tab app:

  • Menu
  • Routines
  • “+” When this happens…
    Add text for what you want to say:
Alexa, open the terrace shutter
  • “+” Add action…
  • Select “smart home”
  • Select "Terrace door shutter up!
  • Save

Create a second routine for Shutter Down.

Wait a couple of minutes for Alexa to sort itself out before testing.

This is perhaps a bit complicated for shutters and it’s much easier with Somfy shutters etc. but it works and the response in instantaneous so I’m happy.

I ought to add that the reason for virtual and real items is so I can use the virtual items in rules, HABpanel, Alexa routines etc and have the two shutter rules control the actual shutters without any problems.

1 Like

Mine does that too. Set them at 100% and they act as if they have two states, ON and OFF.

That‘s exactly how I did it, so I will have to dig deeper into this.

Hi Thanks for that. I got it working with one slight change. I needed to use 0 for OFF and 100 for ON for the real blind item.
Mark.

Update:
Yesterday I tried to integrate another item in Alexa Smart Home.
As before, the new item was not found and I got the same log errors again.
After more intensive testing, I find out that apparently too many items are present through the REST API. (Yes I have many items over 500), so either the Skill runs into a time out(?).
Then I removed all the item files that were not tagged (then maybe there were 100-150 items left) and behold the new item was found.

Is there any option to switch off the microphone of Alexa remotely Instead of pushing the physical button to make Alexa stop listening?

I also had an issue with Alexa discovery from one minute to the next. In my case it was my nginx proxy that needs to write temp files because of the response size. And this was not correct configurated, no access for the user.

You can simply check it with current url:

https://:/rest/items?&metadata=alexa&recursive=true

For me it runs on localhost without proxy, from externel with proxy it fails

I’m trying to use virtual items as you suggest to trigger a rule
However when activating them via the echo I get a “Server is not responding” error
This isn’t the case when I use the echo to control other openhab items (e.g. my lights)

Switch xSleep_Mode “Sleep Mode Virtual Trigger” [“Switchable”]

Defines my item - do I need to do something more to allow my echos to control this virtual trigger?

1 Like

There is some forecast when it will be supported in Spanish or how it could be helped

1 Like

Spaces are missing:
Switch xSleep_Mode “Sleep Mode Virtual Trigger” [ “Switchable” ]

Thank you - resolved and working now!

You should update the link to Homekit documentation in the first post as the current one gives a 404 error.
The correct link is: https://www.openhab.org/addons/integrations/homekit/#global-configuration

I’m trying to use the binding to get one of my Alexa Echos to play an audio book from Audible. I’m able to change the music provider ID to “AUDIBLE” or “Audible”, it seems to accept both. When I sent the command to the voice command music channel to play a book I get an exception telling me the command cannot be interpreted. Should I be using another channel?

Hey,

I use the Alexa skill v2 since some months and it’s really very, very usefull! But I’m quite keen on API v3 support, as it seems there are much more possibilities.

Is API v3 already available via the openhab cloud skill?

Is there a collection of commands and questions alexa API v3 can support/answer (in german). E.g. how can I ask, which postition my shutter has?
“Alexa, welche Stellung hat der Rollo im Wohnzimmer?”
“Alexa, wie hell ist das Wohnzimmerlicht?”
“Alexa, wie warm ist der Termostat im Wohnzimmer eingestellt?”
I’m, quite sure that alexa won’t anser my questions, but which would be the right formula? Where can I find the commands?

How can I rule my music player? Which commands do I have in german?
“Alexa, starte Player im Wohnzimmer”
“Alexa, überspringe das aktuelle Lied”
“Alexa, mach Player im Wohnzimmer lauter”
“Alexa, spule Player im Wohnzimmer vor/zurück” - how can I stop the fast for-/backward?

Are this correct item definitions:

Rollershutter RolloWohnzimmerLinks "Rollo Wohnzimmer Links [%d %%]" (gRollo) [ "Alexa.PowerController.powerState","Alexa.BrightnessController.brightness" ] { knx="1/3/0,1/3/9,1/3/18<3/3/18" }

Group gPlayerWohnzimmer "Squeezebox Wohnzimmer"	 <squeezebox>	 ["Alexa.Endpoint.Speaker"]
Dimmer sq_wohnen_volume "Wohnzimmer Lautstärke" <volume> (gPlayerWohnzimmer) ["Alexa.Speaker.volume"]    { channel="squeezebox:squeezeboxplayer:bebaee7f:wohnen:volume" }
Switch sq_wohnen_power "Wohnzimmer Lautsprecher" <exit> (gPlayerWohnzimmer)	["Alexa.PowerController.powerState"] { knx="1/5/2+<3/5/2", channel="squeezebox:squeezeboxplayer:bebaee7f:wohnen:power" }
Player sq_player_wz "Player Wohnzimmer" <playlist> (gPlayerWohnzimmer)	 ["Alexa.PlaybackController.playback"] { channel="squeezebox:squeezeboxplayer:bebaee7f:wohnen:control" }

Group   gThermostatWohnzimmer "Wohnzimmer" ["Alexa.Endpoint.Thermostat"]	  
Number  AktuellerSollwertWohnzimmer  "Wohnzimmer akt. Soll [%.1f °C]"  <temperature>  (gThermostatWohnzimmer) ["Alexa.ThermostatController.upperSetpoint"] { knx="1/4/37" }
Number  IstwertWohnzimmer  "Wohnzimmer Thermostat [%.0f °C]"  <temperature>  (gThermostatWohnzimmer) ["Alexa.TemperatureSensor.temperature"] { knx="0/3/0", expire="120m" }
1 Like