Hi @reneboer
Sorry if this has been asked before, I did search but didn’t find exactly what I am looking for.
I want to send a HTTP command to my FireTV stick to bring up a security cam in picture-in-picture, but only send that HTTP command in my Vera scene if the Harmony activity for the FireTV is the current activity ?
My coding isn’t the best, the plug-in help document states you can use this to get the current activity ID.
rc, rs, jb, rarg = luup.call_action("urn:rboer-com:serviceId:Harmony1",
"GetCurrentActivityID",{},184)
if (rc==0) then curActID = rarg.currentActivityID end
The ID of my Harmony hub in my lounge is Vera device ID 184.
I know the activity ID for the FireTV activity its ID number: 42772934
And this is the HTTP command I want to send in my scene, but only when the FireTV activity is the current one.
luup.inet.wget(“http://192.168.0.135:8765/?frontgarden=pip”)
Does anyone know how to code this together ?
Many thanks.
EDIT:
I thought this might work but it does not, no errors either.
local rc = luup.variable_get("urn:rboer-com:serviceId:Harmony1", "CurrentActivityID", 184)
if (rc==42772934)
then
luup.inet.wget("http://192.168.0.135:8765/?frontgarden=pip")
end
This doesn’t work either
local rc = luup.call_action("urn:rboer-com:serviceId:Harmony1","GetCurrentActivityID",184)
if (rc==42772934)
then
luup.inet.wget("http://192.168.0.135:8765/?frontgarden=pip")
end
EDIT 2:
OK this code works and only sends the PIP command to the FireTV stick if the Harmony FireTV is currently active.
if( luup.variable_get("urn:rboer-com:serviceId:Harmony1","CurrentActivityID",184)=="42772934" ) then
luup.inet.wget("http://192.168.0.135:8765/?frontgarden=pip")
else
end