Official Alexa Smart Home Skill for openHAB 2

And you did tag your items correctly?

http://docs.openhab.org/addons/io/homekit/readme.html

@sihui Yes, I did!

I tried both: [ “Lighting” ] and [“Lighting”]…

My alexa language is german!

Still no devices detected!

Any hints?

These are two of my working items with openhab 2.1.

Color  Fenster_Color         "Fenster Licht" [ "Lighting" ] { channel="lifx:colorlight:fenster:color" }
Switch Alexa_RadioBK	"Radio Bad"	[ "Switchable" ]	{autoupdate="false"}

How do your item definitions look like?

@christoph_wempe

Switch	Hue_Light3_Toggle		"Licht Bibliothek"	<light>	(GF_Biblio, Lights)	[ "Lighting" ]	{channel="hue:0100:0017882971e8:8:brightness"}	  
Switch GHoma5					"Dose Vitrine"		<light>	(GF_Living, GHoma)	[ "Switchable" ]	{ http=">[ON:GET:http://192.168.178.24:3000/on/3ef204] >[OFF:GET:http://192.168.178.24:3000/off/3ef204] <[http://192.168.178.24:3000/state/3ef204:64000:MAP(onoff.map)]" }   
Number GF_Kitchen_maxActual  "IST Temperatur  [%.1f °C]" <temperature>	(gMAX, GF_Kitchen, Temperature1)	 [ "CurrentTemperature" ]	{channel="max:thermostat:LKF0025489:MEQ1442698:actual_temp"}

@christoph_wempe

and in

https://myopenhab.org/rest/items it looks like:

{"link":"https://myopenhab.org/rest/items/Hue_Light3_Toggle","state":"OFF","type":"Switch","name":"Hue_Light3_Toggle","label":"Licht Bibliothek","category":"light","tags":[" Lighting "],"groupNames":["GF_Biblio","Lights"]}

{"link":"https://myopenhab.org/rest/items/GHoma5","state":"OFF","type":"Switch","name":"GHoma5","label":"Dose Vitrine","category":"light","tags":["Switchable"],"groupNames":["GF_Living","GHoma"]},

{"link":"https://myopenhab.org/rest/items/GF_Kitchen_maxActual","state":"NULL","stateDescription":{"pattern":"%.1f °C","readOnly":false,"options":[]},"type":"Number","name":"GF_Kitchen_maxActual","label":"IST Temperatur","category":"temperature","tags":["CurrentTemperature"],"groupNames":["gMAX","GF_Kitchen","Temperature1"]}

but I have also the following “Lighting” tags, but I NEVER filled into .items file on my own:

    {"link":"https://myopenhab.org/rest/items/hue_0100_0017882971e8_8_brightness","state":"0","type":"Dimmer","name":"hue_0100_0017882971e8_8_brightness","tags":["Lighting"],"groupNames":[]}

    {"link":"https://myopenhab.org/rest/items/hue_0100_0017882971e8_1_brightness","state":"0","type":"Dimmer","name":"hue_0100_0017882971e8_1_brightness","tags":["Lighting"],"groupNames":[]}

    {"link":"https://myopenhab.org/rest/items/hue_0100_0017882971e8_2_brightness","state":"0","type":"Dimmer","name":"hue_0100_0017882971e8_2_brightness","tags":["Lighting"],"groupNames":[]},

In rest/items, should there be enclosed the brackets […] for tags?

I don’t really know, but I would guess [ "Lighting" ] needs t o be a Color item.

But I am no expert, either. :neutral_face:

Hi,

Anyone got this working with a Harmony hub? I want to mute my TV so I created the item:
Switch Fernseher “Fernseher” [“Lighting”] { harmonyhub=">[press:Samsung Verstaerker:Mute]" }

I also tried to to switch “Samsung Verstaerker” with “harmonyhub:device:HarmonyHub:45963471:buttonPress”

It is showing in the Alexa app and it is recognized by alexa too but it is doing nothing. :frowning:

What am I doing wrong?

Edit: I tried a wake on lan command and that is working so I think the commands in the brackets {} are wrong

Thanks for everys useful awnser
Robin

According to the docs it can be:

Those items are looking like autodiscovered item from your hue bridge. But then they should not have a tag …
Do you have “Simple Mode” switched to ON? (PaperUI -> Configuration -> System -> Item linking).
If you are defining your items via text files you should switch that to OFF, otherwise you get a big mess (all items which are defined through text files are added twice …)

Yes.
Take a look at the docs.
http://docs.openhab.org/addons/bindings/harmonyhub/readme.html

First you need to define a string item:
String HarmonyWZPhilips "Philips-TV" <television> (gRestore) [ "Lighting" ] { channel="harmonyhub:device:HarmonyWZ:26434461:buttonPress" }

Then put a switch on your sitemap:
Switch item=HarmonyWZPhilips mappings=["Mute"="Ton ein/aus"]

Take a look in your harmony remote desktop software which command is used for your TV to mute it.

Thanks for your answer. I tried that now, Sidemap is getting “all” informations from the String, but the Hub is not reacting/sending a signal. Checked the harmonyhub:device… on PaperUI - same as in the *.items file. Checked documentation if anything is wrong. Tried differend button presses. Also if I change the “Switch” to a “String”, the device is removed in the Alexa App. Any (other) idea? It’s really hard for Beginners like me to get anything working in openHAB. :confused:

String HarmonyVerstaerker "Verstaerker Mute Button" (gMain) ["Lighting"] { channel="harmonyhub:device:HarmonyHub:45963470:buttonPress" }
sitemap home label="Home Automation" {
    Frame label="Verstaerker" {
        Switch item=HarmonyVerstaerker mappings=["Mute"="Ton ein/aus"]
    }
}

Is the thing HarmonyVerstaerker online in PaperUI?

You need to check your software which string is used for muting:

After every change you need to search for the devices again.

That is because your are trying to make the complicate stuff (Harmony hub, Alexa) working :grinning:

yeah, all my devices are online in PaperUI. If I create a Item thought PaperUI it pops up under “Control” and is working fine.

I tried the commands “Mute” “PowerToggle” “VolumeUp” and “VolumeDown”. I got no remote control, I’m using the Harmony App to control my devices and I think that are the commands. The commands are also shown in “Control” if I create the Items with PaperUI. (If I create them in there I can’t create labels so thats not working with alexa I think).

Yeah I hit the search button serveral times. String - Device gone, Switch - it’s back. It’s also removed if I change the “Lighting” to “Switchable”

Weird.

My last ideas:

Try [ "Lighting" ] instead of ["Lighting"], I don’t know if it makes a difference, I never tried it without the spaces.

Try sending Mute instead of "Mute"

Try the switch on the sitemap, if the TV does not mute your problem is within the harmony stuff, not with Alexa.

Thanks again, but both makes no difference here. I’ve restarted my raspberrypi with openhab and now the sitemap/switch is working. Now simply the Skill has to recognize my string. :slight_smile:

Also tried “Switchable” after the restart. No change. Ugly Alexa Skill.

Make sure you have

yeah, my Computer runs with Wake on Lan Addon already with Alexa thought OpenHAB. Or is there another setting for doing other things I don’t know?

I have same issue - turn on hue emulation it’s not native but Alexa finds your items

1 Like

@Spider Not sure if Alexa is working directly with String-Items! I have done it with a additional rule:

Items:

String HarmonyActivity “Activity”
Switch TV_Alexa “Fernseher” [“Switchable”]

Sitemap:

Selection item=HarmonyActivity mappings=[PowerOff=“Alles Aus”, Fernsehen=“Fernsehen”, Netflix=“Netflix”, PS3=“Playstation”, Chromecast=“Chromecast”]

Rule:

rule "TV Alexa"
	when
		Item TV_Alexa received command
	then
	    switch (receivedCommand) 
		{ 
			case ON:	{
			sendCommand(HarmonyActivity, "Fernsehen")					
			}
			case OFF:	{
			sendCommand(HarmonyActivity, "PowerOff")
			}
		}
	end

Thanks michaeljoos,

I got it to control my devices directly :slight_smile:

First two items:
Switch HarmonyVerstaerkerEin2 “Soundbar Einschalten” [“Switchable”]
String HarmonyVerstaerkerEin “Einschalten” { channel=“harmonyhub:device:HarmonyHub:45963470:buttonPress” }

then one rule created in PaperUI:
“an item receives a command: HarmonyVerstaerkerEin2” with no Command
"Send a command: HarmonyVerstaerkerEin" wit hcommand “PowerToggle”

Thanks again!

Is it possible to read rules created with PaperUI so I can copy and paste the script into a *.rules?