fasmide / deflux Goto Github PK
View Code? Open in Web Editor NEWdeconz sensors to influxdb
License: MIT License
deconz sensors to influxdb
License: MIT License
Hi @fasmide
as my iobroker.deconz to InfluxDB breaks with [email protected] I was looking exactly for something like this.
Your Code works fine for most of my sensors but lacks support for some values:
2020/03/12 08:12:18 recv: {"e":"changed","id":"6","r":"sensors","state":{"dark":false,"daylight":false,"lastupdated":"2020-03-12T08:12:18","lightlevel":15180,"lux":33},"t":"event","uniqueid":"00:17:88: 01:06:f6:6e:ca-02-0400"} 2020/03/12 08:12:18 Dropping event due to error: unable to parse message: unable to unmarshal state: unable to unmarshal event state: ZHALightLevel is not a known type
2020/03/12 08:13:13 recv: {"e":"changed","id":"15","r":"sensors","state":{"lastupdated":"2020-03-12T08:13:13","presence":true},"t":"event","uniqueid":"00:17:88:01:06:47:1f:1e-02-0406"} 2020/03/12 08:13:13 Dropping event due to error: unable to parse message: unable to unmarshal state: unable to unmarshal event state: ZHAPresence is not a known type
020/03/12 08:15:13 recv: {"e":"changed","id":"20","r":"sensors","state":{"lastupdated":"2020-03-12T08:15:13","presence":true},"t":"event","uniqueid":"vpir-1581106741418"} 2020/03/12 08:15:13 Dropping event due to error: unable to parse message: unable to unmarshal state: unable to unmarshal event state: CLIPPresence is not a known type
2020/03/12 08:21:22 recv: {"e":"changed","id":"37","r":"sensors","state":{"lastupdated":"2020-03-12T08:21:22","open":true},"t":"event","uniqueid":"00:15:8d:00:04:46:d4:f6-01-0006"} 2020/03/12 08:21:22 Dropping event due to error: unable to parse message: unable to unmarshal state: unable to unmarshal event state: ZHAOpenClose is not a known type
2020/03/12 08:23:22 recv: {"e":"changed","id":"37","r":"sensors","state":{"lastupdated":"2020-03-12T08:23:22","vibration":true},"t":"event","uniqueid":"00:15:8d:00:03:13:0d:2c-01-0101"} 2020/03/12 08:21:22 Dropping event due to error: unable to parse message: unable to unmarshal state: unable to unmarshal event state: ZHAVibration is not a known type
Is there any chance to add them?
Thanks
Michael
Hi,
just yesterday I discovered your project, looks great and I need it;-)
I'm running a deconz network (since 1 week;) with 30+ IKEA routers and 40+ Aquara sensors, more to come.
it's mostly for only collecting data and monitoring (only exception right now: 2 OSRAM power plugs which manually can be switched off/on via web page to reset PCs, no rules/schedules). some details and grafana output you can see in the last slides from a talk last weekend:
https://programm.froscon.de/2020/events/2620.html
https://programm.froscon.de/2020/system/event_attachments/attachments/000/000/609/original/froscon-2020-zigbee.pdf
questions:
why are your measurement names deflux_ZHATemperature etc.? how can I change this?
right now with my own rest-to-influxdb hack (based on bash/curl/jq/awk/influx) I use sensor names (ZT-xy for temperature, ZR-xy for router, ZS-xy for door/window switches etc.) and these names I can directly select/plot/... in grafana.
right now I do not know how to select a single temp sensor in grafana, your choice looks at least impractical for me?!
example -- your db entries:
> select * from deflux_ZHATemperature
name: deflux_ZHATemperature
time id name temperature type
---- -- ---- ----------- ----
1598427500000 100 ZT-34 22.63 ZHATemperature
1598427505000 49 ZT-16 24.08 ZHATemperature
1598427519000 40 ZT-13 23.01 ZHATemperature
> select * from deflux_ZHAHumidity
name: deflux_ZHAHumidity
time humidity id name type
---- -------- -- ---- ----
1598427500000 50.12 101 ZT-34 ZHAHumidity
1598427505000 47.17 50 ZT-16 ZHAHumidity
1598427519000 50.56 41 ZT-13 ZHAHumidity
> select * from deflux_ZHAPressure
name: deflux_ZHAPressure
time id name pressure type
---- -- ---- -------- ----
1598427500000 102 ZT-34 972 ZHAPressure
1598427505000 51 ZT-16 969 ZHAPressure
1598427519000 42 ZT-13 968 ZHAPressure
my current db:
> select * from "ZT-34" where "time" > now() - 2h
name: ZT-34
time battery humidity on pressure reachable temperature
---- ------- -------- -- -------- --------- -----------
1598427499934 100 1 1 22.63
1598427500023 100 50.12 1 1
1598427500030 100 1 972 1
which could be aggregated/combined to ==>
1598427500030 100 50.12 1 972 1 22.63
> select * from "ZT-16" where "time" > now() - 2h
name: ZT-16
time battery humidity on pressure reachable temperature
---- ------- -------- -- -------- --------- -----------
1598427505205 100 1 1 24.08
1598427505309 100 47.17 1 1
1598427505315 100 1 969 1
==>
1598427505315 100 47.17 1 969 1 24.08
is this configurable so that I get separate measurements in influxdb for every sensor ?
right now you use seconds precision, I'd like to keep the milliseconds from deconz at least for now (precision ms).
and I'd like to get all nodes infos into influxdb, not only sensors.
I want to see/monitor/verify reachability of routers etc,
monitor status of those power plugs or lights (on/off) etc.
having an option what to log and what not might be helpful for others, too?
comments/hints/... ?
thanks for any input!!
Harald
Hi,
First of all it is not an issue it should be a suggestion or upgrade request.
Deflux works fine for me, thanks for your hard work. Before the Conbee stick I used zigbee2mqtt and there the battery status was in the query as well. Is it possible to put it to the query as well?
Hi,
can you add support for ZHAAirQuality? See https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/sensors/#supported-state-attributes_1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.