Git Product home page Git Product logo

zway-influxdbstats's Introduction

Zway-InfluxDbStats

Store sensor data in InfluxDB instances. Sensor and device data is transfered periodically, as well as every time a change occurs.

Since this module uses the new line protocol, it requires at least InfluxDb version 0.9.0.

Data is stored under 'device.$DeviceID$', with only one measurement key called 'level' The following tags are also added:

  • probe: Probe title (eg. 'temperature')
  • room: Room name
  • scale: Scale title (eg. '°C')
  • type: Basic device type (eg. 'multilevelSensor')
  • title: Device name

Configuration

database

Database name

username, password

Database credentials

server, port

Database server including the protocol (http:// or https://) and the port.

devices

List of devices to be monitored

interval

Sets an interval for periodic stats updates. If left empty the values will only be transfered on change (not recommended)

Virtual Devices

No virtual device is created

Events

No events are emitted

Installation

Install the BaseModule from https://github.com/maros/Zway-BaseModule first. You will also need access to a working InfluxDB instance. See https://influxdata.com/get-started/download-and-install-influxdb/ for installation instructions.

The prefered way of installing this module is via the "Zwave.me App Store" available in 2.2.0 and higher. For stable module releases no access token is required. If you want to test the latest pre-releases use 'k1_beta' as app store access token.

For developers and users of older Zway versions installation via git is recommended.

cd /opt/z-way-server/automation/userModules
git clone https://github.com/maros/Zway-InfluxDbStats.git InfluxDbStats --branch latest

To update or install a specific version

cd /opt/z-way-server/automation/userModules/InfluxDbStats
git fetch --tags
# For latest released version
git checkout tags/latest
# For a specific version
git checkout tags/1.02
# For development version
git checkout -b master --track origin/master

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

zway-influxdbstats's People

Contributors

maros avatar nikosch86 avatar theoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zway-influxdbstats's Issues

"Database Server URL" wrong description

InfluxDb Statistics Collector = v1.06
Z-Wave.me = v2.3.8-rc6-5-geef5c8d
InfluxDB = v1.7.1

Hi. It seems to be a mistake in description of "Database Server URL" field.
The only value, which worked for me was "http://192.168.1.120", but not "http://192.168.1.120:8086/write" as if was suggested by description.
As it took a lot of time for me to find the correct field, and also for others, so could you please update the description?

Cannot instantiate Module

Hello.

When I download development version 1.04 I get the following error when instantiating the module.

[2016-01-06 13:01:14.185] [I] [core] Notification: error (core): Cannot instantiate module: InfluxDbStats: TypeError: undefined is not a function
[2016-01-06 13:01:14.275] [I] [core] TypeError: undefined is not a function
at AutomationController.instantiateModule (automation/classes/AutomationController.js:287:24)
at AutomationController.createInstance (automation/classes/AutomationController.js:504:14)
at ZAutomationAPIWebRequest._.extend.createInstance (automation/ZAutomationAPIProvider.js:656:40)
at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:258:41)
at automation/WebserverRequestRouter.js:32:35
at WebServer.document_root (automation/Webserver.js:27:11)

To reproduce de error I just:

Download the last development branch: git clone https://github.com/maros/Zway-InfluxDbStats.git InfluxDbStats
Reload the server
Create an app through the web ui
Read the logs and find the upper stack trace.
Thanks!

Does not write if value is 0

InfluxDbStats does not seem to write anything to the database if the value is 0. This causes lots of strange behaviour when graphing and displaying these data, such as heat pump reporting to pull thousands of watts, even if it's been off for days.

Is there a 'feature' to not write zeros? If so, I'd like the option to turn that off.

zway data is sent to InfluxDB

Hi,

For some reason information from z-way controller itself is sent to InfluxDB (measurement is prefixed with "zway" but not "device"). See attached measurement.jpg.

Tag "influx" is used for several devices and they report data according to scheduled timer. InfluxDBStats module 1.07 was installed via App store. Z-way 3.0.0 is used on Raspberry with Razberry card. See influxStats-cfg.jpg, z-way-cfg.jpg.
Z-Way log shows "Update all" event for InfluxDbStats module. And this is not expected. See z-way-log.jpg. This data is sent each 5 minutes (same as is configured interval).

Can you please help to understand why do I receive information that is not configured to be sent? And how can it be avoided?

Also is there any way to send data at predefined time? For example at 07:00, 10:00, 19:00, 22:00?

BR,
Mike
z-way-log
z-way-cfg
influxStats-cfg
data
measurements

Update interval does does not stick

In the GUI for the module, you get a field where you are given the information that you should really set an update interval (which makes sense for later processing) but whatever you set in that field it is never retained (and never set actually).

Therefore, I always get a measurement into my database only on updates, not every 5 minutes which I would like to have.

  • State the Z-Wave>Me version. See Management > Info

v2.3.8-rc5

  • Make sure that you followed all installation instructions in the README. If installed via git ensure that the directory is NOT prefixed with 'ZWay-' and that the user running zway can access all files inside the directory.

N/A

  • Include log messages generated while running the highest log level. Log level can be set via /opt/z-way-server/config.xml (highest level = 0, file location may be different). Be sure to include enough context: Not only the line showing the error, but also a couple of lines before and after. Log file is usually located at /var/log/z-way-server.log

[2018-07-16 22:12:59.225] [D] [zway] SETDATA devices.84.instances.0.commandClasses.152.data.rNonceAckWait = **********
[2018-07-16 22:12:59.225] [D] [zway] SETDATA devices.84.data.lastNonceGet = 36729911 (0x02307437)
[2018-07-16 22:12:59.225] [I] [zway] Waiting for job reply: Nonce Get
[2018-07-16 22:13:01.323] [D] [zway] Job 0x13: deleted from queue
[2018-07-16 22:13:01.419] [W] [zway] Reply not received before timeout for job (Nonce Get)
[2018-07-16 22:13:02.946] [I] [core] --- Stopping module InfluxDb Statistics Collector
[2018-07-16 22:13:02.962] [I] [core] --- Starting module InfluxDb Statistics Collector
[2018-07-16 22:13:03.233] [D] [zway] Job 0x3b: deleted from queue
[2018-07-16 22:13:07.472] [D] [zway] RECEIVED: ( 01 0B 00 04 00 0E 03 40 03 01 D5 00 6A )
[2018-07-16 22:13:07.473] [D] [zway] SENT ACK
[2018-07-16 22:13:07.473] [D] [zway] SETDATA devices.14.data.lastReceived = 0 (0x00000000)
[2018-07-16 22:13:07.473] [D] [zway] SETDATA devices.14.instances.0.commandClasses.64.data.mode = 1 (0x00000001)

  • Append the configuration of the module. The configuration can be obtained by opening this URL in your browser http://#IP#:8083/ZAutomation/api/v1/instances/#INSTANCE-ID#

{"data":{"instanceId":"0","moduleId":"InfluxDbStats","active":"true","title":"Logger för förbrukning och temperatur till NAS influxdb","params":{"port":8086,"tags":["",""],"server":"xx.xx.xx.xx","database":"z-way","username":"xxxxxx","password":"xxxxxxxxxx","excludeTags":[]},"id":12,"creationTime":1531725573,"category":"logging"},"code":200,"message":"200 OK","error":null}

InfluxDB 2.0

Does this APP work with InfluxDB 2.0 as well ?

Field Tag 'level' not available in InfluxDB

Just tried out this PlugIn as it seems to fit my purpose very well. However I am struggling to get it work properly.

I have configured the DB, and I get information about my devices, but not what I have hoped.

  • Ensure you are running the latest released version. You can check that via the Apps > Local Apps screen in your Z-Wave>Me. (you might need to remove filters). If a red arrow is displayed next to this module, a newer version is available.

done

  • State the Z-Wave>Me version. See Management > Info

v1.13.3 (Built date: 15-09-2021 18:52:02)

  • Make sure that you followed all installation instructions in the README. If installed via git ensure that the directory is NOT prefixed with 'ZWay-' and that the user running zway can access all files inside the directory.

done

  • Include log messages generated while running the highest log level. Log level can be set via /opt/z-way-server/config.xml (highest level = 0, file location may be different). Be sure to include enough context: Not only the line showing the error, but also a couple of lines before and after. Log file is usually located at /var/log/z-way-server.log

[2021-09-22 17:41:48.284] [I] [core] Load app "InfluxDbStats" from folder ...
[2021-09-22 17:41:48.293] [I] [core] Loading module InfluxDbStats from userModules/InfluxDbStats
[2021-09-22 17:41:48.296] [I] [core] Executing script: /*** InfluxDbStats Z-Way HA module ******************************************* ...
[2021-09-22 17:47:24.462] [I] [core] Instantiating module 16 from class InfluxDbStats
[2021-09-22 17:47:24.467] [I] [core] --- Starting module InfluxDb Statistics Collector
[2021-09-22 17:48:24.491] [I] [core] [InfluxDbStats-16] Update all
[2021-09-22 17:48:24.499] [I] [core] [InfluxDbStats-16] Update zway.1
[2021-09-22 17:48:24.506] [I] [core] [InfluxDbStats-16] Update zway.34
[2021-09-22 17:48:24.509] [I] [core] [InfluxDbStats-16] Update zway.36
[2021-09-22 17:48:24.511] [I] [core] [InfluxDbStats-16] Update zway.37
[2021-09-22 17:49:24.489] [I] [core] [InfluxDbStats-16] Update all
[2021-09-22 17:49:24.491] [I] [core] [InfluxDbStats-16] Update zway.1
[2021-09-22 17:49:24.493] [I] [core] [InfluxDbStats-16] Update zway.34
[2021-09-22 17:49:24.494] [I] [core] [InfluxDbStats-16] Update zway.36
[2021-09-22 17:49:24.497] [I] [core] [InfluxDbStats-16] Update zway.37
[2021-09-22 17:50:24.511] [I] [core] [InfluxDbStats-16] Update all
[2021-09-22 17:50:24.513] [I] [core] [InfluxDbStats-16] Update zway.1
[2021-09-22 17:50:24.515] [I] [core] [InfluxDbStats-16] Update zway.34
[2021-09-22 17:50:24.516] [I] [core] [InfluxDbStats-16] Update zway.36
[2021-09-22 17:50:24.518] [I] [core] [InfluxDbStats-16] Update zway.37
[2021-09-22 17:51:24.536] [I] [core] [InfluxDbStats-16] Update all
[2021-09-22 17:51:24.538] [I] [core] [InfluxDbStats-16] Update zway.1
[2021-09-22 17:51:24.539] [I] [core] [InfluxDbStats-16] Update zway.34
[2021-09-22 17:51:24.540] [I] [core] [InfluxDbStats-16] Update zway.36
[2021-09-22 17:51:24.542] [I] [core] [InfluxDbStats-16] Update zway.37

  • Append the configuration of the module. The configuration can be obtained by opening this URL in your browser http://#IP#:8083/ZAutomation/api/v1/instances/#INSTANCE-ID#

{"data":{"moduleId":"InfluxDbStats","active":true,"title":"InfluxDb Statistics Collector","params":{"port":8086,"tags":[],"server":"http://10.0.0.100","database":"razberry","excludeTags":[],"interval":1},"id":16,"creationTime":1632325644,"category":"logging"},"code":200,"message":"200 OK","error":null}

  • If applicable, please also include steps to reproduce.

This is the InfluxDB output of 'show field keys':
name: zwave.36
fieldKey fieldType


battery float
failed float
failure float
queue float
success float

name: zwave.37
fieldKey fieldType


failed float
failure float
queue float
success float

For 'show tag keys' its not much more:
name: zwave.36
tagKey

title
type

name: zwave.37
tagKey

title
type

Not working with Zway 2.2.2

Installed + Instantiated Basemodule 1.08 via "apps".
Installed InfluxDbStats 1.04 via "apps".

Cannot instantiate module: InfluxDbStats: TypeError: undefined is not a function

z-way-server.log:

[2016-04-23 17:37:50.131] [I] [core] Notification: error (core): Cannot instantiate module: InfluxDbStats: TypeError: undefined is not a function
[2016-04-23 17:37:50.167] [I] [core] TypeError: undefined is not a function
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:394:24)
    at AutomationController.createInstance (automation/classes/AutomationController.js:833:23)
    at ZAutomationAPIWebRequest._.extend.createInstance (automation/ZAutomationAPIProvider.js:1027:40)
    at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:258:41)
    at automation/WebserverRequestRouter.js:32:35
    at WebServer.document_root (automation/Webserver.js:29:11)

Unable to activate app

When I try to activate this app in z-wave-me (2.3.5) I only get a "something went wrong" message.
I've ran "create database zwave" in influx so the database exists. Influx is available and running (I use it for other applications as well).

Url: http://192.168.10.10
Port: 8086
Database: zwave
Tag: influxdb
Interval: 5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.