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

Problem posting influxdb #56

Open
brianegge opened this issue Feb 7, 2020 · 4 comments
Open

Problem posting influxdb #56

brianegge opened this issue Feb 7, 2020 · 4 comments

Comments

@brianegge
Copy link

brianegge commented Feb 7, 2020

Probably an issue with escaping single quotes

deviceName=Andrew’s\ Bedroom\ (SPG6)

postToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [content-length:323, x-influxdb-error:unable to parse 'temperature,deviceId=387accbc-197e-401a-860b-30216863e23b,deviceName=Andrew’s\ Bedroom\ (SPG6),groupId=76973841-1133-4c88-898a-9e06934a1ad7,groupName=Dining\ Room,hubId=null,hubName=null,locationId=89a3cb26-6280-43ba-85a7-8495f9d9cc5a,locationName=Home,unit=F value=': missing field value, request-id:a2e4c97a-49ca-11ea-bdce-b827eb78a875, http/1.1 400 bad request:null, x-request-id:a2e4c97a-49ca-11ea-bdce-b827eb78a875, x-influxdb-build:OSS, content-type:application/json, date:Fri, 07 Feb 2020 16:55:25 GMT, x-influxdb-version:1.7.9], Body: {"error":"unable to parse 'temperature,deviceId=387accbc-197e-401a-860b-30216863e23b,deviceName=Andrew’s\\ Bedroom\\ (SPG6),groupId=76973841-1133-4c88-898a-9e06934a1ad7,groupName=Dining\\ Room,hubId=null,hubName=null,locationId=89a3cb26-6280-43ba-85a7-8495f9d9cc5a,locationName=Home,unit=F value=': missing field value"}

invalid number, possible powerLevel=high

postToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [content-length:349, x-influxdb-error:unable to parse '_stHub,locationId="89a3cb26-6280-43ba-85a7-8495f9d9cc5a",locationName="Home",hubId="79bdc377-ff47-4a88-ac5f-0f7dafb77fc6",hubName="Home\ Hub",hubIP="192.168.254.X" status="ACTIVE",batteryInUse=0i,uptime=nulli,zigbeePowerLevel=-6i,zwavePowerLevel="full",firmwareVersion="000.028.00012"': invalid number, request-id:9d1e32b8-49c1-11ea-b9bc-b827eb78a875, http/1.1 400 bad request:null, x-request-id:9d1e32b8-49c1-11ea-b9bc-b827eb78a875, x-influxdb-build:OSS, content-type:application/json, date:Fri, 07 Feb 2020 15:50:50 GMT, x-influxdb-version:1.7.9], Body: {"error":"unable to parse '_stHub,locationId=\"89a3cb26-6280-43ba-85a7-8495f9d9cc5a\",locationName=\"Home\",hubId=\"79bdc377-ff47-4a88-ac5f-0f7dafb77fc6\",hubName=\"Home\\ Hub\",hubIP=\"192.168.254.X\" status=\"ACTIVE\",batteryInUse=0i,uptime=nulli,zigbeePowerLevel=-6i,zwavePowerLevel=\"full\",firmwareVersion=\"000.028.00012\"': invalid number"}
@brianegge
Copy link
Author

OK, something is funky with how ST posts unicode. I think it's sending the wrong content-length.

This fixed the parsing issue:
str = str.replaceAll('\u2019', '\'') // Replace ’ with '.

The other was uptime=nulli. I change this to not include the uptime value if it's null.

@BreeCook
Copy link

BreeCook commented Mar 6, 2020

#52 all the crazy things in our homes now days is scary

@bjQrnen
Copy link

bjQrnen commented Mar 10, 2020

The other was uptime=nulli. I change this to not include the uptime value if it's null.

Could you please share the bit where you do the null-handling? Thanks.

@bjQrnen
Copy link

bjQrnen commented Mar 10, 2020

Nevermind, I used the fix in #33.
Is there an easy way to find a fork that is more "up-to-date" on regards of the pending pull request?

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

3 participants