I use remote budy for controling OH with my Harmony hub. The magic thing si it configure your remote as an ps3 remote on Harmony so it’s in bluetooth and toi CAN control it from almost any room or your house
Of course I know Remote Buddy, I own it since almost 7 years ago and I’m very happy with it. Since then I run Kodi (formerly XBMC) with my Macmini and used RB with the Apple Remote without any other input device, I mean, I have setup RB in a way that let me use the full computer (mouse, keyboard, etc) just with this remote.
Now I have added the Harmony Hub and I only have this remote to control the TV, Macmini and Music stereo… that’s why I would like it to control my “home automation devices” too, hehehe.
@Dominic_Bonneau, I already have the remote as an PS3 remote but I can’t use the “home automation buttons” with this “activity” so that’s why I would like to enable them somehow (here is the thread) where @sam is also helping me out.
Thank you both
Using the same method as the Flirc you can also create your own behaviours and actions, then setup custom menus in Remote Buddy. Because there will never be too many ways to turn lights on and off
It’s exacly what I did !
great minds and all that
Hi,
Must the String in the First line in the Rule too?
Is my First Time with OH.
My Rule is looking so:
String Harmony_Current_Activity “Activity” (gAll, gRestoreStartup) { harmonyhub="*[currentActivity]" }
rule “Gute_Nacht_TV_AUS”
when
Item Harmony_Current_Activity changed
then
var String HarmonyState = Harmony_Current_Activity.state.toString()
if (HarmonyState == “Amazon” && nacht.state==ON)
{
sendCommand(homematic_HM_LC_Sw1_FM_8677c139_MEQ0361878_1_STATE, ON)
}
end
Is it possible to Check the Rule in the Internet? Thanks
This is an Item definition and needs to be in a .items file in the items folder.
Hi,
Thanks die the quick Answer. But wy do don’t take the item the Harmony Binding? And can i Check the ruels somewhere in the Internet, like a Compiler?
Is the Rest from the Rule than ok? I am testing the rule dir a few days.
Thanks for help
Lars
I don’t understand the question. The way OH works is you have a Binding that knows how to talk to a device or technology, in this case Harmony.
You must create Items to represent these devices inside of OH. Items are defined in .items files in the items folder of your configurations folder.
Rules run when certain events occur, in this case when the Harmony_Current_Activity changes its state. Rules are defined in .rules files in the rules folder of your configurations folder.
No. The best you can do is to use Designer which will syntax check the rules as you type. But for logic errors the only way to check them is to run them and use logging statements to discover and solve the problem.
I assume you are asking whether you can make an HTTP REST call from a rule. Yes with the one limitation that currently the HTTP actions do not currently support making HTTP calls with a body.
Please see :
Hi,
Thanks gor all. I will Look tommorrow.
Herr is My Script without a extra Item
rule “Gute_Nacht_TV_AUS”
when
Item harmonyhub_hub_Wohnzimmer_currentActivity changed
then
var String HarmonyState = harmonyhub_hub_Wohnzimmer_currentActivity.state.toString()
if (HarmonyState == “Fernseher” && nacht.state==ON)
{
sendCommand(homematic_HM_LC_Sw1_FM_8677c139_MEQ0361878_1_STATE, ON)
}
end
Thanks gor help!!
Hi,
the first Thing will work! Thanks
No I want to mute my Harmony with a Item.
So I made a Item with this;
String HarmonyHubMute “mute” { harmonyhub=">[press:Samsung-Verstarker:MUTE]" }
But when I Put mute in the Body from the Rest API than the Item will change bute no mute
When i use the Item “harmonyhub_device_Wohnzimmer_25713496_buttonPress” with the Body mute it will work.
I want to use the Desiger but it dosen´t work to, I use the Openhab2 on a PI. When i chose the Folder it doesen´t work.
I think the Problem is the missing config Folder in Verison 2.
Thanks
Hi,
i have a Problem with a PowerOff rule.
rule "PowerOff_Amazon"
when
Item Harmony_Hub.state.toString() changed from "Amazon" to "PowerOff")
then
{
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=64056&new_value=1")
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=63013&new_value=aus")
}
end
My first try doesn´t Work too…
rule "PowerOff_Amazon"
when
Item Harmony_Hub changed
then
var String HarmonyState = Harmony_Hub.state.toString()
if (HarmonyState changed from "Amazon" to "PowerOff"))
{
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=64056&new_value=1")
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=63013&new_value=aus")
}
end
Thanks for Help…
Lars
The trigger on your first try is correct. The second one is incorrect.
The the first try’s mistake is the if statement. Assuming you have persistence configured on the item you need to do something like the following
if(Harmony state != Harmony_Hub.previousState.state)
I just tried in the above from memory so I might have it a little wrong.
I highly recommend using Designer and <ctrl><space>
to help check and discover correct rule syntax as you type.
Hi,
Thanks for help. But both of my Rules doesn’t work.
Yes the Syntax but with the Desinger… I don’t Unterstand them. With Working Rules the Desinger habe Problems. Can you give me a Working Rule for my example than i have a example for the Syntax.
I’m using the HUE Emulation to control openHAB from Harmony Hub and Amazon Echo (Alexa)
This might be less flexible but it works fine.
I can use the Smart Home Buttons on the Harmony Remote
and trigger the same items from Alexa.
I can post my configuration if wanted?
Sitemap (part)
Frame label="Hue Emulation Harmony" {
Switch item=huee_audio_radio
Switch item=huee_audio_mp3
//
Switch item=huee_tv_schauen
Switch item=huee_fire_tv_schauen
Switch item=huee_kodi_schauen
Switch item=huee_apple_tv_schauen
Switch item=huee_ps4_tv_schauen
//
Switch item=huee_fire_tv_schauen_beamer
Switch item=huee_kodi_schauen_beamer
Switch item=huee_apple_tv_schauen_beamer
Switch item=huee_ps4_tv_schauen_beamer
Switch item=huee_harmony_aus
}
Items
// Hue Emulation Items
//Switch TestSwitch1 "Kitchen Switch" [ "Switchable" ]
//Switch TestSwitch2 "Bathroom" [ "Lighting" ]
//Dimmer TestDimmer3 "Hallway" [ "Lighting" ]
//Number TestNumber4 "Temperature Set Point" [ "TargetTemperature" ]
// Audio
Switch huee_audio_radio "Radio" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_audio_mp3 "Musik" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
// TV
Switch huee_tv_schauen "Fernseher" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_fire_tv_schauen "Fire TV" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_kodi_schauen "Kino" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_apple_tv_schauen "Apple TV" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_ps4_tv_schauen "Playstation" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
// Beamer
Switch huee_fire_tv_schauen_beamer "FireTV auf dem Beamer" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_kodi_schauen_beamer "grosses Kino" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_apple_tv_schauen_beamer "Apple TV auf dem Beamer" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
Switch huee_ps4_tv_schauen_beamer "Playstation auf dem Beamer" (gEG_WHU_HUEE_Harmony) [ "Switchable" ]
// Aus
Switch huee_harmony_aus "Wohnzimmer" (gEG_WHU_HUEE_Harmony_inv) [ "Switchable" ]
Rules zur Harmony (no init yet, first attempts may fail after restarting openHAB)
import java.util.concurrent.locks.Lock
import java.util.concurrent.locks.ReentrantLock
var Lock lock = new ReentrantLock()
rule "HUEE_WHZ_Harmony_Scene"
when
Item gEG_WHU_HUEE_Harmony changed
then
lock.lock()
try {
Thread::sleep(250) // needed ? give persistence time to populate lastUpdate
gEG_WHU_HUEE_Harmony.members.forEach[ currItem |
val itemName = currItem.name
val scene = currItem.label.toString()
//pushNotification("WHZ HUEE Harmony Trigger"," nameOfItem <"+itemName+"> scene<"+scene+">")
logInfo("WHZ HUEE Harmony Trigger"," nameOfItem <"+itemName+"> scene<"+scene+"> state<"+currItem.state.toString()+">")
if (currItem.state == ON)
{
if("huee_audio_radio".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Radio")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "Radio")
} else if ("huee_audio_mp3".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Kodi - Audio")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "Kodi - Audio")
} else if ("huee_tv_schauen".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Fernsehen")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "Fernsehen")
} else if ("huee_fire_tv_schauen".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Fire TV - TV")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "Fire TV - TV")
} else if ("huee_kodi_schauen".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Kodi - TV")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "Kodi - TV")
}
}
]
} catch (Exception e) {
logInfo("HUEE_WHZ_Harmony_Scene", "exception: " + e)
} finally {
lock.unlock()
}
end
rule "HUEE_WHZ_Harmony_Scene_inv"
when
Item gEG_WHU_HUEE_Harmony_inv changed
then
lock.lock()
try {
Thread::sleep(250) // give persistence time to populate lastUpdate
gEG_WHU_HUEE_Harmony_inv.members.forEach[ currItem |
val itemName = currItem.name
val scene = currItem.label.toString()
//pushNotification("WHZ HUEE Harmony Trigger"," nameOfItem <"+itemName+"> scene<"+scene+">")
logInfo("WHZ HUEE Harmony Trigger INV"," nameOfItem <"+itemName+"> scene<"+scene+"> state<"+currItem.state.toString()+">")
if (currItem.state == OFF)
{
if ("huee_harmony_aus".equals(itemName)) {
logInfo("HarmonyHubWohnzimmer_CurrentActivity", "Kodi - TV")
sendCommand("HarmonyHubWohnzimmer_CurrentActivity", "PowerOff")
}
}
]
} catch (Exception e) {
logInfo("HUEE_WHZ_Harmony_Scene_inv", "exception: " + e)
} finally {
lock.unlock()
}
end
rule "HUEE_WHZ_Harmony_Activity"
when
Item HarmonyHubWohnzimmer_CurrentActivity received command
then
logInfo("WHZ HUEE HUEE_WHZ_Harmony_Activity Trigger"," CurrentActivity <"+HarmonyHubWohnzimmer_CurrentActivity.state.toString()+">")
if ("PowerOff".equals(HarmonyHubWohnzimmer_CurrentActivity.state.toString())) {
// reset activity buttons so they can be turned on
sendCommand(gEG_WHU_HUEE_Harmony,OFF)
sendCommand(gEG_WHU_HUEE_Harmony_inv, OFF)
} else {
sendCommand(gEG_WHU_HUEE_Harmony,OFF)
sendCommand(gEG_WHU_HUEE_Harmony_inv,ON)
}
end
Typing from my phone so the following probably has errors.
In order to test what the Item state changed from you must have persistence set up using something other than MapDB.
rule "PowerOff_Amazon"
when
Item Harmony_Hub changed
then
if(Harmony_Hub.state =="Power off" && Harmony_Hub.previousValue(true).State == "Amazon"){
// Do stuff
}
End
Hi,
thanks for Help!! Here ist the Rule that works:
rule "PowerOff"
when
Item Harmony_Hub changed
then
if (Harmony_Hub.state == "PowerOff" && previousState == "Fernseher")
{
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=64056&new_value=1")
sendHttpGetRequest("http://192.168.188.30/web/powerstate?newstate=0")
sendHttpGetRequest("http://192.168.188.74/config/xmlapi/statechange.cgi?ise_id=63013&new_value=aus")
}
end
My hope is still to get the neeo remote from kickstarter. there is also a REST-API available
I orderd one remote one and a half year ago …
But it seams the delivery-date is very close. to who it may interesting take a look at www.neeo.com and read there blog