Updated pullAndSend.py
thetravellor opened this issue · 2 comments
-
Your script doesnt work with Python 3 by the way, it does work on Python 2, python 3 doesnt like you have formatted your print statements, and other errors.
-
It works on Centos 7, but only after doing this:
sudo pip install --ignore-installed influxdb
Otherwise Centos becomes upset with dependencies it created at install time.
- The script run by systemd fails under Centos
python /home/stephen/enphase/enphase2influx/pullAndSend.py --url http://192.168.2.11/production.json &
Removing the & makes it work just fine
- I have modified your script to work with enphase batteries:
lastBatteryTime=0
batteryData = data['storage'][0]
print "Time data from battery : ", batteryData['readingTime']
if batteryData['readingTime'] > lastBatteryTime: print "Pushing storage data" pushData(batteryData, "storage", client) lastBatteryTime = batteryData['readingTime']
Hi,
Sorry but I don't have any CentOS release available to test. Feel free to make a pull request though for the changes that you proposed, they seem to be cool !
Regards
Updated for Python3