I am new so please do not assume anything, it is extremely possible that I am the issue here.
I am sending a button presses to my Nvidia Shield TV using the Harmony binding.
I can successfully send button presses for individual single actions but currently struggling for the correct outcome when there is a sequence of key presses.
Below is I believe all the relevant OH2 config AND the log output that shows the
event sequence. I am trying to press the home key followed by down arrow, and then select. Instead what I see is the home screen appears fine, pressing then I see down followed by a return (back up), then right with a return (goes left) and then it selects; which is of course the incorrect item as it has not really gone anywhere.
I am thinking the UNDEF log entries correspond to the return but not sure how to stop it from happening.
item:
// Nvidia Shield
String HarmonyLivingRoomNvidia "Shield" (gMain) { channel="harmonyhub:device:LivingRoom:44390365:buttonPress" }
rules:
rule "scene-watch"
when
//Item sleep_state changed to ON
Item SCN_Watch received command
then
if (receivedCommand == 0) {
logInfo("scene.rules", "Scene Watch Initialsed")
}
if (receivedCommand == 1) {
// Kodi
logInfo("scene.rules", "Scene Watch KODI Start")
HarmonyLivingRoomNvidia.sendCommand("Home")
logInfo("scene.rules", "Pressed Home")
logInfo("scene.rules", "Pressed Down")
Thread::sleep(1000)
logInfo("scene.rules", "Pressed sleep")
HarmonyLivingRoomNvidia.sendCommand("DirectionRight")
logInfo("scene.rules", "Pressed Right")
logInfo("scene.rules", "Scene Watch KODI End")
}
end
sitemap:
Frame label="Scenes" {
Switch item=Lights mappings=[OFF="All Off"]
Switch item=sleep_state label="Sleep Mode" mappings=[OFF="Bedtime", ON="Wake Up"]
Switch item=SCN_Watch label="Watch" icon="television" mappings=[1="Kodi", 2="Plex", 3="Netflix"]
}
Log Output:
16:23:11.222 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘SCN_Watch’ received command 1
16:23:12.205 [INFO ] [e.smarthome.model.script.scene.rules] - Scene Watch KODI Start
16:23:12.210 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘HarmonyLivingRoomNvidia’ received command Home
16:23:12.211 [INFO ] [e.smarthome.model.script.scene.rules] - Pressed Home
16:23:12.213 [INFO ] [e.smarthome.model.script.scene.rules] - Pressed Down
16:23:12.452 [INFO ] [marthome.event.ItemStateChangedEvent] - HarmonyLivingRoomNvidia changed from UNDEF to Home
16:23:12.454 [INFO ] [marthome.event.ItemStateChangedEvent] - HarmonyLivingRoomNvidia changed from Home to UNDEF
16:23:13.220 [INFO ] [e.smarthome.model.script.scene.rules] - Pressed sleep
16:23:13.230 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘HarmonyLivingRoomNvidia’ received command DirectionRight
16:23:13.241 [INFO ] [e.smarthome.model.script.scene.rules] - Pressed Right
16:23:13.245 [INFO ] [e.smarthome.model.script.scene.rules] - Scene Watch KODI End
16:23:13.578 [INFO ] [marthome.event.ItemStateChangedEvent] - HarmonyLivingRoomNvidia changed from UNDEF to DirectionRight
16:23:13.667 [INFO ] [marthome.event.ItemStateChangedEvent] - HarmonyLivingRoomNvidia changed from DirectionRight to UNDEF
16:23:15.291 [INFO ] [marthome.event.ItemStateChangedEvent] - NetworkDevice1921680252_Online changed from OFF to ON