This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recipe created by recipetool | |
# This is the basis of a recipe and may need further editing in order to be fully func | |
# (Feel free to remove these comments when editing.) | |
# | |
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is | |
# your responsibility to verify that the values are complete and correct. | |
LICENSE = "MIT" | |
LIC_FILES_CHKSUM = "file://LICENSE;md5=046523829184aac3703a4c60c0ae2104" | |
HOMEPAGE = "https://github.com/influxdb/influxdb-python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kapacitor.udf.agent import Agent, Handler | |
from kapacitor.udf import udf_pb2 | |
import logging | |
import json | |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s:%(name)s: %(message)s') | |
logger = logging.getLogger() | |
class GeoTestHandler(Handler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = batch | |
|query('SELECT * FROM "telegraf_test"."autogen"."humid"') | |
.period(20s) | |
.every(20s) | |
data | |
@hash() | |
.field('v') | |
|alert() | |
.crit(lambda: TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"text": "Platform information quality", | |
"checked": false, | |
"value": { | |
"description": null | |
}, | |
"children": [{ | |
"text": "Collection quality", | |
"checked": false, | |
"value": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"categories": [ | |
{ | |
"name": "Goals", | |
"labels": [ | |
{ | |
"id": 1, | |
"name": "I want to track other’s products.", | |
"checked": false | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ciss: | |
"""CISS Class""" | |
# parsing methods | |
# other necessary codes | |
def parse_payload(self, accepted_data): | |
data_type = {'measurement': 'ciss', | |
'fields': | |
{ | |
'accX': 0.0, | |
'accY': 0.0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[local] | |
# Local Instance of InfluxDB | |
host = 'localhost' | |
port = 8086 | |
database = 'CISS' | |
[cloud] | |
# Cloud Instance of InfluxDB | |
# NOTE: doesn't have to InfluxDB it could be | |
# any technology stack that you wish to upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_points(conf): | |
# We use the configuration in the TOML file | |
# to get the data points using `influxdb-python` | |
# Refer to Repository for complete code | |
# create the query string | |
dict_str = ''.join('"{}"=\'{}\''.format(key,value) for key, value in conf['tags'].items()) | |
QUERY = 'SELECT "{}" FROM "{}" WHERE "status"=0 AND {} LIMIT {}'.format( | |
'","'.join(conf['fields']), | |
conf['measurement'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_data(batch_data): | |
if connected_to_cloud(): | |
try: | |
if CLOUD_DB.write_points(batch_data, time_precision='ms'): | |
logger.info('Write Successful to Cloud') | |
logger.info('Updating local database with status=1 field') | |
# for each point add `status=1` field | |
for point in batch_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<Wire.h> | |
#include<PubSubClient.h> | |
#include<WiFi.h> | |
#include<Adafruit_BME280.h> | |
#include <ArduinoJson.h> | |
/* | |
* WLAN Configuration | |
*/ | |
const char* ssid = "YOUR_SSID"; // FILL THIS ACCORDINGLY |
OlderNewer