Announcement

Collapse
No announcement yet.

{{plugin_function is not called from html file? Any ideas what could be wrong?

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

    {{plugin_function is not called from html file? Any ideas what could be wrong?

    I have this in a html file.....

    Code:
    <div class="col-md-7">
    {{plugin_function 'HS4Test' 'GetPluginVersion' []}}
    </div>
    But instead of the plugin_function getting called in my plugin the plaintext is presented in the browser.....Any ideas I'm stumped.

    What does plugin_function depend upon?

    If it fails where does it present that information?
    HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
    BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
    DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

    #2
    That's what I have:
    HTML Code:
    <!DOCTYPE html>
        <html lang=""en"">
        <head>
            <meta charset = ""utf-8"" >
            <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">
            <!--This maintains the scale of the page based on the scale of the screen-->
            <meta name = ""viewport"" content=""width=device-width, initial-scale=1"">
            <meta name = ""author"" content=""ABK"">
            <!--This liquid tag loads all of the necessary css files for HomeSeer-->
            {{includefile '/bootstrap/css/page_common.css'}}
            <link href='/#ID#/abk.css' rel='stylesheet'>
        <title>
            {{ plugin_function '#ID#' 'GetTitle' ['#PAGE#'] }}
        </title>
        </head>

    Comment


      #3
      That's what is in the sample plugin also.....something is wrong, but the system provides no indication of what, so fixing is a bummer as I don't know where to start. I've spent two days tweaking and twiddling the html to no avail.....
      HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
      BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
      DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

      Comment


        #4
        Github then

        Comment


          #5
          I'm just beginning to begin to begin learning this stuff, but I think you may have to say "hs.plugin_function"

          This may help:

          https://forums.homeseer.com/forum/de...on#post1388632
          HomeSeer Version: HS4 Pro Edition 4.2.19.0 (Windows - Running as a Service)
          Home Assistant 2024.3
          Operating System: Microsoft Windows 11 Pro - Desktop
          Z-Wave Devices via two Z-Net G3s
          Zigbee Devices via RaspBee on RPi 3b+
          WiFi Devices via Internal Router.

          Enabled Plug-Ins
          AK GoogleCalendar 4.0.4.16,AK HomeAssistant 4.0.1.23,AK SmartDevice 4.0.5.1,AK Weather 4.0.5.181,AmbientWeather 3.0.1.9,Big6 3.44.0.0,BLBackup 2.0.64.0,BLGData 3.0.55.0,BLLock 3.0.39.0,BLUPS 2.0.26.0,Device History 4.5.1.1,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,HSBuddy 4.51.303.0,JowiHue 4.1.4.0,LG ThinQ 4.0.26.0,ONVIF Events 1.0.0.5,SDJ-Health 3.1.1.9,TPLinkSmartHome4 2022.12.30.0,UltraCID3 3.0.6681.34300,Z-Wave 4.1.3.0

          Comment


            #6
            Originally posted by ewkearns View Post
            I'm just beginning to begin to begin learning this stuff, but I think you may have to say "hs.plugin_function"
            OP is asking about Liquid tags in HTML page, but you are talking about scripting

            Comment


              #7
              Ususally when there is something wrong with the tag, your page doesn't render at all, it gives you gobbledy gook. Given it shows in plain text and the rest renders properly (is that correct), I would venture the page isn't being processed by scriban.

              Some questions:
              - you have this page rendered by HS4, right? (meaning you have a registered link in your plugin) and that's what you use, not another webserver that might be in use?
              - is the file named .htm or .html, should be the latter?
              - the scriban.dll is located in the <hs root>\bin\homeseer directory, is it there? Nothing screwed up the dll directories?

              Just some pointers

              Comment


                #8
                Also, hit F12 in chrome to see if there are any errors in the console.
                HS4Pro on a Raspberry Pi4
                54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                HSTouch Clients: 1 Android

                Comment


                  #9
                  Originally posted by alexbk66 View Post

                  OP is asking about Liquid tags in HTML page, but you are talking about scripting
                  OK, that's a few semesters ahead of me, but looks very interesting. I don't think I can look at the example and the "description" and see a lot of commonalities, but then I know so little about it. Thanks for the information. Somehow, I feel like I am looking at the basics of the "New HSTouch Designer".
                  HomeSeer Version: HS4 Pro Edition 4.2.19.0 (Windows - Running as a Service)
                  Home Assistant 2024.3
                  Operating System: Microsoft Windows 11 Pro - Desktop
                  Z-Wave Devices via two Z-Net G3s
                  Zigbee Devices via RaspBee on RPi 3b+
                  WiFi Devices via Internal Router.

                  Enabled Plug-Ins
                  AK GoogleCalendar 4.0.4.16,AK HomeAssistant 4.0.1.23,AK SmartDevice 4.0.5.1,AK Weather 4.0.5.181,AmbientWeather 3.0.1.9,Big6 3.44.0.0,BLBackup 2.0.64.0,BLGData 3.0.55.0,BLLock 3.0.39.0,BLUPS 2.0.26.0,Device History 4.5.1.1,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,HSBuddy 4.51.303.0,JowiHue 4.1.4.0,LG ThinQ 4.0.26.0,ONVIF Events 1.0.0.5,SDJ-Health 3.1.1.9,TPLinkSmartHome4 2022.12.30.0,UltraCID3 3.0.6681.34300,Z-Wave 4.1.3.0

                  Comment


                    #10
                    Originally posted by rmasonjr View Post
                    Also, hit F12 in chrome to see if there are any errors in the console.
                    true, on the other hand, this is server side processing that seems not to happen for some reason

                    Comment


                      #11
                      Originally posted by dcorsus View Post
                      Ususally when there is something wrong with the tag, your page doesn't render at all, it gives you gobbledy gook. Given it shows in plain text and the rest renders properly (is that correct), I would venture the page isn't being processed by scriban.

                      Some questions:
                      - you have this page rendered by HS4, right? (meaning you have a registered link in your plugin) and that's what you use, not another webserver that might be in use?
                      - is the file named .htm or .html, should be the latter?
                      - the scriban.dll is located in the <hs root>\bin\homeseer directory, is it there? Nothing screwed up the dll directories?

                      Just some pointers
                      Yes the page is registered and available with HS....
                      Yes the page otherwise registers correctly
                      Yes it is .html
                      Yes scriban.dll (11/15/2019) is in bin/homeseer

                      and weirdly the SamplePlugin renders correctly.....and processes the plugin_function

                      HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
                      BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
                      DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

                      Comment


                        #12
                        Instead of [] try ['0']
                        HS4Pro on a Raspberry Pi4
                        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                        HSTouch Clients: 1 Android

                        Comment


                          #13
                          Originally posted by rmasonjr View Post
                          Instead of [] try ['0']
                          No change, seems either is valid.
                          HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
                          BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
                          DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

                          Comment


                            #14
                            Originally posted by dmurphy View Post

                            Yes the page is registered and available with HS....
                            Yes the page otherwise registers correctly
                            Yes it is .html
                            Yes scriban.dll (11/15/2019) is in bin/homeseer

                            and weirdly the SamplePlugin renders correctly.....and processes the plugin_function
                            do you mind post the whole file, I'll try it against my system, see if the issue is somewhere else

                            Comment


                              #15
                              Originally posted by alexbk66 View Post
                              That's what I have:
                              HTML Code:
                              <!DOCTYPE html>
                              <html lang=""en"">
                              <head>
                              <meta charset = ""utf-8"" >
                              <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">
                              <!--This maintains the scale of the page based on the scale of the screen-->
                              <meta name = ""viewport"" content=""width=device-width, initial-scale=1"">
                              <meta name = ""author"" content=""ABK"">
                              <!--This liquid tag loads all of the necessary css files for HomeSeer-->
                              {{includefile '/bootstrap/css/page_common.css'}}
                              <link href='/#ID#/abk.css' rel='stylesheet'>
                              <title>
                              {{ plugin_function '#ID#' 'GetTitle' ['#PAGE#'] }}
                              </title>
                              </head>
                              Solved.......user error

                              I had implemented the scheme above to allow creation of html within the c# code.

                              {{plugin_function '#ID#' 'GetHTML' ['#PAGE#'] }}

                              BUT you cannot embed

                              Code:
                              <div class="col-md-7">
                                  {{plugin_function 'HS4Test' 'GetPluginVersion' []}}
                              </div>
                              in the html produced as it doesn't get evaluated recursively......doh
                              HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
                              BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
                              DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

                              Comment

                              Working...
                              X