coussej / node-opcua-logger

An OPCUA Client for logging data to InfluxDB! 🔌 🏭
https://www.factry.io
MIT License
179 stars 63 forks source link

Datatypes mismatch #46

Closed mcsomnio closed 2 years ago

mcsomnio commented 4 years ago

We are running against an OPC UA server, inserting data into the InfluxDB. As such things seem fine - we are getting records continuously in the database. We are saving 2 things: timestamp and value. The value is a UInt64 which we can only map as a numerical value, which then gets automatically converted to Float behind the scenes, when in fact it should map to UInt64. As a result, the value gets inserted as 0 in the database. For strings and so on, it works well. How can we better control what it is converted to, behind the scenes?

coussej commented 4 years ago

Hello, to write as int, one would have to explicitly specify that during the write to influx, which is currently not the case. Feel free to add this in the code!