Blackeye
(Lars Weitzenkamp )
December 8, 2016, 12:25pm
21
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
rlkoshak
(Rich Koshak)
December 8, 2016, 4:25pm
22
For OH 2 you must use ESH Designer .
Blackeye
(Lars Weitzenkamp )
January 13, 2017, 1:52pm
23
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
rlkoshak
(Rich Koshak)
January 14, 2017, 3:40pm
24
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.
Blackeye
(Lars Weitzenkamp )
January 16, 2017, 9:52am
25
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.
ChrisW
(Christian W)
January 16, 2017, 12:52pm
26
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?
ChrisW
(Christian W)
January 16, 2017, 1:35pm
27
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
1 Like
rlkoshak
(Rich Koshak)
January 16, 2017, 3:30pm
28
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
Blackeye
(Lars Weitzenkamp )
January 17, 2017, 7:20pm
29
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
2 Likes
aco
(Andreas)
February 3, 2017, 10:20pm
30
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