Announcement

Collapse
No announcement yet.

Formatting HTML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Formatting HTML

    I'm building an interface for my Touch Pro 2 using HSTouch. I'm new to HomeSeer, but have been learning a lot. So far, everything is going well and I'm now at the step of programming in some interaction with the Caddx. I have a screen on which I would like to show the status of the panel (disarmed, armed stay, armed away). One way I've found to do this is as was mentioned in another post... make a text object and assign
    Code:
    [$SCRIPT=&hs.DeviceString("a1")]
    to it. The status then shows up as it should, but the formatting is off and does not follow the appearance I set for the text box. I guess this is to be expected since the box is now displaying an html file, but how can I get it to display the result in the font, size, and color that I want?

    #2
    What shows up in the device string? Is there some html code in the stirng? If so it would need to be removed prior to displaying it in HSTouch.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Originally posted by Rupp View Post
      What shows up in the device string? Is there some html code in the stirng? If so it would need to be removed prior to displaying it in HSTouch.
      Thanks for the quick response. I'm posting a screenshot of what it ends up looking like. The white box with the word "Disarmed" is the text box I'm working on. If I right click on that and choose "view source", it looks like it has a bit of html code, which is that window to the left of my layout. Preferably, I would just format the output using the element properties in HSTouch. If needed, I'll change the html instead, but I don't know where to go to do that.
      Attached Files

      Comment


        #4
        Wow that's a lot of HTML. What you would need to do is write a sciprt to parse and populate the device string. Is there any other area you can pull the armed/disarmed status from?
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Another option for getting armed/disarmed status is through the StatusTrackingNormal area. I can get that to spit out the numerical value that equates to each status. I can use a $REGEXREPLACE statement to swap that number with a word, but I don't know how to run several $REGEXREPLACE commands at once (one to swap "1" with "Disarmed", one to swap "2" with "Armed Away", etc.).

          I think perhaps I should spend some time with HomeSeer scripting to figure out what I can and can't do. I took a C+ programming class back in school which may as well have been forever ago. I understand the general concepts of programming, but don't have any experience with it.

          For the short term, I'll wait until jasv chimes in with how I can format the html the plugin is sending HSTouch or strip the html entirely so that HSTouch can do its thing. Thanks for your help so far!

          Comment


            #6
            I don't know if it would work for sure but I use a Blade plug-in (BLTouchString) to format and show some devices in HSTouch, it can't hurt to give it a shot. There have been a few I've run into that html code got in the way and this plug-in strips it out and sends it on it's way to HSTouch.
            Marty
            ------
            XPpro SP3 /w HS Standard 2.5.0.80, HSTouch Server - 1.0.0.70, HSTouch Client 1.0.0.73 HSTouch Android - 1.0.0.2, HSTouch iPhone - 1.0.0.2
            Playing with HS3 a bit but it's just play at this point.

            Comment


              #7
              Wow, someone else who uses the TP2!

              Nice!! Ever get Android to run on it? I've played with Android on it, but ehh...too much work for the moment!

              --Dan
              Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

              Comment


                #8
                Originally posted by nauticus View Post
                I'm building an interface for my Touch Pro 2 using HSTouch. I'm new to HomeSeer, but have been learning a lot. So far, everything is going well and I'm now at the step of programming in some interaction with the Caddx. I have a screen on which I would like to show the status of the panel (disarmed, armed stay, armed away). One way I've found to do this is as was mentioned in another post... make a text object and assign
                Code:
                [$SCRIPT=&hs.DeviceString("a1")]
                to it. The status then shows up as it should, but the formatting is off and does not follow the appearance I set for the text box. I guess this is to be expected since the box is now displaying an html file, but how can I get it to display the result in the font, size, and color that I want?
                I may be missing something but couldn't you just use the device value for the panel device? I set up my hs-touch to do just that. I assigned the tracking status to a value and then assigned the text and icon based on the value. You can get the device values by going to the jvCaddx Security page and clicking on the "Scripting help".

                NOTE: You can also try turning the check box in the settings for "Show Panel Control popup" and use the existing device string. That has worked for some users.
                Last edited by jasv; August 16, 2010, 03:46 PM. Reason: Additonal info.
                James

                Running HS 3 on Win10 .

                Comment


                  #9
                  Originally posted by drozwood90 View Post
                  Wow, someone else who uses the TP2!

                  Nice!! Ever get Android to run on it? I've played with Android on it, but ehh...too much work for the moment!

                  --Dan
                  Yeah, I tried it once and it seemed to work okay. The Android port just doesn't seem quite ready enough for full time use, but they're getting there. Are you using your TP2 with HSTouch?

                  Originally posted by jasv View Post
                  I may be missing something but couldn't you just use the device value for the panel device? I set up my hs-touch to do just that. I assigned the tracking status to a value and then assigned the text and icon based on the value. You can get the device values by going to the jvCaddx Security page and clicking on the "Scripting help".

                  NOTE: You can also try turning the check box in the settings for "Show Panel Control popup" and use the existing device string. That has worked for some users.
                  I'm pretty sure that if one of us is missing something, it's not you. I think I follow you on assigning the tracking status to a value. By that you mean adding a text object to the screen (where you want the device status to be displayed). Then, under StatusTrackingNormal, you choose "HomeSeer Devices" as the Normal Association Type and "jvCaddx Plug-In Panel Control" as the HomeSeer Device. That gives you three options to choose from to display in that text object... Status Text, Status Image, and Value. When I choose Status Text, I get a bunch of html code. Status Image gives me nothing (because I haven't copied the jvCaddx images over to my project yet) and Value gives me a number. Did I get that right? If I choose Status Text, click OK, then change IsHTML to True, all the html in the text box changes to what you see in the screenshot I posted previously.

                  So you say that you choose Value, which displays a number in the text object that corresponds to the panel status. Awesome. That I can do. What I'm unclear on is how you "assign the text and icon based on that value". Where do I tell it to display "Hey fool, your house is unarmed!" (or whatever other snarky comment I come up with) when StatusTracking is set to Value instead of it displaying "1"?

                  Thanks again for your help.

                  Comment


                    #10
                    Looks like I did 2 things. One for my touchscreen and one for my iPhone.

                    1) I used the StatusTracking to display the panel device text (having turned off the popup checkbox).
                    2) I used the StatusTracking and StatusColors properties to change the color of the text and then used the alt text properties to display text instead of a value.

                    I would start with #1 to see if it works for you.
                    James

                    Running HS 3 on Win10 .

                    Comment


                      #11
                      Originally posted by jasv View Post
                      Looks like I did 2 things. One for my touchscreen and one for my iPhone.

                      1) I used the StatusTracking to display the panel device text (having turned off the popup checkbox).
                      2) I used the StatusTracking and StatusColors properties to change the color of the text and then used the alt text properties to display text instead of a value.

                      I would start with #1 to see if it works for you.
                      Well, that did it. #1 worked! All I had to do was uncheck "Show Panel Control Popup" in the jvCaddx settings on my HS machine (for anyone else stumbling across this issue). Thanks for your help!

                      Comment

                      Working...
                      X