Announcement

Collapse
No announcement yet.

Looking for scripting help

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

    Looking for scripting help

    would it be possible to post some working scripts for BLLED here that can be modified by the end user for those of us that are really struggling with scripting. I feel that those of us that havent been able to figure out script writing are missing alot of functionality here

    Thanks Ken
    HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

    #2
    Originally posted by kenrad View Post
    would it be possible to post some working scripts for BLLED here that can be modified by the end user for those of us that are really struggling with scripting. I feel that those of us that havent been able to figure out script writing are missing alot of functionality here

    Thanks Ken
    Hi Ken,

    What are you looking for your script to do? I put a simple one together today to display current time and temperature on a BetaBrite.

    Cheers
    Al
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Originally posted by sparkman View Post
      Hi Ken,

      What are you looking for your script to do? I put a simple one together today to display current time and temperature on a BetaBrite.

      Cheers
      Al

      I would like a few different options I like the one for time and temp that you mentioned. I would also like to be able to display called ID info
      like be able to display the name and temp for my multi senors. display name and status of selected devices

      Cheers Ken

      Hoping to get my signs in the next few days and start playing

      if you wouldn't mine sharing your time and temp script that would definitely be a start
      HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

      Comment


        #4
        Hi Ken,

        Here you go. Note that this is a work in progress as I started on it today. I've been playing with the transitions and colors/fonts. Change those effects as you would like them.

        Code:
        Sub Main(ByVal Parms As object)
        
        	'Tag		Description
        	'transition	This is the transition of the text on the sign. 
        	'			Valid values are: rotate, hold, rollup, rolldown, rollleft, rollright, wipeup, wipedown, wipeleft, wiperight, scroll,
        	'			auto, rollin, rollout, wipein, wipeout, compressedrotate, twinkle, sparkle, snow, interlock, switch, spray, starburst, 
        	'			welcome, slotmachine, newsflash, trumpet, cyclecolors, thankyou, nosmoking, dontdrink, animal, fish, fireworks, balloon, turbocar, cherrybomb
        	'font		This is the font of the text on the sign. Valid values are: five, fivebold, fivewide, fivewidebold,
        	'			seven, sevenserif, sevenbold, sevenboldserif, sevenshadow, sevenshadowserif, sevenwide, sevenwidebold, sevenwideboldserif, sevenwideserif
        	'color		This is the color of the text on the sign. Some signs will not show all colors. Valid values are: red, green, amber, dimred, dimgreen, brown, orange, yellow,
        	'			rainbow1, rainbow2, colormix, auto
        	'flash		This will cause the text to flash or stop flashing. Valid values are: on, off, 1, 0, true, false, yes, no
        	'extchar	This is an external character you can add to the text on the sign. Some signs will not show these characters. 
        	'			Valid values are: enterkey, ykey, uparrow, downarrow, leftarrow, rightarrow, pacman, sailboat, baseball, telephone, heart, car, handicap, rhino, mug, satellite, copyright
        	'Examples:
        	'This is test 1
        	'{transition=fireworks}{font=five}{color=red}{flash=yes}Hello{font=seven}{color=orange} World{flash=no}{transition=sparkle}
        	'{font=fivebold}{color=orange}Hello{font=seven}{color=green} There
        	'{font=five}{color=green}Temp is 24 degrees{transition=rotate}
        	'{flash=yes}BetaBrite{flash=no}
        	'I {extchar=heart} BetaBrite
        
        	Dim ParmArray() as String
        	ParmArray = Parms.tostring.split(",")
        	Dim sign = CInt(ParmArray(0))
        	Dim loc = ParmArray(1)
        	Dim message = ParmArray(2)
        	Dim logName = "BetaBrite"
        	Dim debug = True
        
        	If message = "Temperature" Then
        		message = "{transition=hold}{flash=no}{color=red}" & CStr(hs.DeviceValueEx(519)) & "°C Outside" & "{transition=hold}"
        	ElseIf message = "Time" Then
        		Dim currentTime as Date = TimeOfDay
        		message = "{transition=hold}{flash=no}{color=red}" & CStr(Format(currentTime, "Short Time")) & "{transition=hold}"
        	ElseIf message = "Caller" Then
        		dim calleridname, calleridnumber As String
        		'calleridname = hsp.CIDName(1)
        		'calleridnumber = hsp.CIDNumber(1)
        		If calleridname = "" Then calleridname = "Unknown Caller"
        		If calleridnumber = "" Then calleridnumber = ""
        		message = "{transition=hold}{flash=no}{color=red}" & " Call From " & calleridname & "(" & calleridnumber & ")" & "{transition=hold}"
        	End If
        
        	If debug Then hs.writelog(logname, CStr(sign) & " - " & loc & " - " & message)
        	hs.PluginFunction("BLLED", "", "SetMessage", New Object(){sign, loc, message})
        
        End Sub
        Save it as BetaBrite.vb and change the device reference from 519 to the reference number of the temperature device in your system. I have events set up that call the script:
        • one event on value change of the temperature device
        • one event that runs every minute to change the time
        • one event that runs when caller id info is available - note that this is not working yet as the HSPhone script commands are not yet working in the latest version of HS. If you have a different method for getting a caller ID then you would have to change the script and event to match.


        The script is called with 3 parameters, the first is the ID of the BetaBrite sign, then second is the message label, and the third is the parameter as to what you want the script to do. Screenshots of the events are below. Hope that helps.

        Cheers
        Al
        Attached Files
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Thanks Sparkman

          I appreciate all the help. I'll test it out as soon as the signs get here is this set to only send to one sign or will it do multiple signs.

          please continue to share what you come up with I wish I could get the hang of the scripting but it all seems so foreign to me.
          HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

          Comment


            #6
            Hi Ken,

            If you use a -1 (negative one) for the sign ID, it will be set on all signs.

            Cheers
            Al
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              Originally posted by sparkman View Post
              Hi Ken,

              If you use a -1 (negative one) for the sign ID, it will be set on all signs.

              Cheers
              Al
              Thanks Sparkman

              do you have any idea of a script that would simply display a device value when called if I had some thing simple like that I could easily modify to suit the devices that I was going to use it for

              Cheers Ken
              HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

              Comment


                #8
                Hi Ken,

                I'm sure I can come up with that. However, device values are just numbers, so you typically would need some text to go with it. You could use device strings as well, but quite often they contain HTML tags which you don't want to display. That's why I went with the method I did in my script. The temperature one is based on a device value, so take a look at that one and see if it meets your needs.

                Cheers
                Al
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  Originally posted by sparkman View Post
                  Hi Ken,

                  I'm sure I can come up with that. However, device values are just numbers, so you typically would need some text to go with it. You could use device strings as well, but quite often they contain HTML tags which you don't want to display. That's why I went with the method I did in my script. The temperature one is based on a device value, so take a look at that one and see if it meets your needs.

                  Cheers
                  Al
                  HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                  Comment


                    #10
                    Hi Ken,

                    The modification looks correct. The complete script is included above, you don't need to modify anything else except the device reference and text that you already have done. If that whole script is saved in your scripts directory as BetaBrite.vb, then you just need to create an event like the 1st one in the screen shot above (called BetaBrite - Update Temperature).

                    Cheers
                    Al
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #11
                      HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                      Comment


                        #12
                        Hi Ken,

                        That's basically correct although you would use "ElseIf" statements like the next parts of the script and then change your device reference numbers (you show the same number in your example). You would also need to create an event for each one. The alternate approach would be to run a single script and change all of the values you're interested in at the same time. Once you've played with it a bit and you figure out what you want to display, I can help with additional modifications.

                        Cheers
                        Al
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment


                          #13
                          Sparkman,

                          I got my signs today and everything with your script is running great, I was able to modify it to display the other values I wanted. I simply added more parameters with the ElseIf like you suggested. I can only get it to work with label A reliably B,C ect don't seem to work but A is working for me right now as a starting point. I noticed that this might still be a bug in the plugin because even sending a message directly form an event only works with label A.

                          CHeers Ken
                          HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                          Comment


                            #14
                            Sparkman,

                            One quick question on your script is it possible to send to seleceted signs. for instance I want to send to 2,3,5,6 but not 1 or 4. is it possible or is it either 1 or all

                            Cheers Ken
                            HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                            Comment


                              #15
                              Sparkman,

                              I have a few more questions on your script. I have been modifying it to meet my needs and it is working well but I was wondering if you would know how to get this to send messages to signs connected to remote instances

                              Cheers Ken
                              HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                              Comment

                              Working...
                              X