Openhab2 with HarmonyHub + Alexa + Ceiling Fan (Westinghouse)

Hey Guys…

Since i’ve been using OH for quite a time and it becomes now my live system… i wanted to give something back… even its a small part… but this was annoying me alot…and i didnt find something here…

I hope this article is posted in the right category

My Setup:

openHabian + HarmonyHub + Amazon Echo + Westinghouse IR Remote 78095

Since Alexa cant handle String items… i’ve created a Dummy Item… and have written a rule…

So now i can either use the App/Sitemap Control Buttons OR Voice commands with Alexa…

.items File

String LR_VENT_LAMP “Ventilator” <fan_ceiling> { channel=“harmonyhub:device:HoLLe:46218003:buttonPress” }
Dimmer LR_VENT_LAMP_ALEXA “Ventilator” [ “Switchable” ] //Dummy for Alexa

.sitemap File

Switch item=LR_VENT_LAMP mappings=[PowerOff=“Aus”, FanLow=“Low”, FanMed=“Med”, FanHigh=“High”]

.rules File

// Westinghouse IR Remote over HarmonyHub
rule "Ventilator Alexa"
	when
		Item LR_VENT_LAMP_ALEXA received command
	then
	    switch (receivedCommand) 
		{ 
			case ON:	sendCommand(LR_VENT_LAMP, "FanHigh")
			case 1:		sendCommand(LR_VENT_LAMP, "FanLow")
			case 2:		sendCommand(LR_VENT_LAMP, "FanMed")
			case OFF:	sendCommand(LR_VENT_LAMP, "PowerOff")
			// to make sure no error will be thrown with numbers greater then 3
			default : 	sendCommand(LR_VENT_LAMP, "FanHigh")
		}
end

The trick was to use a DIMMER item for that…

So Alexa command will be like

“Alexa, turn vent on” (set to highest fan speed)
“Alexa, turn vent off”
“Alexa, set vent to 1” (or 2)

Hope this helps someone…

cheers…

and thanks for openHab :slight_smile:

3 Likes