Announcement

Collapse
No announcement yet.

Is possible to read from mysql and put the value in a device

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

    #16
    It has been working after all! I checked the tables and database the web interface has broken since for Traccar but i am guessing i need to change the web.path to something else to make it work?

    Comment


      #17
      Perfect!!. I'm not sure, but I think web.enable is standard enabled. But you have the option to change the port ofcourse. Afterwards the Windows service has to be restarted.

      <entry key='web.enable'>true</entry>
      <entry key='web.port'>1234</entry>
      <entry key='web.path'>C:\Program Files (x86)\Traccar\web</entry>

      Comment


        #18
        I have tried that but not yet restarted machine so doing that as we speak... hopefully web interface will work again should do i thing!

        Next challenge is homeseer is chucking up loads of errors relating to the script so will see if it can read the data properly after this restart

        Getting closer lol

        Cannot believe i spent HOURS yesterday basing my assumption of failure purely on web interface not working i feel so STUPID!

        Comment


          #19
          A Windows reboot for changing the conf file is not necessary I guess, but the Traccar service has to be restarted, because it will load the new config file.

          The error will be probably related to the "Attributes" column from the Traccar "positions" table. Not every GPS track provide the same information.

          Comment


            #20
            https://pastebin.com/ciG5AYqA

            If that means anything to you? still fighting with this stupid webinterface!

            Comment


              #21
              I'm not sure. Did you added the dll files to the settings.ini file in the Config folder from Homeseer(and restarted Homeseer)?
              Something like this: ScriptingReferences=Newtonsoft.Json;Newtonsoft.Json.dll

              I've added the dll in the root of Homeseer, but with newer plugins the dll file should be placed in the Bin folder as written in the last few sentences of my blog post.

              Comment


                #22
                Originally posted by Rutger View Post
                I'm not sure. Did you added the dll files to the settings.ini file in the Config folder from Homeseer(and restarted Homeseer)?
                Something like this: ScriptingReferences=Newtonsoft.Json;Newtonsoft.Json.dll

                I've added the dll in the root of Homeseer, but with newer plugins the dll file should be placed in the Bin folder as written in the last few sentences of my blog post.
                yes mysql in root and newton in bin/scripting

                Newtonsoft.Json;C:\Program Files (x86)\HomeSeer HS3\Bin\Scripting\Newtonsoft.Json.dll

                Comment


                  #23
                  In \Bin oke, but not in a subfolder like "Scripting". I don't know if this make sense. Even in settings.ini I don't have a full file path.

                  Comment


                    #24
                    The JSON part is only necessary for the Attributes fields, so If you comment the JSOn files in the top of the script and the script lines between line 193 and 248 you should be able to run at least the script.

                    Comment


                      #25
                      Thank you for helping but i think i will leave it as it is very complicated and i am fighting a losing battle i feel

                      Looks great though and maybe one day it will be easier for a stupid idiot like me

                      Comment


                        #26
                        I suggest to strip the script as short as possible.
                        Attached the same script where the JSON part will be skipped.
                        You can do the same for:

                        If myData.HasRows Then
                        While myData.Read
                        Dim address_PEUGEOT = MyData("address")


                        and use only one 1 MyData object and remove the rest from the script.
                        If this is working you can extend the script again, which will also not be an issue to overwrite other virtual devices (because write data to HS is done via static device-references).
                        Attached Files

                        Comment

                        Working...
                        X