I do not think I saw a post which someone took a value from a sql database (MySQL) and put the value in a device, is this possible?
Announcement
Collapse
No announcement yet.
Is possible to read from mysql and put the value in a device
Collapse
X
-
The script at the bottom of my blog post will show you how to retrieve data from MySQL and store it in a virtual device.
https://www.rutg3r.com/gps-data-traccar-homeseer/
Comment
-
Originally posted by Rutger View PostThe script at the bottom of my blog post will show you how to retrieve data from MySQL and store it in a virtual device.
https://www.rutg3r.com/gps-data-traccar-homeseer/
Thanks,
Aldo
Sent from my SM-G935V using Tapatalk
Comment
-
Originally posted by Rutger View PostI think you can do the same with earlier mentioned script to retrieve the Traccar data into Homeseer
It's working like a charm. I've extended it with Google Maps and Streetview as well.
Trust me i have tried for HOURS! to get you solution to work i am going crazy lol
Comment
-
I do run Traccar and Homeseer on the same server, including XAMPP for web and MySQL server. Yes, I have spend also many hours to get Traccar working fine on MySQL years ago, but now it's kind of peace of cake.
If a Homeseer vb script (or with php) is able to connect to the MySQL server to store or retrieve data, than the Traccar config change should not be an issue.
Comment
-
Originally posted by Rutger View PostI do run Traccar and Homeseer on the same server, including XAMPP for web and MySQL server. Yes, I have spend also many hours to get Traccar working fine on MySQL years ago, but now it's kind of peace of cake.
If a Homeseer vb script (or with php) is able to connect to the MySQL server to store or retrieve data, than the Traccar config change should not be an issue.
Comment
-
Maybe it's possible to get the data from SQL as well in Homeseer, but I never tried that.
There are probably some examples over here on the board or on the internet to achieve this.
I'm not using the default SQL DB from Traccar, but (as you can see in the Traccar documentation), MySQL is support too, but you need to have a MySQL environment for that ofcourse.
In my case I do have such an environment, because I save/update also all my HS device values into MySQL, and store temperature changes, timesheets(based on gps), etc, so the change in Traccar from SQL to MySQL was almost mandatory for me. Based on MySQL it's easier from me to get the Traccar data into Homeseer.
https://www.traccar.org/mysql/
Comment
-
Originally posted by Rutger View PostMaybe it's possible to get the data from SQL as well in Homeseer, but I never tried that.
There are probably some examples over here on the board or on the internet to achieve this.
I'm not using the default SQL DB from Traccar, but (as you can see in the Traccar documentation), MySQL is support too, but you need to have a MySQL environment for that ofcourse.
In my case I do have such an environment, because I save/update also all my HS device values into MySQL, and store temperature changes, timesheets(based on gps), etc, so the change in Traccar from SQL to MySQL was almost mandatory for me. Based on MySQL it's easier from me to get the Traccar data into Homeseer.
https://www.traccar.org/mysql/
Comment
-
the part of the "traccar.xml" file in the Traccar\Conf folder, is changed to:
<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?allowMultiQueries=true&autoReconnect=true&us eUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES</entry>
<entry key='database.user'>root</entry>
<entry key='database.password'>xxxxxx</entry>
- Where database.user: in my case "root" . A user which is created in the MySQL environment.
- Where database.password: the password for above created user.
- Because you have it running too on the same server, the database.url can be unchanged to "localhost"
You should create the database "traccar" manually, and after the config file is changed, and the Traccar service is started, it should create all the tables automatically in the MySQL database.
Comment
Comment