Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

tikismoke/xee2mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

xee2mqtt

Simple Xee api V4 script to mqtt it automatically parse all cars, signals for each cars and location for each cars of user to mqtt.

You need to register and create an apps on the xee dev site (https://dev.xee.com/) it's free :)

Select at least those scope:

-vehicles.read

-vehicles.management

-vehicles.signals.read

-vehicles.locations.read

-vehicles.accelerometers.read

-account.read

-vehicles.devices-data.read

-vehicles.events.read

Redirect_url is important be sure it's the same as used in the code here:

redirect_uri="https://localhost/",

When patch will be available you will need to install https://github.com/quentin7b/xee-sdk-python

For the moment follow this procedure:

git clone https://github.com/tikismoke/xee-sdk-python
cd xee-sdk-python
python setup.py install

install requirements if not already done (pytz, arrow, oauth2, oauthlib, oauth_requests)

pip3 install pytz
pip3 install arrow
pip3 install oauth2
pip3 install oauthlib
pip3 install requests_oauthlib

Adapt somes row to your needs:

broker="YOUR MQTT BROKER IP OR NAME"
port=YOUR MQTT PORT
AND
client_id="YOUR XEE CLIENT Key API V4", 
client_secret="YOUR XEE CLIENT Secret API V4", 

Run at least in console once to generate the auth code needed (follow the link to allow your account access) it will generate a code that you need to paste back in the console.

It will the create a xee.json file contain token and refresh token for next calls.

You can now create a cron rules to call this script every 5/10/20/30/60 minutes as you want.

NOTE

Indeed you need also an mqt server and lib to communicate with.

About

Simple Xee api V4 scipt to mqtt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages