Official Alexa Smart Home Skill for openHAB 2

I have the following Item/command to arm my security and it works fine when rules are fired for various events. But this command is not doing anything when I try to use Alexa:
Items:

Switch Security "Security System" <light> (gPanel) [ "Switchable" ]
Switch  armStay "Arm Stay"  (gPanel) {alarmdecoder="SEND#ON=xxxx3", autoupdate="false"}

Rule fired through Alexa (Alexa, turn security system on):

rule "Security System ON"
	when
		Item Security changed from OFF to ON
	then
		sendCommand(armStay,ON)
end

In Alexa, I call the same command “armStay” and log says that it was sent but nothing happens in my security system:

2017-04-05 10:15:54.886 [ItemCommandEvent          ] - Item 'Security' received command ON
2017-04-05 10:15:54.973 [ItemStateChangedEvent     ] - Security changed from OFF to ON
2017-04-05 10:15:55.093 [ItemCommandEvent          ] - Item 'armStay' received command ON

Btw, I can successfully turn on/off my TV & receiver by calling Alexa. Not sure what’s wrong.

Try armStay.sendCommand(ON)

That worked. Thanks.

@ashish… What are the chances of a cat burglar shouting “Alexa, turn alarm system off” through a window? Highly unlikely but I guess it’s possible :slight_smile:

Very good point. I have removed the disarm skill. Now using Alexa only to
arm it.

Maybe extend it a bit further to let you turn it off with Alexa but only if your phone is detected on the Wifi?

And if you left your phone at home accidentally or on purpose?

This still is a 100% no-go area. Connecting an alarm system, door opener etc. to black boxes in the internet is highly risky. You may secure everything in your installation with a high-end setup, but do not know who at the hoster (or the software provider, a man-in-the-middle,…) may gain access, not even talking about them being hacked. The insurance company will be happy to hear you gave control over the alarm system to “someone running something somewhere” on the internet.

My opinion: Sometimes security must rule out comfort.

1 Like

If someone is interested i have made an excel sheet that generates items and rules :

item file

Switch HueItem_Entrance_light "Entrance light" Group_HueItems [ "Switchable" ]
Switch HueItem_Hallway_light "Hallway light" Group_HueItems [ "Switchable" ]

Rule file

rule " Alexa, Entrance light;Hallway light ON "

    when

        Item HueItem_Entrance_light changed from OFF to ON Or HueItem_Hallway_light changed from OFF to ON 

     then

LightHallWay.sendCommand(ON)

End



rule " Alexa, Entrance light;Hallway light OFF "

    when

        Item HueItem_Entrance_light changed from ON to OFF Or HueItem_Hallway_light changed from ON to OFF 

     then

LightHallWay.sendCommand(ON)

End
3 Likes

Is it possible to switch lighting color with the openHAB skill?

Hi Guys,

Great work. I hope the current Temp and current Humidity become available soon.
I Setup a Thermostat and can set the target temperature and it also tells me the mode. I would like to set the thermostat to heat for a boost mode. But it seems like i cant set the thermostat mode via Alexa is that correct?

Should work, see first post in:

What exactly do i have to do? In my current setting, i’m not able to change the color.

	Color Wohnzimmerfarbe
	"Wohnzimmerfarbe"
	[ "Lighting" ] 
	{ channel="milight:rgbwLed:F0FE6B2DC252:1:ledcolor"}
	
	Switch Wohnzimmerweiss
	"Wohnzimmerweiss" 
	[ "Lighting" ] 
	{ channel="milight:rgbwLed:F0FE6B2DC252:1:ledwhitemode"}
	
	Switch Wohnzimmerbeleuchtung
	"Wohnzimmerbeleuchtung"
	[ "Switchable"] 
	{ channel="milight:rgbwLed:F0FE6B2DC252:1:ledbrightness"}

That just says limited Thermostat but doesn’t really say what it means. I built the Thermostat consisting targettemp, current temp and mode.
I was expecting that it wont tell me the current temp as this is clearly stated in the description. I can change the Target temp via Alexa and it will respond with the new target temp and the current mode. However i cannot change the current mode via Alexa. Is that expected? or what would be the phrase to change the thermostat mode. I would like to use the heat mode as a boost option.

Thomas

Unfortunately right now the Alexa smart home API just supports reporting on those modes. I would hope that they add the ability to change them as well, just for reference these are the only temperature calls that are supported by their api

GetTemperatureReadingRequest * US only
GetTargetTemperatureRequest * US only
SetTargetTemperatureRequest
IncrementTargetTemperatureRequest
DecrementTargetTemperatureRequest

I am trying to control my Yamaha receiver through Alexa. I can make Alexa turn it on/off and change its input (HDMI1/Bluetooth etc). I have created separate items for each input:

Alexa turn TV on (turns receiver on, sets input to HDMI1 and volume to -40 Db) --> TV (item)
Alexa turn Music on (turns receiver on, sets input to AUDIO1 and volume to -30 DB) --> Music (item) and so on.

It works fine as long as I use Alexa to turn an item on and then off. But if I use my remote to turn receiver on, I am not able to make Alexa turn it off, as the value of that item changes from OFF to OFF, so no change is detected. As a workaround I have to ask Alexa to turn the receiver ON (though it is already playing) and then ask Alexa to turn it off. Is there a better way to change inputs through Alexa?

In your rule are using “Item xxx changed” or “Item xxx received command” ? If you use the later you should be able to respond to the Off command regardless of it changing state.

Color was just added to the smarthome api on April 7th but is not yet supported in our app, see Support Color Lights · Issue #22 · openhab/openhab-alexa · GitHub

1 Like

Is it possible to ask Alexa for the current thermostat temperature? Looking at the source code, I’d guess it should. However, when I ask “What is the temperature in Wohnzimmer?”, Alexa replies with “The command doesn’t work for item ‘Wohnzimmer Thermostat’”.
Changing the temperature does work though.
Here are my items:

Group WZThermostat "Wohnzimmer Thermostat" (gLivingRoom) [ "Thermostat" ]
Number Thermostat_WZ_SetTemp 	"Temperatur Wohnzimmer [%.1f °C]"	<heating> 	(WZThermostat) ["TargetTemperature"] {channel="max:thermostat:KEQ0565677:KEQ0911327:set_temp"}
Number Thermostat_WZ_IsTemp 	"Ist-Temperatur [%.1f °C]"			<heating> 	(WZThermostat) ["CurrentTemperature"] {channel="max:thermostat:KEQ0565677:KEQ0911327:actual_temp"}

In the Alexa configuration, I can only see the Group item, but I guess that’s normal.

Any idea what’s wrong?

1 Like

@digitaldan, I can see you commited the CurrentTemperature feature last month. Is it possible that this is not yet included in the official Alexa skill? Any way to see which commits are included in the official, downloadable skill?

Hi,

is something planed for the future of this skill that alexa will accept custom arguments/commands like color changes for lighting?

Something like this: “Alexa, light green” or “Alexa, livingroom light disco”

It would be really nice to use other (custom) arguments/commands rather than ON/OFF, 1%-100% and so on. :relaxed: