Nupic + InfluxDB?¿

We are creating time series based on certain events in our company and we want to store the time series on InfluxDB, so that Nupic can collect time series from the database and monitor them on Caravel.

Is there any solution to connect Nupic-InfluxDB?

Than you very much.

1 Like

I created InfluxHTM for this. Here is an example how to use. And here’s a video I presented about this project at a Bay Area HTM Meetup:

Thanks for your quick response @rhyolight ! I have created the environment but I can not get the example working :-(. See error:

user@pruebasdavid:~/influx.htm/examples$ ./nupic_example.py
Connecting to :***********@localhost:8086 (SSL? False)
Using Influx database ‘smartthings_htm_bridge’.
Traceback (most recent call last):
File “./nupic_example.py”, line 85, in
runModel(startProcessingAt, stopProcessingAt, aggregation, modelParamsPath)
File “./nupic_example.py”, line 27, in runModel
fridge.deleteHtmModels()
AttributeError: ‘NoneType’ object has no attribute ‘deleteHtmModels’

Can you help me, please?

That is just an example script, it won’t run without an InfluxDB with a database called smartthings_htm_bridge with a measurement=power and component=Mini+Fridge. You’ll have to do the work to connect it to your own Influx data source.

Thank you @rhyolight ! I have already created the influxdb working group (similar to that of nupic_example.py) and it gives me the same error. Look at the database query and look at the error:

Thank you again!

Does the smartthings_htm_bridge database have a measurement called power and a component called Mini+Fridge? You need to create sensors before you use them, from the README:

A Sensor in influxhtm is a series of data with a unique measurement and component. The measurement represents the value being measured, like power, temperature, motion, contact, etc. The component is an identifier for a sensor that is emitting a measurement in the form of data fields. A component might be called coffee-machine or hallway-motion. It represents a physical object (usually) collecting and emitting data. To create a Sensor, you must have both.

To create a Sensor and store data:

sensor = client.createSensor(
  measurement="power", component="coffee-machine"
)
sensor.write({
  "time": datetime.datetime.now(),
  "value": 23.33
})

And still the same.

Sorry for the image, but it only allows me to upload one at a time.

Let’s see if we can find the solution.

Thank you @rhyolight

Why not just copy and paste?

Make sure you have these environment variables set:

  • INFLUX_HOST
  • INFLUX_PORT
  • INFLUX_USER
  • INFLUX_PASS
  • INFLUX_SSL

For reference:

Yes, I have defined them @rhyolight :

I also send you the log that influxdb generates when you run nupic_example.py:

[httpd] ::1 - - [15/Nov/2016:17:53:56 +0100] “GET /query?q=SHOW+DATABASES HTTP/1.1” 200 123 “-” “python-requests/2.3.0 CPython/2.7.6 Linux/4.4.0-31-generic” 18fc30e5-ab54-11e6-807d-000000000000 13906
[query] 2016/11/15 17:53:56 SELECT “key” FROM smartthings_htm_bridge.autogen._series
[httpd] ::1 - - [15/Nov/2016:17:53:56 +0100] “GET /query?db=smartthings_htm_bridge&q=SHOW+SERIES HTTP/1.1” 200 115 “-” “python-requests/2.3.0 CPython/2.7.6 Linux/4.4.0-31-generic” 18ff4905-ab54-11e6-807e-000000000000 8469

Sorry, but I can’t help you anymore right now, but the code is open source, so please try debugging it. I am recording a video this week and on vacation next week. Up against a deadline. :confused:

Thank you very much!