I’m hoping for some pointers for coding a barometer plugin.
I have a serialattached barometer that I can read thru my pc’s com port by sending some simple commands.
I have previosly managed to alter the somfy plugin to control a simple relay board that is also serially attached, so I have gained some (very little) understanding of LUA, but now I want to try to make a plugin for this serial attached barometer.
I have manually created a barometer device in vera3lite by pointing to the file D_BarometerSensor1.xml that came with the RFXcom plugin ( ithink)
Now I wonder, is it all possible to just create a device like this and then use some code to read from the serialport and update the barometer device, or is this device ‘married’ into the RFXCom plugin in such a way that this is not possible?
Here is a snippet of the code I’m trying to use to set the pressure on the newly created device.
Then there is a lot of other reading on the Wiki and looking at the implementation of other plugins to master the art. I have written quite a few plugins and I am still learning!
Try to start with a plugin that is similar to what you are doing … install it on your Vera … then look at all the files and then read about what each of the pieces in the file is about and used for.
Then there is a lot of other reading on the Wiki and looking at the implementation of other plugins to master the art. I have written quite a few plugins and I am still learning!
Try to start with a plugin that is similar to what you are doing … install it on your Vera … then look at all the files and then read about what each of the pieces in the file is about and used for.