Rules Machine HTTP GET Questions - Actions/Rules

Set up RM to switch ON/OFF 8 devices that are addressed by the HTTP GET command. Each action is slightly different as the ON/OFF number plus device number differ.

  1. What is the character limit for each action GET HTTP URL? And once the limit is reached is the remaining text truncated?

At this point, using 8 different GET actions (rules) for addressing 8 devices for ON. Plus an additional 8 different GET actions (rules) to turn the 8 devices OFF.

Rules Individual

  1. Is it better to use a separate rule, one for each action? For 8 devices there would be 16 separate actions to run as in the above image.

  2. Or as a second choice, to use one rule with 8 nested GET URL's for ON. With a second rule with 8 nested GET URL's for OFF as in the below image.

  1. Is there a limit to the number of GET URL's per rule?

  2. What is the usual and customary way for best practices?

1 Like

Probably worth showing a more complete screenshot of one of the rules including the trigger.

Depending on how you want to trigger the rules, you may be able to use some form of variables to drive the rules which may allow for a reduction of the number of rules, but the triggers will help work out if this will work....

I don't know if there is a limit for the text in the HTTP Get call..

Max length for a http-get is 2048 (actually browser/server dependent but the LCD is 2048)

2 Likes

The trigger for all of the rules is local sunrise and sunset plus an offset as generated by the Hub. It is working 100% using one rule - one action (HTTP GET call). The goal is to program 8 cameras from day mode to night mode based on local sunrise/sunset and back again. i.e. color to B/W, exposure settings, IR, etc.

The overall question, is it better to use one rule, one trigger and one action or one rule, one trigger many actions (HTTP GET call). The NVR (network video recorder) has 16 inputs. Using the one rule, one action scenario would result in 16 rules each with one action. The one rule many actions would result in two rules each with 8 actions one for each input. One rule for sunup and one rule for sundown.

Thank you.

That is good news as it may be necessary to add a few more camera functions to the GET call. Do not anticipate the need for much beyond 512. Good to know there is sufficient space for my needs.

Thank you.

I'm wondering whether you could have the two rules, one for sunrise and one for sunset, and use a repeat and a variable to loop through the cameras, referencing the variable in the http call.

Here is an example of one HTTP call for color to B/W and one for B/W to Color for camera 1 - logic 0. This is repeated 8 times, one set of 8 for sunset and another set of 8 for sunrise based on an 8 camera system. Or for 16 cameras 16 of each. i.e. 32 rules.

For Color to B/W the only change is the camera number. i.e. Video In Options (camera number) can range from 0 to 7 or for all 16 cameras 0 - 15. The 3 and 2 are camera functions and will not change for day mode.

For night mode, the same camera sequence 0 - 7 or 0 - 15 is used but the camera functions change to 0 and 0.

1-Color to B/W - Mailbox 1 (Logic 0)

http://user:password@192.168.1.108:80/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3& VideoInOptions[0].NightOptions.DayNightColor=2

1-B/W to Color - Mailbox 1 (Logic 0)

http://user:password@192.168.1.108:80/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0& VideoInOptions[0].NightOptions.DayNightColor=0

Thank you.