PHP Modules by Tommi2Day  4.4
Modules for Symon
Functions
ips_mqtt2db.py File Reference

script to log via MQTTPUB generated MQTT messages into database More...

Functions

def getFileNameWithoutExtension (path)
 retrieves the filename without extension More...
 
def read_config ()
 read config from yom file
 
def on_connect (client, userdata, flags, rc)
 process paho mqtt connect event More...
 
def on_message (client, userdata, msg)
 process incoming paho mqtt message event More...
 

Detailed Description

script to log via MQTTPUB generated MQTT messages into database

to run adjust credentials first

Author
Date
2017-03-11
Version
0.2

How to use:

Function Documentation

def ips_mqtt2db.getFileNameWithoutExtension (   path)

retrieves the filename without extension

Parameters
pathFilename
Returns
string
def ips_mqtt2db.on_connect (   client,
  userdata,
  flags,
  rc 
)

process paho mqtt connect event

Parameters
client
userdata
flags
rc
def ips_mqtt2db.on_message (   client,
  userdata,
  msg 
)

process incoming paho mqtt message event

Parameters
client
userdata
msgpayload

expected payload json data format:

1 {'Path': 'APCUPSD Devices/Back-UPS RS 900G/Load',
2 'TS': 1476977860,
3 'UTF8Value': '25',
4 'VariableChanged': 1476977860,
5 'VariableID': 10899,
6 'VariableIdent': 'LoadPct',
7 'VariableType': 1,
8 'VariableUpdated': 1476977860}