• Hi there, progress is great on my project. I have now reached a state, where I am considering the optimal approach to storing time-series-data in my influxDB.

    I can do it from the device, which is ESP8266 on wifi with IP, or I can do it from the server, but not sure what approach to use on the server.

    Any tips and tricks to share?

  • @njbuch

    Any tips and tricks to share?

    You can do it from server. No need to touch your device 😉

    This feature is available in recent SNAPSHOT version.

    You have to create an external server as shown,


    Assign sensors variable or sensor or gateway to this external server.


    All done 🙂

  • Super awesome it works great, can I add more sensor variables to one line in the external server?

  • @njbuch You can not add more sensor variables to one line.

    • if you configure a sensor it will send all the sensor variables data under the sensor.
    • If configure a node it will all the sensor variables data under the node.
    • If you configure a gateway it will send all the sensor variable data under the gateway.

    If the above configuration does not meet your requirements, you have to create multiple entries.

  • Tried to post all measurements from a node, but there is no tag keys, and hence I cannot query the data....

    Looking at the interface there is a "tags" field, but not sure how the temperature measurement is seperated from the humidity...?

  • @njbuch Tags are common across all data in MyController, It will indicate that, data from MyConroller. You can do a query based on Key format. Default key format is sensorName

  • @jkandasa Not sure I understand that. I have tried:

    SELECT mean("value") FROM "$ESP_0B9892" WHERE "sensorName" = 'humid-1'

    In influxdb, but no results....(but works).. but trying:

    SELECT * FROM "$ESP_0B9892"


    time	value
    2017-02-07T17:35:21.305Z	21
    2017-02-07T17:35:21.34Z	    54.4
    2017-02-07T17:36:22.233Z	21.1
    2017-02-07T17:36:22.269Z	54.4

    which indicates there is no tags or anything to seperate the data.

    This is my config window:

  • @njbuch You should use dynamic key format. currently("$ESP_0B9892") it is static. Change keyFormat as one of or mixed. Supported key's are here

    Key format, examples:

    • $sensorName >> SELECT mean("value") FROM 'humid-1'
    • $sensorName >> SELECT mean("value") FROM 'temp-1'

  • @njbuch

    Is that in the query on influxdb or the configuration?

    In configuration, you have to user key format from the following list,

    • $gatewayName
    • $nodeName
    • $nodeEui
    • $sensorName
    • $sensorId
    • $variableType
    • $variableTypeId

    You can use mixed of any value from above list.

    • $sensorName
    • $sensorName_$sensorId

    The table name will be based on your Key format value. If you use any references from the above list, It will be replaced dynamically at runtime with actual value. Hence your table name will be based on your key format and actual resource value.

    You have to create a query for influxDB based on your resource and Key format.


    • My key format is $nodeEui_$sensorName
    • My resource: nodeEui = 2, sensorName = temp_1
    • My query will be like SELECT mean("value") FROM '2_temp_1'
    • Here Key format ($nodeEui_$sensorName) replaced on dynamically as 2_temp_1.

    I hope this example clears your confusion.

  • Thanks for the good explanation, have played a lot with it, but cannot make it work.

    This is my external server configs:

    And I have two resources created:

    But nothing can be found in influxdb, and the log is empty...

    I had it working 2 days ago with static info in the external server... which was stupid I see now 🙂

  • @njbuch To check available series on the databases do the query, SHOW SERIES. will list available series.

    For your configuration, you should have the following series and it is query,

    • ESP_0B9892_Skur_fugtighed >> select * from ESP_0B9892_Skur_fugtighed
    • ESP_0B9892_Skur_Temperature >> select * from ESP_0B9892_Skur_Temperature

Suggested Topics