I would like to write a plugin to collect data for recording in datamine. The specific application are download stats by ip address available from my router. I’ve written a piece of lua code that queries the router at a set interval (e.g. 10min) at an http port.
The question I have is how to represent the data in the plugin. The natural solution seems to be to use a variable for each statistics, sort of like the VContainer does. Each time the value is updated, datamine would be informed and store the new data.
The problem with this is that in this case the variable names would be the ip-addresses (suitably modified to match syntax requirements). This list is variable and extends over time. For example I’ve just added the vera and it has a new ip address (I currently have about 50 for computers, gadgets, etc … unbelievable how this list grows).
From the VContainer plugin it appears that the list of variable is described in S_VContainer.xml, which presumably would have to be modified each time a new ip address is added. Obviously this is not desirable and hardly constitutes (home)automation.
Is there a better way to do this, perhaps with child devices (which also would have to be added dynamically under program control)?
The solution should have broader application (and perhaps exists already?). For example, I have a Netatmo “weather” station. It is possible to add additional sensor modules, which again would require dynamic modification of the device in vera.
Suggestions for properly solving this problem are most appreciated.
Many thanks!