{"action":"created","issue":{"url":"https://api.github.com/repos/bspranger/Xiaomi/issues/81","repository_url":"https://api.github.com/repos/bspranger/Xiaomi","labels_url":"https://api.github.com/repos/bspranger/Xiaomi/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/bspranger/Xiaomi/issues/81/comments","events_url":"https://api.github.com/repos/bspranger/Xiaomi/issues/81/events","html_url":"https://github.com/bspranger/Xiaomi/pull/81","id":294186508,"number":81,"title":"Major overhaul of code (not ready to merge)","user":{"login":"veeceeoh","id":33558908,"avatar_url":"https://avatars1.githubusercontent.com/u/33558908?v=4","gravatar_id":"","url":"https://api.github.com/users/veeceeoh","html_url":"https://github.com/veeceeoh","followers_url":"https://api.github.com/users/veeceeoh/followers","following_url":"https://api.github.com/users/veeceeoh/following{/other_user}","gists_url":"https://api.github.com/users/veeceeoh/gists{/gist_id}","starred_url":"https://api.github.com/users/veeceeoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veeceeoh/subscriptions","organizations_url":"https://api.github.com/users/veeceeoh/orgs","repos_url":"https://api.github.com/users/veeceeoh/repos","events_url":"https://api.github.com/users/veeceeoh/events{/privacy}","received_events_url":"https://api.github.com/users/veeceeoh/received_events","type":"User","site_admin":false},"labels":[{"id":622096967,"url":"https://api.github.com/repos/bspranger/Xiaomi/labels/bug","name":"bug","color":"ee0701","default":true},{"id":622096970,"url":"https://api.github.com/repos/bspranger/Xiaomi/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"veeceeoh","id":33558908,"avatar_url":"https://avatars1.githubusercontent.com/u/33558908?v=4","gravatar_id":"","url":"https://api.github.com/users/veeceeoh","html_url":"https://github.com/veeceeoh","followers_url":"https://api.github.com/users/veeceeoh/followers","following_url":"https://api.github.com/users/veeceeoh/following{/other_user}","gists_url":"https://api.github.com/users/veeceeoh/gists{/gist_id}","starred_url":"https://api.github.com/users/veeceeoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veeceeoh/subscriptions","organizations_url":"https://api.github.com/users/veeceeoh/orgs","repos_url":"https://api.github.com/users/veeceeoh/repos","events_url":"https://api.github.com/users/veeceeoh/events{/privacy}","received_events_url":"https://api.github.com/users/veeceeoh/received_events","type":"User","site_admin":false},"assignees":[{"login":"veeceeoh","id":33558908,"avatar_url":"https://avatars1.githubusercontent.com/u/33558908?v=4","gravatar_id":"","url":"https://api.github.com/users/veeceeoh","html_url":"https://github.com/veeceeoh","followers_url":"https://api.github.com/users/veeceeoh/followers","following_url":"https://api.github.com/users/veeceeoh/following{/other_user}","gists_url":"https://api.github.com/users/veeceeoh/gists{/gist_id}","starred_url":"https://api.github.com/users/veeceeoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veeceeoh/subscriptions","organizations_url":"https://api.github.com/users/veeceeoh/orgs","repos_url":"https://api.github.com/users/veeceeoh/repos","events_url":"https://api.github.com/users/veeceeoh/events{/privacy}","received_events_url":"https://api.github.com/users/veeceeoh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":28,"created_at":"2018-02-04T10:23:23Z","updated_at":"2018-02-06T22:10:03Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/bspranger/Xiaomi/pulls/81","html_url":"https://github.com/bspranger/Xiaomi/pull/81","diff_url":"https://github.com/bspranger/Xiaomi/pull/81.diff","patch_url":"https://github.com/bspranger/Xiaomi/pull/81.patch"},"body":"Now that I have an Aqara Temp/Humidity sensor to do testing with, I have spent the past 5 hours completely reworking sections of the code to address outstanding issues, and also worked on enhancements including fully integrating @tmleaf's High & Low Temperature tracking code. That last item shoud BE TESTED before this code is considered ready to merge.\r\n\r\nFixes:\r\n• Now uses `zigbee.getEvent` to handle the parsing of humidity reports, which resolves Issue #73\r\n• Temperature reports are also parsed by `zigbee.getEvent`, which \"automagically\" retrieves the temperature converted into the correct value (including values below 0) in the unit (C or F) as set on the user's hub. One small downside is that `zigbee.getEvent` only produces integer values for temperature reports. This is standard practice on pretty much all other temp sensor DTHs, however. On the plus side, the `zigbee.getEvent` function call allows the DTH code to be significantly shorter.\r\n• lastCheckIn updates are no longer listed in the Events log (\"Recently\" tab of the ST mobile app) They were flooding the Events log, and 95% of the time happen at the same time as a Temp, Humidity, Pressure, or Battery report, so it's clear that the device has checked in. The Last Checkin tile will still be updated for every one of these events, however. Also if a message is received that can't be parsed, that will show up as a CheckIn event in the Events log.\r\n• Removed some superfluous `debug.log` lines\r\n• Removed unnecessary battery value parse code and fixed model name parse code in the `parseReadAttr()` function to get rid of an array error. It turns out that until the first regular battery report is sent at about 50 minutes after pairing, if the reset button is pressed, it does not send battery voltage data, but rather a short message only containing the model name: \"lumi.weather\". However, after the first regular battery report, if the reset button is pressed, the sensor sends two messages: the first is a catchall that does contain battery voltage data in addition to other data, and the second is the short message with the model name.\r\n• Moved the `preferences{}` section down to the bottom of `metadata{}`, below `tiles{}`, following the convention of the SmartThings Developer Documentation\r\n• Various small fixes and clean up of the code\r\n\r\nEnhancements\r\n• Added the code needed to display the high / low temperatures tracked by @tmleafs' code, following @ronvandegraaf's mock up in Issue #40\r\n• Reworked parts of @tmleafs' high / low temp tracking code, necessary due to the above-listed fixes\r\n• Replaced @tmleafs' cron `schedule()` function method to reset the min/max temps with new code in the `dateFormat()` function that compares the day of month of the previous event with the current event being parsed. The SmartThings Developer Documentation strongly advises against using a cron schedule if it can be avoided, so since the sensor itself produces events at a maximum interval of 50 minutes (for the battery check-in), those can be used to check if it's a new day and then reset the min/max temperature values. We may also want to add a preference setting just like the one for the Changed Battery reset toggle.\r\n• Added code so that when the sensor is first paired, the Battery Changed is set to the current date\r\n• Added a bunch of relevant comments in the code to help people navigate through all its functions\r\n\r\nScreenshots (sorry it's an iPad, because it wasn't updated to the new version with the screwed-up UI):\r\n\r\n![img_0135](https://user-images.githubusercontent.com/33558908/35776470-04b35080-0952-11e8-8d38-7f1e38b00c29.PNG)\r\n\r\n![img_0136](https://user-images.githubusercontent.com/33558908/35776474-0c82b1d4-0952-11e8-86c1-fee964daa6f7.PNG)\r\n"},"comment":{"url":"https://api.github.com/repos/bspranger/Xiaomi/issues/comments/363581879","html_url":"https://github.com/bspranger/Xiaomi/pull/81#issuecomment-363581879","issue_url":"https://api.github.com/repos/bspranger/Xiaomi/issues/81","id":363581879,"user":{"login":"foz333","id":34963428,"avatar_url":"https://avatars0.githubusercontent.com/u/34963428?v=4","gravatar_id":"","url":"https://api.github.com/users/foz333","html_url":"https://github.com/foz333","followers_url":"https://api.github.com/users/foz333/followers","following_url":"https://api.github.com/users/foz333/following{/other_user}","gists_url":"https://api.github.com/users/foz333/gists{/gist_id}","starred_url":"https://api.github.com/users/foz333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foz333/subscriptions","organizations_url":"https://api.github.com/users/foz333/orgs","repos_url":"https://api.github.com/users/foz333/repos","events_url":"https://api.github.com/users/foz333/events{/privacy}","received_events_url":"https://api.github.com/users/foz333/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T22:10:03Z","updated_at":"2018-02-06T22:10:03Z","author_association":"NONE","body":"No ball... Same as above blank space. \r\nIn reply to your previous comment I paired a new aqtemp sensor and it's showing int values so assume numbers above are based on old data.\r\n\r\nNo battery on this SS as new sensor just testing the min max values. Sensor was on radiator, now in fridge.\r\n![screenshot_20180206-230831](https://user-images.githubusercontent.com/34963428/35886886-d9f7d378-0b92-11e8-99f0-27afd1449ac7.png)\r\n![screenshot_20180206-230813](https://user-images.githubusercontent.com/34963428/35886887-da286772-0b92-11e8-8d68-026cf984c684.png)\r\n\r\n"}}
{"actor":{"display_login":"foz333"}}