{"action":"created","issue":{"url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/3","repository_url":"https://api.github.com/repos/krvarma/homebridge-particle","labels_url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/3/comments","events_url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/3/events","html_url":"https://github.com/krvarma/homebridge-particle/issues/3","id":159619128,"number":3,"title":"Particle Data mismatch","user":{"login":"JangoBritt","id":19468670,"avatar_url":"https://avatars.githubusercontent.com/u/19468670?v=3","gravatar_id":"","url":"https://api.github.com/users/JangoBritt","html_url":"https://github.com/JangoBritt","followers_url":"https://api.github.com/users/JangoBritt/followers","following_url":"https://api.github.com/users/JangoBritt/following{/other_user}","gists_url":"https://api.github.com/users/JangoBritt/gists{/gist_id}","starred_url":"https://api.github.com/users/JangoBritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JangoBritt/subscriptions","organizations_url":"https://api.github.com/users/JangoBritt/orgs","repos_url":"https://api.github.com/users/JangoBritt/repos","events_url":"https://api.github.com/users/JangoBritt/events{/privacy}","received_events_url":"https://api.github.com/users/JangoBritt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-10T11:55:00Z","updated_at":"2017-01-05T10:46:22Z","closed_at":"2016-06-10T19:10:57Z","body":"Hi @krvarma,\n\nI am running a PietteTech_DHT code on my particle photon, and the data that is being sent to Particle is in a different format to what the plugin is looking for:\n\nParticle reports:\n`{\"data\":\"23\",\"ttl\":\"60\",\"published_at\":\"2016-06-10T11:47:51.192Z\",\"coreid\":\"390031001347353236343033\",\"name\":\"Temperature\"}`\n\nThe API call, actually reports this as:\n\n```\nevent: Temperature\ndata: {\"data\":\"23\",\"ttl\":\"60\",\"published_at\":\"2016-06-10T11:47:51.192Z\",\"coreid\":\"390031001347353236343033\"}\n```\n\nthe plugin is expecting:\n\n`console.log(tokens[0] + \" = \" + tokens[1] + \", \" + this.services[1].displayName + \", \" + this.sensorType + \", \" + this.key.toLowerCase() + \", \" + tokens[0].toLowerCase());\n    console.log(this.services[1] != undefined && this.key.toLowerCase() ===`tokens[0].toLowerCase());``\n\nSo in this case, it is actually receiving the temperature in token 0, rather than in token 1.\n\nAs the data on Particle is in the key:value format, could the plugin be re-written as:\n\n`console.log(tokens.name + \" = \" + tokens.data` ?\n"},"comment":{"url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/comments/270616041","html_url":"https://github.com/krvarma/homebridge-particle/issues/3#issuecomment-270616041","issue_url":"https://api.github.com/repos/krvarma/homebridge-particle/issues/3","id":270616041,"user":{"login":"kebabmane","id":10240,"avatar_url":"https://avatars.githubusercontent.com/u/10240?v=3","gravatar_id":"","url":"https://api.github.com/users/kebabmane","html_url":"https://github.com/kebabmane","followers_url":"https://api.github.com/users/kebabmane/followers","following_url":"https://api.github.com/users/kebabmane/following{/other_user}","gists_url":"https://api.github.com/users/kebabmane/gists{/gist_id}","starred_url":"https://api.github.com/users/kebabmane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kebabmane/subscriptions","organizations_url":"https://api.github.com/users/kebabmane/orgs","repos_url":"https://api.github.com/users/kebabmane/repos","events_url":"https://api.github.com/users/kebabmane/events{/privacy}","received_events_url":"https://api.github.com/users/kebabmane/received_events","type":"User","site_admin":false},"created_at":"2017-01-05T10:46:21Z","updated_at":"2017-01-05T10:46:21Z","body":"Hi, i'm facing the same issue - my particle is publishing\r\n\r\n        Particle.publish(\"Humidity\", \"Humidity=\" + String(humidity) + \"%\");\r\n        Particle.publish(\"Temperature\", \"Temperature=\" + String(temperature) + \" °C\");\r\n\r\nand my config looks like \r\n\r\n            \"devices\": [\r\n                {\r\n                    \"accessory\": \"LivingRoomTemperature\",\r\n                    \"name\": \"Living Room Temperature\",\r\n                    \"deviceid\": \"DEVICEID\",\r\n                    \"type\": \"SENSOR\",\r\n                    \"sensorType\": \"temperature\",\r\n                    \"event_name\": \"Temperature\"\r\n                },\r\n                {\r\n                    \"accessory\": \"LivingRoomHumidity\",\r\n                    \"name\": \"Living Room Humidity\",\r\n                    \"deviceid\": \"DEVICEID\",\r\n                    \"type\": \"SENSOR\",\r\n                    \"sensorType\": \"humidity\",\r\n                    \"event_name\": \"Humidity\"\r\n                }\r\n            ]\r\n\r\nhowever i'm receiving the same error message as above (.toLowerCase()))"}}
{"actor":{"display_login":"kebabmane"}}