MACROS

Forum to ask for any help
Post Reply
ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

MACROS

Post by ChrisB75 » Sat Mar 23, 2013 12:11 pm

Sorry everybody its me again!? I'm having trouble with macros this time. I followed a posted example to create macros in order to run 2 buttons - one to watch TV and one to watch a FILM (Blue Ray). They both use a macro I have called 'Power macro' that has values of 1 to 8 (7 and 8 will be assigned to Blue Ray that I am adding later). I have a status subpage that has LEDs showing what state the equipment is in based on flags I have called 'Amp power on', 'Amp power off'', 'Sky power on', 'Sky power off', 'TV power on' and 'TV power off'. The images for these LEDs are shown dependent on whether these flags are on or off (I couldn't just use one flag as the images can't be shown dependent on a flag being off). I have app start up commands setting group flags to off except the 'Power off' flags (Amp power off, sky power off and TV power off) which are set to on, otherwise the red LEDs showing power off would not be lit.
The idea is that when either watch TV or watch Film buttons are pressed for the first time, the appropriate pieces of equipment will be turned on or off depending on their state and when 'Watch TV' button is pressed again, it will turn these pieces of equipment off.
When the 'watch TV' button is pressed, I assign numbers to 'Power macro' as follows;

Delay Target Command Dependant on
0.0 Power macro 1 Amp power on = on
0.0 Power macro 2 Amp power on = off
0.0 Power macro 3 Sky power on = on
0.0 Power macro 4 Sky power on = off
0.0 Power macro 5 TV power on = on
0.0 Power macro 6 TV power on = off

The idea is that commands will be sent and flags set depending on whether each piece of equipment is on or off. I have individual power buttons on subpages for Amp, TV and Sky and they use these macros - this part works fine and the appropriate LEDS are shown on the Status page showing whether each piece of equipment is on or off and they physically turn on or off through the commands sent to the iTach WIFI2IR.

I then have the number custom actions for Power macro as follow;

Name Condition Actions
1 1 3 actions
2 2 3 actions
3 3 3 actions
4 4 3 actions
5 5 3 actions
6 6 3 actions
7 7 (Not yet assigned - will be for Blue Ray)
8 8 (Not yet assigned - will be for Blue Ray)

Action list
The dependancies were created when pressing the 'Watch TV' button so it seemed pointless to repeat them in the custom actions for the 'Power macro'.

Power macro = 2 (turns Amp on if it is off)
0.0 iTach AMP POWER Nothing
0.0 Amp power on ON Nothing
0.0 Amp power off OFF Nothing

Power macro = 4 (turns Sky on if it is off)
0.0 iTach SKY POWER Nothing
0.0 Sky power on ON Nothing
0.0 Sky power off OFF Nothing

Power macro = 6 (turns TV on if it is off)
0.0 iTach TV POWER Nothing
0.0 TV power on ON Nothing
0.0 TV power off OFF Nothing

Only the first kit in the Power macro list will physically turn on - I have tried changing the order and this always happens.
They all turn on of off as expected when using the individual power buttons on subpages. I just don't get it!?
I've also tried using the appropriate commands for a 'watch TV' button release action but again, only the first piece of kit in order actually turns on.

HELP PLEASE!
I hope i've managed to explain the situation, please ask if I can make it any clearer.
Thanks, Chris

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: MACROS

Post by ChrisB75 » Sat Mar 23, 2013 6:13 pm

In case anyone"s interested I think I've sussed it! Fiddled about with delays more and it now works. I'm guessing it's something to do with the commands being issued super fast but because I'm using a WIFI2IR, suppose there's a delay in signals. Anyway, it works, phew.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: MACROS

Post by DemoPad » Sat Mar 23, 2013 6:27 pm

Yes, although in theory it should work, we'd recommend that if you are sending multiple commands to any device, it is best to have a slight delay in between them (remembering that delay values are not cumulative, so all delays should have a different value).

cv27
Posts: 233
Joined: Sat Nov 24, 2012 10:15 pm
Location: Montréal, QC, Canada

Re: MACROS

Post by cv27 » Sat Mar 23, 2013 7:19 pm

Another thing to consider when sending to a Global Caché device, as was suggested to me by their support, is to vary the packet ID field of the sendir command when sending many commands to the same port in rapid succession. Here's the support note I got:

"It looks like you are using the same ID for the 2nd packet which will effectively wipeout/reuse the first code. This could be problematic if the first code is still being transmitted. I would recommend incrementing the ID each time you send a command."

Post Reply