I hope to get the length of a $tring

Use case...

Hub A rule loads a virtual omnisensor variable as a string.
Hub A rule sets CO active to trigger a rule on Hub B.
Hub A rule sets CO inactive.
Hub B rule does chromecast to mini.
If i could get the length of the string,
Hub A could approximate how long to pause to allow the announcement to complete, prior to moving on to the next task.

Broader view...
Any Hub reboots, they all report in, "normal" and set their system to the default settings for environmental consistency.

All thoughts are appreciated.

If you are not opposed to writing your rule in Webcore, it is easy to get the length of a string.

Put it in Webcore on Hub A, and after the wait, set CO active in Webcore to trigger the rule on Hub B, even if it is using Rule Machine.

I don't use Rule Machine, there may be a way to get the length of a string, but Webcore is generally easier for that type of thing, and doing any calculations.

1 Like

Thank you for the pointer, seems to work well!
How do i run the piston from RM?
Or how to trigger from within the piston.
I had setup a condition, when a global variable changed, logs kept showing an error.

I got it to work!
It has been a long time since i used WC.

1 Like

I thought i had it nailed.
The piston does not set the global var @@GHM.Delay.
What am i missing?

Thank you for the push in the right direction.


Worked!
And the fun part is that I am thinking what i can move over to WC.
In the middle of a set of hubs reporting, if another rule announces, it is handled and there is no lost communication.
Using the length of string to approximate how long it takes to form the chromecast and output it before giving up control of the cast device is working so much better than fixed waits.

Length of string operation to be added to Rule Machine, in next release. Example:

4 Likes

Very nice, thank you.