Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid Number #32

Open
KarmaPoliceT2 opened this issue Dec 29, 2017 · 2 comments
Open

Error: Invalid Number #32

KarmaPoliceT2 opened this issue Dec 29, 2017 · 2 comments

Comments

@KarmaPoliceT2
Copy link

Hey, great app (InfluxDB Logger)... I'm loving it and getting into it, but i am getting an occasional error that i thought you might be able to help me with... below is the output from the ST IDE

5:21:16 PM: error postToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [content-length:347, x-influxdb-error:unable to parse '_stHub,locationId="xxxxxxxxxxxxxxxxx",locationName="Home",hubId="xxxxxxxxxxxx",hubName="Home\ Hub",hubIP="192.168.1.xx" status="ACTIVE",batteryInUse=0i,uptime=nulli,zigbeePowerLevel=-6i,zwavePowerLevel="full",firmwareVersion="000.019.00019"': invalid number, request-id:xxxxxxxxxxxxxxxxxxx, http/1.1 400 bad request:null, x-request-id:2f1fe878-ec2e-11e7-8045-000000000000, x-influxdb-build:OSS, content-type:application/json, date:Fri, 29 Dec 2017 00:21:16 GMT, x-influxdb-version:1.4.2], Body: {"error":"unable to parse '_stHub,locationId=\"xxxxxxxxxx\",locationName=\"Home\",hubId=\"xxxxxxxxxxxxx\",hubName=\"Home\\ Hub\",hubIP=\"192.168.1.xx\" status=\"ACTIVE\",batteryInUse=0i,uptime=nulli,zigbeePowerLevel=-6i,zwavePowerLevel=\"full\",firmwareVersion=\"000.019.00019\"': invalid number"}

@raman325
Copy link

I'm seeing the same issue and decided to do some digging... Looks like getDataValue("uptime") returns null instead of an actual uptime value: uptime=nulli. Influx is expecting an integer there.

The workaround is to disable hub property logging in the SmartApp config which will have no impact to your database since the hub data isn't being successfully written to the DB anyway.

Fixing the issue requires either:

  1. Removing the uptime check from the code
  2. Checking uptime another way - per the following article, may need to figure out boot time instead and then calculate uptime using that? https://community.smartthings.com/t/hub-firmware-beta-19-16/104659/16

@raman325
Copy link

Submitted a fix here: #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants