Announcement

Collapse
No announcement yet.

Thrag's Echo Plugin Discussion Thread

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

  • Hi Thrag,

    I'm trying to install your Plugin according to instructions. I dropped the files where you say (I'm running HS3 ZEE S2 v 3.0.0.208 where that's /usr/local/HomeSeer/Config and /html). On running the aspx I get a compile error (see the screenshot). The cutoff text reads as below.
    Click image for larger version

Name:	EchoPluginIssue.PNG
Views:	1
Size:	41.6 KB
ID:	1182834

    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0

    Not sure if this is a know issue or not. I have not read of anyone trying to run it on a Linux/mono system. Thoughts?

    I read through your code and can't wait to get it running.

    -Lor

    Comment


    • HA Bridge

      Thrag

      Quick question. I got the bridge set up but Echo is telling me to push the button on my Hue Bridge. All of the devices are in the bridge, just not sure how to get Echo to discover them since I don't have a button to press.


      Thanks for your great work!


      Also, if anyone wants, I ported Thrag's code to Vb as I couldn't get C# working with Mono on Linux.

      Comment


      • Bigbrorpi,

        Try looking in the Amazon Alexa app, in Settings>Connected Home>Devices. Click 'discover devices' there.

        I'll probably be interested in your VB port of Thrag's code. Could you make it available? Sounds like you had some of the same issues I'm having...

        --Lor

        Comment


        • To answer the recent questions

          If I'm not mistaken HS uses IIS on windows as the web server. Which is why I believe the Global Cache issue can be resolved by making the library accessible to IIS. Unfortunately, I still don't know how to do that.

          There's no button you need to hit for discovery. The device discovery that the HA bridge is latching on to is for the Phillips Hue bridge, which only listens for the discovery protocol when you hit a button. That's why it says that message, however the HA bridge software is always listening so it should find your devices assuming the bridge is running, and you don't have more than 56 devices configured (for me it failed if I had 57 or more, claimed failure but actually succeeded at 56, and just works normally for under 56 ).

          Comment


          • IIS is not installed on my HS server. It shows as unticked in Windows Features and there is no windows service installed for the web server

            Comment


            • Originally posted by madas View Post
              IIS is not installed on my HS server. It shows as unticked in Windows Features and there is no windows service installed for the web server
              I guess I am mistaken then, which is unfortunate since now I have no clue what I need to somehow make aware of the GC plug in code.

              I've been thinking I really should convert this from the one big aspx page to an actual plug in, though I don't know enough about how HS and plug ins interact to know if this would actually solve the problem. I wrote it as a script page since that was the easiest way to get started. I still need to research how to convert the page into a real plug in.

              Comment


              • No way to tell it just to skip those devices while doing the discovery? I believe that the original intention but it didn't seem to function as designed.

                Comment


                • Originally posted by bigbrorpi View Post
                  Thrag

                  Quick question. I got the bridge set up but Echo is telling me to push the button on my Hue Bridge. All of the devices are in the bridge, just not sure how to get Echo to discover them since I don't have a button to press.


                  Thanks for your great work!


                  Also, if anyone wants, I ported Thrag's code to Vb as I couldn't get C# working with Mono on Linux.
                  I'm interested in the vb code. If C# is problematic on linux I'll switch over to vb going forward. It's be at least worth seeing if the vb version has the same weird problem with the global cache plug in.

                  Comment


                  • Originally posted by madas View Post
                    No way to tell it just to skip those devices while doing the discovery? I believe that the original intention but it didn't seem to function as designed.
                    The error appears to be happening when I make the call to get the list of devices rather than when I query an individual device for its information. Which would be why the error handling when looping through devices didn't help.

                    If you don't mind helping me verify that what's happening for you is what I think is happening, can you open up the page in a text editor and search for this line (it appears multiple times do all appearances):
                    Code:
                    		Scheduler.Classes.clsDeviceEnumeration devices = (Scheduler.Classes.clsDeviceEnumeration)hs.GetDeviceEnumerator();
                    and everywhere you see it make it read this:
                    Code:
                    		hs.WriteLog(logInfo,"About to get devices.");
                    		Scheduler.Classes.clsDeviceEnumeration devices = (Scheduler.Classes.clsDeviceEnumeration)hs.GetDeviceEnumerator();
                    		hs.WriteLog(logInfo,"Got device enumerator");
                    Then try to generate sample utterances again. You should see in the HS logs the message saying "about to get devices" but not the "got device enumerator" message if the error is really being generated by the GetDeviceEnumerator call.

                    Comment


                    • Thrag,

                      I'm not sure my error mentioned above is due to the GlobalCache plugin. Though the file where the error occured is Global.asax, I do not have the GlobalCache plugin installed. Were you suggesting so?

                      --Lor

                      Comment


                      • Originally posted by lor View Post
                        Thrag,

                        I'm not sure my error mentioned above is due to the GlobalCache plugin. Though the file where the error occured is Global.asax, I do not have the GlobalCache plugin installed. Were you suggesting so?

                        --Lor
                        The error you are getting isn't something I can reproduce as I don't have a linux box handy so I don't have much to go on. I don't even have a class named just "Type" that is being used in my code so something more fundamental is going wrong there with the page not even able to compile. Sorry I can't be more helpful there. Hopefully the gentleman with the vb port will post that as the linux version doesn't seem to play well with C#.

                        Comment


                        • Hi Thrag,

                          I did this and your correct. Here is the log. The error is after "About to get devices"

                          M

                          -----------------

                          Jan-20 12:08:09 PM Error Echo Plug in Exception: System.Runtime.Serialization.SerializationException: Unable to find assembly 'HSPI_GCIR, Version=5.0.0.22, Culture=neutral, PublicKeyToken=null'. Server stack trace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssembl yInfo.GetAssembly() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. GetType(BinaryAssemblyInfo assemblyInfo, String name) at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ct or(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatt er.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.De serializeObject(MemoryStream stm) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessag e.FixupForNewAppDomain() at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProc essMessage(IMessage reqMsg) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at Scheduler.hsapplication.GetDeviceEnumerator() at ASP.hs3echoplugin_aspx.getSampleUtterancesForDevices() at ASP.hs3echoplugin_aspx.getSampleUtterances() at ASP.hs3echoplugin_aspx.Page_Load(Object Sender, EventArgs E)

                          Jan-20 12:08:08 PM Info About to get devices.
                          Jan-20 12:08:08 PM Info Creating sample utterances for devices

                          Comment


                          • Hi Thrag,

                            On my system the hs.GetDeviceEnumerator(); generates similar error from the previous post:

                            Echo Plug in Exception: System.Runtime.Serialization.SerializationException: Unable to find assembly 'HSPI_OCELOT, Version=3.0.0.14, Culture=neutral, PublicKeyToken=null'. Server stack trace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssembl yInfo.GetAssembly() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. GetType(BinaryAssemblyInfo assemblyInfo, String name) at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ct or(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatt er.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.De serializeObject(MemoryStream stm) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessag e.FixupForNewAppDomain() at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProc essMessage(IMessage reqMsg) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at Scheduler.hsapplication.GetDeviceEnumerator() at ASP.hs3echoplugin_aspx.createHABridgeDevices() at ASP.hs3echoplugin_aspx.Page_Load(Object Sender, EventArgs E)

                            Korim

                            Comment


                            • Originally posted by Korim View Post
                              Hi Thrag,

                              On my system the hs.GetDeviceEnumerator(); generates similar error from the previous post:

                              Echo Plug in Exception: System.Runtime.Serialization.SerializationException: Unable to find assembly 'HSPI_OCELOT, Version=3.0.0.14, Culture=neutral, PublicKeyToken=null'. Server stack trace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssembl yInfo.GetAssembly() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. GetType(BinaryAssemblyInfo assemblyInfo, String name) at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ct or(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) at System.Runtime.Serialization.Formatters.Binary.__BinaryParse r.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader. Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatt er.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.De serializeObject(MemoryStream stm) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessag e.FixupForNewAppDomain() at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProc essMessage(IMessage reqMsg) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at Scheduler.hsapplication.GetDeviceEnumerator() at ASP.hs3echoplugin_aspx.createHABridgeDevices() at ASP.hs3echoplugin_aspx.Page_Load(Object Sender, EventArgs E)

                              Korim
                              Unfortunately this seems to be the same issue that others have had with the Global Cache plug in. For some reason these plugins are inaccessible from the aspx page and when I make the call to get an enumeration of all devices that error occurs. I don't have a fix or workaround currently other than temporarily removing the plug in in order to run the sample utterances or HA bridge config and then reinstall it (you only need to run those once). I realize this a terrible and not very feasible workaround.

                              I do want to migrate my code from the aspx page to an actual plug in, but I don't know if that will actually solve the problem and sadly I've had zero time since the new year to do any recreational programming.

                              Comment


                              • Originally posted by Thrag View Post
                                Unfortunately this seems to be the same issue that others have had with the Global Cache plug in. For some reason these plugins are inaccessible from the aspx page and when I make the call to get an enumeration of all devices that error occurs. I don't have a fix or workaround currently other than temporarily removing the plug in in order to run the sample utterances or HA bridge config and then reinstall it (you only need to run those once). I realize this a terrible and not very feasible workaround.
                                I think I found a solution for this problem. In my case the OCELOT plugin EXE file is located as usual in HomeSeer main folder only. This plugin doesn't have .config file and it seems to be not visible for ASPX script. After I copied (duplicated) HSPI_OCELOT.exe file into HomeSeer\html\bin folder, the issue is solved and the ASPX script finishes successfully.

                                I'll just need to remember to manually update this file in html\bin location every time when the plugin gets update in HomeSeer main folder.

                                I hope this will help also in case of the Global Cache plugin.

                                Thanks,
                                Korim

                                Comment

                                Working...
                                X