HI,
I have manage as follow:
-
using curl to GET from API and save in .csv
-
then by using this python script link I am able to see data in my influxDB.
I use crontab to run this every 2 min. So far so good. Just need to modify my script every 5-7 days to set date as Tigo API allow only puling 7 days if pulling with 1min interval.
My bash script for crontab:
#!/bin/bash
cd /home/maciejn/tigo/
curl --location --request GET 'https://api2.tigoenergy.com/api/v3/data/combined?system_id=xxxxxxxxxx&agg=mi&start=2021-06-5T04:00:00&end=2021-06-11T22:00:00' \
--header 'Authorization: Bearer xxxxxxxxxx' >> /home/maciej$
python /home/maciejn/tigo/tigo_combined_1min.py --dbname hassio --input tigo_combined_1min.csv >> tigo_combined_1min.log
rm /home/maciejn/tigo/tigo_combined_1min.csv
curl --location --request GET 'https://api2.tigoenergy.com/api/v3/data/combined?system_id=xxxxxxxxxx&agg=d&start=2021-06-4T04:00:00&end=2021-07-3T22:00:00' \
--header 'Authorization: Bearer xxxxxxxxxx' >> /home/maciej$
python /home/maciejn/tigo/tigo_daily_total.py --dbname pv_total --input tigo_daily_total.csv >> tigo_daily_total.log
rm /home/maciejn/tigo/tigo_daily_total.csv
exit 0
Screenshot from grafana