Announcement

Collapse
No announcement yet.

Event listing in a HS Device?

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

  • #76
    Can u shutdown HS3, then delete those 2 files, then restart
    First time you access your calendars it should pop up a page on your HS3 machine for you to authenticate
    See if that helps
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


    • #77
      That worked. No error in log and now have 1 event in my virtual device which is what I have in my calendar. Still got to due a bit more testing but I assume everything should be good now. Excellent support and will be buying this plugin once I'm done my testing. Thanks again.

      Comment


      • #78
        I use "$$DTA:my device name:" for speak something. It works however if there is more than one event it speaks like one whole sentence. Any to pause a few seconds between events?

        Comment


        • #79
          You could try this for pause the speech a bit

          <silence msec='1000'/>
          Cheers,
          Bob
          Web site | Help Desk | Feature Requests | Message Board

          Comment


          • #80
            Since the event are taken from the calender and inserted in the virtual device by the script how do I get "<silence msec='1000'/>" between each event?

            Comment


            • #81
              That could be tricky if it is speaking as separate events
              You could add the "<silence msec='1000'/>" to the end of each one regardless - that way there would be a slight pause at the end of each event but that may work for you
              Cheers,
              Bob
              Web site | Help Desk | Feature Requests | Message Board

              Comment


              • #82
                Multiple events gets created in one virtual device as per screenshot. Not sure how to insert pause between event. Unless I could somehow change the script to put each event in a different virtual device. Then I could do speak something "$$DTA:my device 1 name:" "<silence msec='1000'/>" "$$DTA:my device 2 name:"


                Click image for larger version  Name:	Untitled.jpg Views:	1 Size:	9.4 KB ID:	1253496

                Comment


                • #83
                  I know nothing about scripting however I did try adding this to the code msg = msg & "<tr><td>" & ev.StartDate & " " & ev.StartTime & " - " & ev.Name & "<silence msec='1000'/>" "</td></tr>" hoping it would add the text in red to the event name so when speaking it would pause however that text is not being added to the event name. If i remove the <> it adds the silence msec='1000'/ text to the event but obviously it doesn't pause. Anyway around this?

                  Secondly events in the afternoon are displayed in as 13:00. Anyway to format this to 1:00.

                  Comment


                  • #84
                    I found a solution. Added "." to the code and this adds a period at the end of each event so there is a small pause between events.

                    Code:
                    sub Main(ByVal Parms As Object)
                        Dim ParmArray() as String
                        ParmArray = Parms.tostring.split(",")
                        Dim tDevice = ParmArray(0)
                        Dim tCalendar = ParmArray(1)
                        Dim tDays = cint(ParmArray(2))
                        Dim allEvents As Object()
                            Dim myemail as string="xxx@gmail.com"
                            Dim msg as string = ""
                    
                            allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){"xxx@gmail.com", "Leon Bourque", 1})
                            msg="<table>"
                        For Each ev As Object In allEvents
                               msg = msg & "<tr><td> " & ev.StartTime & " - " & ev.Name & "." & "</td></tr>"
                        Next
                            msg=msg & "</table>"
                            if msg="" then msg="No Events Scheduled"
                            hs.SetDeviceString(tDevice, msg.Trim, true)
                    End Sub
                    Last edited by freeon; November 6th, 2018, 04:45 PM.

                    Comment


                    • #85
                      I have another issue. When there no events the virtual device is just blank. With above code it should say no event scheduled. Any idea why it's not working.

                      Comment


                      • #86
                        If anyone comes across this thread and has the same issue as me Jon00 has given me the solution in a post in the scripting forums. Use below code instead.

                        If Not Msg.Contains("-") Then msg="No Events Scheduled"

                        Comment


                        • #87
                          Im trying to run this script and i get the following errors:
                          Feb-26 16:52:53 Error Compiling script /opt/HomeSeer/scripts/BLGData_Calendar.vb: Value of type 'Object' cannot be converted to 'System.Object[]'.
                          Feb-26 16:52:53 Error Compiling script /opt/HomeSeer/scripts/BLGData_Calendar.vb: The import 'System.Core' could not be found.
                          Feb-26 16:52:53 Event Running script in background: /opt/HomeSeer/scripts/BLGData_Calendar.vb
                          Any suggestions?


                          I think it may be an issue with me running HS3 and BLGData on Linux. Mono version is 5.18.0.240.

                          Code:
                          Sub Main(ByVal Parms As Object)
                              Dim ParmArray() as String
                              ParmArray = Parms.tostring.split(",")
                              Dim tDevice as string = ParmArray(0)
                              Dim tCalendar as string = ParmArray(1)
                              Dim tDays as integer = cint(ParmArray(2))
                              Dim allEvents As Object()
                                  Dim myemail as string="thisismyusers@gmail.com"
                                  Dim msg as string = ""
                          
                                  allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){myemail,tCalendar, tDays})
                                  msg="<table>"
                              For Each ev As Object In allEvents
                                     msg = msg & "<tr><td> " & ev.StartTime & " - " & ev.Name & "." & "</td></tr>"
                              Next
                                  msg=msg & "</table>"
                                  if msg="" then msg="No Events Scheduled"
                                  hs.SetDeviceString(tDevice, msg.Trim, true)
                          End Sub

                          Robert

                          Comment


                          • #88
                            I have seen this same thing when trying to get aspx pages to work in Linux as well
                            I am currently stumped by it
                            If you discover something please post it here
                            Cheers,
                            Bob
                            Web site | Help Desk | Feature Requests | Message Board

                            Comment


                            • #89
                              Originally posted by Blade View Post
                              I have seen this same thing when trying to get aspx pages to work in Linux as well
                              I am currently stumped by it
                              If you discover something please post it here
                              Thanks for responding. No suggestion on different code?
                              I tried removing most of the script, and adding one by one thing, starting from the top. The script ran fine until adding the allEvents = hs.PluginFunction line.
                              Also tried without using the parameters, instead entering the mail, calendar and days in that line, still errors.

                              Note:

                              I actually got around the aspx page issue following a github post, the workaround was to replace the code in /usr/bin/vbnc file from:

                              Code:
                              #!/bin/sh
                              exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
                              to

                              Code:
                              #!/bin/bash
                              for x; do
                              if [[ $x = '/tmp'* ]]; then
                              sed -i '1{/#Externa/d}' $x
                              fi
                              done
                              exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"

                              Comment


                              • #90
                                sparkman just helped me with the script not running under Linux.

                                The fix was to change "Dim allEvents As Object()" to "Dim allEvents As Object".

                                This script code now works perfect under Linux:

                                Code:
                                Sub Main(ByVal Parms As Object)
                                    Dim ParmArray() as String
                                    ParmArray = Parms.tostring.split(",")
                                    Dim tDevice as string = ParmArray(0)
                                    Dim tCalendar as string = ParmArray(1)
                                    Dim tDays as integer = cint(ParmArray(2))
                                    Dim allEvents As Object
                                        Dim myemail as string="youremail@gmail.com"
                                        Dim msg as string = ""
                                
                                        allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){myemail,tCalendar, tDays})
                                        msg="<table>"
                                    For Each ev As Object In allEvents
                                           msg = msg & "<tr><td> " & ev.StartTime & " - " & ev.Name & "." & "</td></tr>"
                                    Next
                                        msg=msg & "</table>"
                                        if msg="" then msg="No Events Scheduled"
                                        hs.SetDeviceString(tDevice, msg.Trim, true)
                                End Sub

                                Comment

                                Working...
                                X