I thought it would be an easy task to get my weather station data into ignition. I learned that my weather station has an API available, so that is the path I took. It suggests using their premade helper functions (https://ambientweather.docs.apiary.io/#introduction/authentication) so I thought the best choice would be to use python (https://github.com/avryhof/ambient_api).
I noted that the newest release of the helper functions don’t work with Python 2.7, so I downloaded the source files for a previous version that did support 2.7. I copied them into the /usr/local/bin/ignition/user-lib/pylib folder, and then tested it out in ignition’s script console. I did it this way because I figured issuing the install command “pip install ambient_api” would write to the computer’s local installation, not ignition’s installation. Each time I tried to import the library, I got a dependency error, so I found the library files for that dependency and copied them into the pylib folder. I did this about 6 times and decided this can’t be the right way to go about this.
I’m new to the concept of APIs and python libraries and I’m not sure I’m doing any of this right. Any help in this area would be appreciated.
- Am I on the right path for getting weather station data into ignition?
- Is there a better way to import python libraries?