
Thanks for the tip!
Moderator: leecollings
Thanks for the reply...apologies if I'm being a bit stupid but I can't see a mention of this script in the wiki...http://www.domoticz.com/wiki/Harmony_Hub_Controlmbliek wrote:
Domoticz should update the switch when using the remote. Take a look at the wiki page again.
There is a script that checked every 10 min for an active activity.
Oops, sorry.gb160 wrote: Thanks for the reply...apologies if I'm being a bit stupid but I can't see a mention of this script in the wiki...http://www.domoticz.com/wiki/Harmony_Hub_Control
Am I looking in the right place mate?
Would it be possible to increase the frequency of the script? Or is it 10 minutes for a reason?
Thanks...it's appreciatedmbliek wrote:Oops, sorry.gb160 wrote: Thanks for the reply...apologies if I'm being a bit stupid but I can't see a mention of this script in the wiki...http://www.domoticz.com/wiki/Harmony_Hub_Control
Am I looking in the right place mate?
Would it be possible to increase the frequency of the script? Or is it 10 minutes for a reason?
I'm using that script on my installation.
Didn't wrote it in the wiki.
When I get back home I will post it.
You should be able to do it more that once per 10 min.
But it will be an load for the pi.
Code: Select all
crontab -e
Code: Select all
#!/bin/bash
DOMO_IP="*******" # Domoticz IP Address
DOMO_PORT="*******" # Domoticz Port
activity=`/home/pi/HarmonyHubControl/HarmonyHubControl email password harmony_IP get_current_activity_id | awk -F: '{print $2}' | awk '{print $1}' | awk "NR==4{print;exit}"`
if [ "$activity" = "5766677" ] ; then #TV
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=453" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "TV al ingeschakeld"
else
echo "TV ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=453&switchcmd=On"
fi
elif [ "$activity" = "5766811" ] ; then #Apple TV
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=452" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Apple TV al ingeschakeld"
else
echo "Apple TV ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=452&switchcmd=On"
fi
elif [ "$activity" = "5766789" ] ; then #Bioscoop
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=454" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Bioscoop al ingeschakeld"
else
echo "Bioscoop ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=454&switchcmd=On"
fi
elif [ "$activity" = "7695331" ] ; then #Muziek
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=455" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Muziek al ingeschakeld"
else
echo "Muziek ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=455&switchcmd=On"
fi
elif [ "$activity" = "5766679" ] ; then #CDs
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=456" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "CDs al ingeschakeld"
else
echo "CDs ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=456&switchcmd=On"
fi
elif [ "$activity" = "5766675" ] ; then #BR
ccurl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=457" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "BluRay al ingeschakeld"
else
echo "BluRay ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=457&switchcmd=On"
fi
elif [ "$activity" = "5766732" ] ; then #WDTV
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=458" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "WDTV al ingeschakeld"
else
echo "WDTV ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=458&switchcmd=On"
fi
elif [ "$activity" = "5766676" ] ; then #Radio
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=459" | grep "Status" | grep "On" > /dev/null
if [ $? -eq 0 ] ; then
echo "Radio al ingeschakeld"
else
echo "Radio ingeschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=459&switchcmd=On"
fi
elif [ "$activity" = "-1" ] ; then #Uit
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=474" | grep "Status" | grep "Off" > /dev/null
if [ $? -eq 0 ] ; then
echo "AV al uitgeschakeld"
else
echo "AV uiteschakeld"
# Send data
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=switchlight&idx=474&switchcmd=Off"
fi
fi
Finally got the chance to try this and it works well, thanks for the script......I've managed to increase the frequency to once per minute, with only a slight increase to the load on my pi.mbliek wrote:Also the idx of the switches and add or remove some switches. Depending on how many activists you have.
Code: Select all
./HarmonyHubControl email password hub ipaddress password list_devices
Code: Select all
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Devices Controllable via Harmony :
20686775 - Device 1
20779809 - Device 2
20686760 - Device 3
20671327 - Device 4
21160666 - Device 5
20674970 - Device 6
20671404 - Device 7
20672634 - Marantz AV Receiver
Code: Select all
./HarmonyHubControl email password hub ipaddress password get_config
Code: Select all
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Logitech Harmony Configuration :
"activity":[{"suggestedDisplay":"Default","label":"Raise Screen","id":"13178772","activityTypeDisplayName":"Default","controlGroup":[{"name":"TransportBasic","function":[{"action":"{\"command\":\"Stop\",\"type\":\"IRCommand\",\"deviceId\":\"20674970\"}","name":
"Stop","label":"Stop"}]}],"sequences":[],"activityOrder":4,"isTuningDefault":false,"fixit":{"20686775":{"id":"20686775","isRelativeInput":true,"Power":"Off"},"20779809":{"id":"20779809","isRelativePower":true,"Power":"Off"},"25078187":{"id":"25078187","isRelati
vePower":true,"Power":"Off"},"20686760":{"id":"20686760","Power":"Off"},"20671327":{"id":"20671327","Power":"Off"},"21160666":{"id":"21160666","isRelativePower":true,"Power":"Off"},"20672634":{"id":"20672634","Power":"Off"},"20671404":{"id":"20671404","Power":"
Off"},"20674970":{"id":"20674970","isManualPower":true}},"type":"VirtualGeneric","icon":"userdata: 0x4454c8","baseImageUri":"https:\/\/rcbu-test-ssl-amr.s3.amazonaws.com\/"},{"suggestedDisplay":"Default","label":"Lower screen","id":"13178753","activityTypeDispl
ayName":"Default","controlGroup":[{"name":"TransportBasic","function":[{"action":"{\"command\":\"Stop\",\"type\":\"IRCommand\",\"deviceId\":\"20674970\"}","name":"Stop","label":"Stop"}]}],"sequences":[],"activityOrder":3,"isTuningDefault":false,"fixit":{"206867
75":{"id":"20686775","isRelativeInput":true,"Power":"Off"},"20779809":{"id":"20779809","isRelativePower":true,"Power":"Off"},"25078187":{"id":"25078187","isRelativePower":true,"Power":"Off"},"20686760":{"id":"20686760","Power":"Off"},"20671327":{"id":"20671327"
,"Power":"Off"},"21160666":{"id":"21160666","isRelativePower":true,"Power":"Off"},"20672634":{"id":"20672634","Power":"Off"},"20671404":{"id":"20671404","Power":"Off"},"20674970":{"id":"20674970","isManualPower":true}},"type":"VirtualGeneric","icon":"userdata:
0x4454c8","baseImageUri":"https:\/\/rcbu-test-ssl-amr.s3.amazonaws.com\/"},{"suggestedDisplay":"ListenToSonos","label":"Sonos","id":"12823332","activit
Code: Select all
{"name":"Volume","function":[{"action":"{\"command\":\"Mute\",\"type\":\"IRCommand\",\"deviceId\":\"20672634\"}","name":"Mute","label":"Mute"},{"action":"{\"command\":\"VolumeDown\",\"type\":\"IRCommand\",\"deviceId\":\"20672634\"}","name":"VolumeDown","label":"Volume Down"},{"action":"{\"command\":\"VolumeUp\",\"type\":\"IRCommand\",
\"deviceId\":\"20672634\"}","name":"VolumeUp","label":"Volume Up"}]},
Thank you for your reply. I think I can do what I'd like with this setup.gdisselkoen wrote:Not sure what you want to do.
On the Harmony Touch you can create activities that turns on all devices needed to "watch Sky TV" (e.g. television, sat receiver, AV receiver).
On the Harmony Hub you can create also activities. If you connect your Harmony Touch with the Harmony Hub, all activities from The Touch are also available on the Hub and you can add 15 devices instead of 8. You can add also home devices to the Hub\Touch.
When you add a Harmony Hub to Domoticz, all configured activities are created in Domoticz.
With blockly or scripts you can create actions based on the status of an activity.
In my case, I have created an blockly script that dims several lamps when the activity "Watch TV" or my Home Theater PC is turned on. And when the activity is stopped, the lights will go back to the normal level.
With the HarmonyHubControl script you can add additional options to Domoticz to control your devices, like turning off the sound, switch channels, and so on.
You can also use a scene in Domoticz to turn off all the lights whe you go to bed and also switch off your activity in the Harmony Hub.
BTW The Harmony Hub not only supports IR, it also supports Bluetooth (game consoles) and WiFi. You can the Harmony Hub let do a scan for devices that can be controled by the hub.
Guus Disselkoen
Users browsing this forum: No registered users and 1 guest