Announcement

Collapse
No announcement yet.

Display [$SCRIPT] value in Text element

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Display [$SCRIPT] value in Text element

    Is there a way to "return" a value to a text property based on an If condition? For example, display "Speaking" if the hs.IsSpeakerBusy command returns True? Something like:

    Text: [$SCRIPT=&if hs.IsSpeakerBusy then "Speaking" else "Not Speaking"]

    Also, can an image be displayed based on the same. Display one graphic if hs.IsSpeakerBusy is true, and another if it's false. I know I could create a work-around by setting a HS device value based on a script, but I have several similar things (phone off hook, media playing, audio muted, etc.) and was looking for the best way to implement.

    #2
    This is the kind've thing RegExReplace is for...if you try the following it should work;

    [$REGEXREPLACE=[$SCRIPT=&hs.IsSpeakerBusy()]->False->Not Speaking]
    Or
    [$REGEXREPLACE=[$SCRIPT=&hs.IsSpeakerBusy()]->True->Speaking]

    However the downside is there is a bug in HSTouch that does not allow multiple RegExReplace tags inside a single element, so you can have the value Speaking for True but it would revert to False when it was'nt. I logged this as a bug (ID 22058) on 01/01/11 but have not seen or heard anything since.

    And in relation to the latter then no not at the moment I don't believe, it would have to come from a device value and before that perhaps a script...

    Comment


      #3
      Originally posted by mrhappy View Post
      This is the kind've thing RegExReplace is for...if you try the following it should work;

      [$REGEXREPLACE=[$SCRIPT=&hs.IsSpeakerBusy()]->False->Not Speaking]
      Or
      [$REGEXREPLACE=[$SCRIPT=&hs.IsSpeakerBusy()]->True->Speaking]

      However the downside is there is a bug in HSTouch that does not allow multiple RegExReplace tags inside a single element, so you can have the value Speaking for True but it would revert to False when it was'nt. I logged this as a bug (ID 22058) on 01/01/11 but have not seen or heard anything since.

      And in relation to the latter then no not at the moment I don't believe, it would have to come from a device value and before that perhaps a script...
      Have you logged this in the new bugzilla system?
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        Originally posted by mrhappy View Post
        This is the kind've thing RegExReplace is for...
        Thanks Adam - that's what I was missing; I'll make good use of that!

        Comment


          #5
          I have now added it to BugZilla but the bug was acknowledged by Rich on the day I added it 01/01/11 - so I thought that should really be the end of my involvement as the old ticket was open for about 70 days prior to the BugZilla thing being open...

          Can I ask what is the present situation in relation to bugs? I can't see that any of the bugs on the new system have been updated and the bugzilla has been open the best part of two weeks...

          Comment


            #6
            Originally posted by mrhappy View Post
            I have now added it to BugZilla but the bug was acknowledged by Rich on the day I added it 01/01/11 - so I thought that should really be the end of my involvement as the old ticket was open for about 70 days prior to the BugZilla thing being open...

            Can I ask what is the present situation in relation to bugs? I can't see that any of the bugs on the new system have been updated and the bugzilla has been open the best part of two weeks...
            Rich will have to comment on this but I can tell you that the developers are working non stop on HS3.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment

            Working...
            X