Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySensors naming scheme #10

Open
findnix opened this issue Jan 13, 2022 · 3 comments
Open

MySensors naming scheme #10

findnix opened this issue Jan 13, 2022 · 3 comments
Labels

Comments

@findnix
Copy link

findnix commented Jan 13, 2022

Hello @jkandasa!

First of all I would like to thank you for your great work.
I use v1 since the beginning. Now it's time to move to v2. I welcome this because I have been using influx with telegtaf for a long time.
My request now: is it possible in influxdb (1.8) to get a naming scheme that matches the "external server" functionality of v1?
I have been using this form for a long time:
host=myController,gategatewayName=$gatewayName,nodeName=$nodeName,nodeEui=$nodeEui,sensorName=$sensorName,sensorId=$sensorId,variableType=$variableType,variableTypeId=$variableTypeId

Thank you and greetings from Austria

@jkandasa
Copy link
Member

hi @findnix thanks for being a member of MyController since the beginning.
The sad news is that, I ​restructured the v2 version completely. There is no exact mapping between these versions
​:(

You have to rewrite your influx query.

sample data from v2.

$ ./influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.5rc0
> use my_db
Using database my_db

> show MEASUREMENTS
name: measurements
name
----
mc_binary_data
mc_gauge_float_data
mc_gauge_int_data

> select * from mc_gauge_float_data limit 3;
name: mc_gauge_float_data
time                fieldid   fieldname gatewayid id                                   nodeid sourceid value
----                -------   --------- --------- --                                   ------ -------- -----
1617465594083318897 V_VOLUME            mysensor  9df7a394-68ee-4053-8fca-4b6b30f24f93 1      1        25.8
1617465604505737014 V_VOLUME            mysensor  9df7a394-68ee-4053-8fca-4b6b30f24f93 1      1        25.8
1617465609945693930 V_VOLTAGE           mysensor  e0ea463f-5b3c-4488-b8b5-9a762e4669af 13     1        235.72

> select * from mc_binary_data limit 3;
name: mc_binary_data
time                fieldid  gatewayid id                                   nodeid         sourceid value
----                -------  --------- --                                   ------         -------- -----
1617466107064094796 POWER    tasmota   6cf0ff66-2cf9-4e1c-b8af-e656e9c33a97 tasmota_D17238 Control  true
1617466121355097265 Fade     tasmota   eced0a2b-63b0-40d6-bea6-f37cd9632e26 tasmota_D17238 Control  true
1617536629723880037 V_STATUS mysensor  7bf5ce37-ae5d-44bc-94fc-176a872c00bc 13             1        true

> select * from mc_gauge_int_data limit 3;
name: mc_gauge_int_data
time                fieldid gatewayid id                                   nodeid sourceid value
----                ------- --------- --                                   ------ -------- -----
1617465593765123775 V_VAR2  mysensor  0fb504e6-2e14-4a0f-8604-060a4abb1972 1      1        128
1617465604182891816 V_VAR2  mysensor  0fb504e6-2e14-4a0f-8604-060a4abb1972 1      1        128
1617465638399227359 V_VAR2  mysensor  0fb504e6-2e14-4a0f-8604-060a4abb1972 1      1        128

In the future we may add additional plugin to publish metrics data to the external database.
let me know if you need a help further on this.

@findnix
Copy link
Author

findnix commented Jan 14, 2022

Hi @jkandasa !
Thank You for Your fast respond.

I always appreciated Your mapping from the IDs to the long names. Unfortunately this feature is gone. This "forces" me to realize an old idea to write a little wrapper for this. Either catching and rewriting the MQTT topics or simple inject "translated" events into influx. I've to think about now a bit more detailed ;-)

I would be a pleasure to share the code with you on success.

@jkandasa
Copy link
Member

@findnix In v2 some changes on the name/id to make it more generic.
as a result we have, gatewayid, nodeid, sourceid, fieldid, these are all real values from your sensor network.

I do rethink possibility for this in v2. and update if I get an great idea.
meantime you may post one of your existing query, I may get someidea.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants