[RELEASE] InfluxDB Logger

The strange part is that this only happens in 3 out of 10 rooms. It is only a factor of ~10 not 100

Can you post here the query what you are using to get the values for plotting?

SELECT max(“value”) FROM “temperature” WHERE (“deviceName” = ‘Tmp - Syværelse’) AND time >= now() - 24h GROUP BY time(2m) fill(null);SELECT mean(“value”) FROM “temperature” WHERE (“deviceName” = ‘Varme - sy’) AND time >= now() - 24h GROUP BY time(2m) fill(null);SELECT max(“value”) FROM “humidity” WHERE (“deviceName” = ‘Tmp - Syværelse’) AND time >= now() - 24h GROUP BY time(2m) fill(previous)

I am getting alot of errors in the log:

Any ideas on how to fix this?

Looks like they all include Danish letters

Not the letters the problem, more likely what they are trying to pass to influxDB. There are missing values, integer and float format conflict and invalid arguments.

I have everything named in English, except the washing machine and vacuum cleaner. I used Hungarian language in the app and named those in Hungarian, but since moved to English fully as there were problems with foreign language in the app.

Try to start a new database in influx, it might solves those problems there.

For your previous question, there is a rate option for queries to influx. It can solve the spikes. Just search for it. It is used for smoothing the graphs.

I tried but that didnt sovle the problem

After I changed the names to english all the temperature and humidity data works correctly.
However window/door data and light data does not work correctly. It seems like it is the binary data which gives the problem when I look in the log:

I have solved the problems by change all names from Danish to English and minor changes to the code
By removing the ‘i’ in the valueBinary values it works perfectly :slight_smile:

else if (‘contact’ == evt.name) { // contact: Calculate a binary value (closed = 1, open = 0)
unit = ‘contact’
value = ‘"’ + value + ‘"’
valueBinary = (‘closed’ == evt.value) ? ‘1’ : ‘0’ // ‘1i’ : ‘0i’
data += “,unit={unit} value={value},valueBinary=${valueBinary}”

1 Like

The odd thing is, why an open/close event should be float and not boolean or integer.
How did you solve the firmware number?

I just switch off the system monitoring in the smartapp so I didn’t solved that

Hello Stewart,
This is great job!
I`ve tried also to patch the code in order to monitor the A/C power consumption and different modes but without success.

I`m using an Samsung OCF Air Conditioner (Samsung Triangle AR12NXWSAURNEU).
I can provide you logs and different stats from IDE.
What I tried:
In section(“Devices To Monitor:”) I added
input “AirConditionerModes”, “capability.airConditionerMode”, title: “AirConditioner”, multiple: true, required: false
In section def updated() I added:
state.deviceAttributes << [ devices: ‘airConditionerMode’, attributes: [‘powerConsumption’,‘supportedAcModes’,‘airConditionerMode’,‘fanMode’, ‘coolingSetpoint’, ‘airFlowDirection’, ‘OutdoorTemp_92’]]

Could you help regarding this matter?

UP!
Has anyone tested this feature?

This has been a fantastic tool for 5+ years. Has anyone ported this to work with InfluxData.com? I am looking to have a bunch of hubs around the country post to a Cloud Instance securely, without tunneling through SSH or having a local system.

I could use some help installing it. I have checked the credentials, db name and IP port are correct in the smartapp code. However I am seeing this in livelogging.

272a850b-fda5-4428-a9e0-199cbfb473ef 1:04:23 AM: error postToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [x-platform-error-code:unauthorized, content-length:48, http/1.1 401 unauthorized:null, x-influxdb-build:OSS, content-type:application/json; charset=utf-8, date:Fri, 18 Feb 2022 07:04:23 GMT, x-influxdb-version:2.1.1], Body: {“code”:“unauthorized”,“message”:“Unauthorized”}

If you are running InfluxDB 2.x you will need to set config with the API token from Influx. The app was configured with Influx 1.X so you need to map a v1 user and v1 database. But you can’t to that until you update the config with the token. There is v1 info in the Influx Documentation.

1) Update config for authorization with API Token.
2) Create a v1 user, will automatically map to user token in config. (need bucket id - influx bucket list)
3) Create a v1 dbrp mapping for database to bucket.

Hope this helps you or anyone else that was struggling like I was to get Influx running.

Hello,

I just switched from InfluxDB v1.3 to v2.3. I sent a pull request with modifications but I don’t know if the original poster still follows this topic. In the meantime, you can get the modified version from here: SmartThings-codersaur/smartapps/influxdb-logger at master · Konnichy/SmartThings-codersaur · GitHub

This version supports the v2 API and token authentication. No need for dbrp mappings.

As a side-note, this version also supports (some) multi-byte characters.

Hope this helps!

1 Like

What is our plan with Groovy going end of life for using Influx with Smart things? Is anyone workign on anything yet?

im wondering the same, it will be missed until a replacement comes along to the replace the groovy version.

I have been running this for a few weeks now and it has been working well: