- Posts: 79
- Thank you received: 1
Help with a Macro
- CurlyOscar
- Topic Author
- Offline
- User
-
Less
More
2 years 3 months ago - 2 years 3 months ago #2333
by CurlyOscar
Help with a Macro was created by CurlyOscar
Just wondered if one of you kind souls could cast your eye over my macro and tell me where I'm going wrong. I have tried loading it at the project level, I have tried it on html files but it just doesn't work. When I look at the logs there is nothing being recorded
macro|AV|{{active_tv_{{clientname}}}}~Remote~INPUT HDMI 2!Control|1~SendIR~4K Diva~INPUTSEL0!activate-source.cabletv-bedroomskyq
Thanks
Full Macro below
Macro|
// Source activation macro for BedroomSkyQ!
// SetActiveSource creates the following server variables!
// activesource_sourceid_<clientname>, activesource_source_<clientname>, activesource_sourcename_<clientname>!
// activesource_image_<clientname>, activesource_macro_<clientname>, activesource_type_<clientname>!
// activeroom_<clientname>!
//!
SetActiveSource|BedroomSkyQ!
//!
SetVariable|{{activeroom_{{clientname}}}}_source~{{activesource_sourcename_{{clientname}}}}!
// Tell the driver what device is active!
AV|{{{{activeroom_{{clientname}}}}_cabletv_id}}~SelectDevice!
//!
// This next section is for systems that utilize audio and video distribution via AV switchers!
// If your system does not use this technology then you can ignore all of the following section!
// The Audio and/or Video switcher inputs this source is on!
// Uncomment and set if needed!
// SetVariable|{{activeroom_{{clientname}}}}_audio_switcher_input~0!
// SetVariable|{{activeroom_{{clientname}}}}_sonos_switcher_input~0!
// SetVariable|{{activeroom_{{clientname}}}}_video_switcher_input~0!
//!
// Now do the switching if necessary!
//!
// If|isGT##{{{{activeroom_{{clientname}}}}_video_switcher_input}}##0##AV|{{{{activeroom_{{clientname}}}}_video_switcher_id}}~Source~{{{{activeroom_{{clientname}}}}_video_switcher_input}}!
// If|isGT##{{{{activeroom_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{activeroom_{{clientname}}}}_audio_switcher_id}}~Source~{{{{activeroom_{{clientname}}}}_audio_switcher_input}}!
// If|IsGT##{{{{activeroom_{{clientname}}}}_sonos_switcher_input}}##0##Sonos|{{{{activeroom_{{clientname}}}}_sonos_switcher_id}}~LineIn~{{{{activeroom_{{clientname}}}}_sonos_switcher_input}}!
//!
// Uncomment if you need to make sure the display is always looking at the correct source!
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
// Always Turn the display on if defined!
If|isGT##{{{{activeroom_{{clientname}}}}_display_id}}##0##AV|{{{{activeroom_{{clientname}}}}_display_id}}~power~on!
//!
// Set display to specific source!
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
//!
// Finally everything is ready. Send the client to the appropriate page!
//!
// LoadScene|cabletv!
// fini
macro|AV|{{active_tv_{{clientname}}}}~Remote~INPUT HDMI 2!Control|1~SendIR~4K Diva~INPUTSEL0!activate-source.cabletv-bedroomskyq
Thanks
Full Macro below
Macro|
// Source activation macro for BedroomSkyQ!
// SetActiveSource creates the following server variables!
// activesource_sourceid_<clientname>, activesource_source_<clientname>, activesource_sourcename_<clientname>!
// activesource_image_<clientname>, activesource_macro_<clientname>, activesource_type_<clientname>!
// activeroom_<clientname>!
//!
SetActiveSource|BedroomSkyQ!
//!
SetVariable|{{activeroom_{{clientname}}}}_source~{{activesource_sourcename_{{clientname}}}}!
// Tell the driver what device is active!
AV|{{{{activeroom_{{clientname}}}}_cabletv_id}}~SelectDevice!
//!
// This next section is for systems that utilize audio and video distribution via AV switchers!
// If your system does not use this technology then you can ignore all of the following section!
// The Audio and/or Video switcher inputs this source is on!
// Uncomment and set if needed!
// SetVariable|{{activeroom_{{clientname}}}}_audio_switcher_input~0!
// SetVariable|{{activeroom_{{clientname}}}}_sonos_switcher_input~0!
// SetVariable|{{activeroom_{{clientname}}}}_video_switcher_input~0!
//!
// Now do the switching if necessary!
//!
// If|isGT##{{{{activeroom_{{clientname}}}}_video_switcher_input}}##0##AV|{{{{activeroom_{{clientname}}}}_video_switcher_id}}~Source~{{{{activeroom_{{clientname}}}}_video_switcher_input}}!
// If|isGT##{{{{activeroom_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{activeroom_{{clientname}}}}_audio_switcher_id}}~Source~{{{{activeroom_{{clientname}}}}_audio_switcher_input}}!
// If|IsGT##{{{{activeroom_{{clientname}}}}_sonos_switcher_input}}##0##Sonos|{{{{activeroom_{{clientname}}}}_sonos_switcher_id}}~LineIn~{{{{activeroom_{{clientname}}}}_sonos_switcher_input}}!
//!
// Uncomment if you need to make sure the display is always looking at the correct source!
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
// Always Turn the display on if defined!
If|isGT##{{{{activeroom_{{clientname}}}}_display_id}}##0##AV|{{{{activeroom_{{clientname}}}}_display_id}}~power~on!
//!
// Set display to specific source!
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
//!
// Finally everything is ready. Send the client to the appropriate page!
//!
// LoadScene|cabletv!
// fini
Last edit: 2 years 3 months ago by CurlyOscar. Reason: Additional details
Please Log in to join the conversation.
- David Li
- Offline
- Admin
-
Less
More
- Posts: 1019
- Thank you received: 99
2 years 3 months ago #2334
by David Li
Replied by David Li on topic Help with a Macro
I haven't looked at the macro deeply.
I would break it apart to do "one thing" and get that working. Then add the next step etc to debug.
I would break it apart to do "one thing" and get that working. Then add the next step etc to debug.
The following user(s) said Thank You: CurlyOscar
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 3 months ago #2336
by bowlingbeeg
Replied by bowlingbeeg on topic Help with a Macro
I would first start by moving the two commands you're running before the activate macro into the activate macro itself. That way all of the logic to activate that source is in one spot. But that does mean you'll have to fixup the macro because by default the activate macro tries to call the "source" function on the device but it appears your device doesn't use the "source" function, it uses "Remote".
You'll also need to change the "HDMI2" in this line to "INPUT HDMI 2":
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
And then this line would need to change "source" to "Remote" in the line below:
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
Then you can add the "Control" macro in there right after that.
I also see that your final "LoadScene" is commented out. So if you call this activate macro the remote won't ever load that html web page. But maybe you're doing that just for testing purposes. Otherwise I don't see anything obviously wrong, although it's hard to tell where some of the lines stop because of the wrapping in the forum. If you want to see what's happening with the commands make sure you turn on "logging" from the main dashboard screen and then click on the "Live Event Log" button at the bottom. That should show you what happens when you run the macro.
You'll also need to change the "HDMI2" in this line to "INPUT HDMI 2":
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
And then this line would need to change "source" to "Remote" in the line below:
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
Then you can add the "Control" macro in there right after that.
I also see that your final "LoadScene" is commented out. So if you call this activate macro the remote won't ever load that html web page. But maybe you're doing that just for testing purposes. Otherwise I don't see anything obviously wrong, although it's hard to tell where some of the lines stop because of the wrapping in the forum. If you want to see what's happening with the commands make sure you turn on "logging" from the main dashboard screen and then click on the "Live Event Log" button at the bottom. That should show you what happens when you run the macro.
Please Log in to join the conversation.
- CurlyOscar
- Topic Author
- Offline
- User
-
Less
More
- Posts: 79
- Thank you received: 1
2 years 3 months ago #2338
by CurlyOscar
Replied by CurlyOscar on topic Help with a Macro
Thanks for the reply. I'm finding it really hard to get my head round macros, variables and how things fit together. I've started small with 5 devices and 4 months after taking delivery I still haven't got it working how I want.
Can I just ask you where in the activate macro would you put the 2 commands?
The device that you noticed uses Remote rather than source is a HDFury VRRoom. I had to set it up using the IR database and then GenericIR. After that there is no specific HDFury driver so I followed the documentation at the bottom of the page
allonis.com/support/documentation?view=category&id=408
Is there a better way to do that?
You were spot on about the Load Scene. I turned it off as it was getting in the way
Thanks again for your help
Neil
Can I just ask you where in the activate macro would you put the 2 commands?
The device that you noticed uses Remote rather than source is a HDFury VRRoom. I had to set it up using the IR database and then GenericIR. After that there is no specific HDFury driver so I followed the documentation at the bottom of the page
allonis.com/support/documentation?view=category&id=408
Is there a better way to do that?
You were spot on about the Load Scene. I turned it off as it was getting in the way
Thanks again for your help
Neil
Please Log in to join the conversation.
- PhoenixF15E
- Away
- User
-
Less
More
- Posts: 91
- Thank you received: 3
2 years 3 months ago - 2 years 3 months ago #2339
by PhoenixF15E
Replied by PhoenixF15E on topic Help with a Macro
I think there's a typo in your set variable statement:
Kyle
- SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
Kyle
Last edit: 2 years 3 months ago by PhoenixF15E.
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 3 months ago #2340
by bowlingbeeg
Replied by bowlingbeeg on topic Help with a Macro
I'm confused by this statement:
"The device that you noticed uses Remote rather than source is a HDFury VRRoom"
but your hand made "macro" lists these three commands
1) AV|{{active_tv_{{clientname}}}}~Remote~INPUT HDMI 2!
2) Control|1~SendIR~4K Diva~INPUTSEL0!
3) activate-source.cabletv-bedroomskyq
I assumed 1 was setting the input on the TV/Projector/Display and 2 was setting the input on the HDFury. Your statement seems to indicate 1 is also an HDFury device? Is that true?
The general way you should look at the activation macro is this. If I were to send all of these commands manually, which order would I do them in. Typically it's power things on, followed by setting the right inputs. The stuff at the top of the macro is all setup stuff that you can just leave alone. The interesting stuff starts with this line that sets a variable to the correct source that you want your TV set to.:
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
Then later you can see if being used in this line to actually set the source:
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
That's the one I said you'll need to change "source" to "Remote" based on my assumption that 1 above is setting the input for the TV/Projector/Display.
Then after you've set the input for the TV you can set the input of the 4k Diva, use the command you had in 2 above. One thing to note is that sometimes you may need to add delays in-between these steps for cases where the TV takes a few seconds after being turned on to actually respond to input changes. Or maybe if you change the input on the 4K diva too soon after the TV changes input it causes the HDMI handshake to fail.
Now all your remote needs to do is issue the command from 3 above and hopefully everything is turned on and set to the right input.
"The device that you noticed uses Remote rather than source is a HDFury VRRoom"
but your hand made "macro" lists these three commands
1) AV|{{active_tv_{{clientname}}}}~Remote~INPUT HDMI 2!
2) Control|1~SendIR~4K Diva~INPUTSEL0!
3) activate-source.cabletv-bedroomskyq
I assumed 1 was setting the input on the TV/Projector/Display and 2 was setting the input on the HDFury. Your statement seems to indicate 1 is also an HDFury device? Is that true?
The general way you should look at the activation macro is this. If I were to send all of these commands manually, which order would I do them in. Typically it's power things on, followed by setting the right inputs. The stuff at the top of the macro is all setup stuff that you can just leave alone. The interesting stuff starts with this line that sets a variable to the correct source that you want your TV set to.:
SetVariable|{{actom_{{clientname}}}}_display_input~HDMI2//!
Then later you can see if being used in this line to actually set the source:
If|isNE##{{{{activeroom_{{clientname}}}}_display_input}}####AV|{{{{activeroom_{{clientname}}}}_display_id}}~source~{{{{activeroom_{{clientname}}}}_display_input}}!
That's the one I said you'll need to change "source" to "Remote" based on my assumption that 1 above is setting the input for the TV/Projector/Display.
Then after you've set the input for the TV you can set the input of the 4k Diva, use the command you had in 2 above. One thing to note is that sometimes you may need to add delays in-between these steps for cases where the TV takes a few seconds after being turned on to actually respond to input changes. Or maybe if you change the input on the 4K diva too soon after the TV changes input it causes the HDMI handshake to fail.
Now all your remote needs to do is issue the command from 3 above and hopefully everything is turned on and set to the right input.
Please Log in to join the conversation.
Time to create page: 0.192 seconds