PostMeterEvent



In [16]:
cd /home/iot/repos/SolarDataRESTfulAPI


/home/iot/repos/SolarDataRESTfulAPI

In [7]:
ls


cvs_importer.py             influxInterfaceCredentials2.json  SLB_DataImporter.py*
ElasticsearchInterface.py   IoTtoolkit.py                     SolarAreaProductionProducer.py*
ElasticsearchInterface.pyc  IoTtoolkit.pyc                    SolarDataRESTapi.py
Feeds.json                  LICENSE                           SolarProductionProducer.py*
InfluxDBInterface.py        README.md                         SolarRestAPI.sh*
InfluxDBInterface.pyc       SeriesStatus.py*                  Universe.json
influxDBSolarREST.py        SiteIDs.json

In [8]:
import pandas as pd
import InfluxDBInterface
import time
from ElasticsearchInterface import ESinterface
import sys
import argparse

In [11]:
sys.path.append("/home/iot/repos/SolarDataRESTfulAPI")

In [12]:
sys.path


Out[12]:
['',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/IPython/extensions',
 '/home/iot/repos/SolarDataRESTfulAPI']

In [17]:
DataLink = InfluxDBInterface.InfluxDBInterface("influxInterfaceCredentials2.json")

In [23]:
DataBase = DataLink.databases["SolarProductionSites"]

In [22]:
DataLink.listdataseries()


Out[22]:
[u'test/list_series_result',
 u'SolarProductionSites/list_series_result',
 u'SolarLogdata/list_series_result',
 u'SolarProductionAreas/list_series_result']

In [29]:
DataBase.GetLastValue("2a31fb24-347b-4924-ab89-5c434771a2ae",[u'Power'])


Out[29]:
(1425133200000, 7174)

In [27]:
DataBase.GetProperties("2a31fb24-347b-4924-ab89-5c434771a2ae")


Out[27]:
[u'Power', u'Energy']

In [30]:
ls


cvs_importer.py                   IoTtoolkit.py             SLB_DataImporter.py*
ElasticsearchInterface.py         IoTtoolkit.pyc            SolarAreaProductionProducer.py*
ElasticsearchInterface.pyc        LICENSE                   SolarDataRESTapi.py
Feeds.json                        PostInfluxMeterEvent.py*  SolarProductionProducer.py*
InfluxDBInterface.py              README.md                 SolarRestAPI.sh*
InfluxDBInterface.pyc             SeriesStatus.py*          Universe.json
influxDBSolarREST.py              SeriesStatus.pyc
influxInterfaceCredentials2.json  SiteIDs.json

In [31]:
import mosquitto

In [32]:
mqtt=mosquitto.Mosquitto("ProductionProducer")

In [33]:
mqtt.loop_start()

In [ ]: