{"action":"created","issue":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/3051","repository_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota","labels_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/3051/labels{/name}","comments_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/3051/comments","events_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/3051/events","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/3051","id":335093193,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODk3NDI2","number":3051,"title":"APDS9960 (my second try)","user":{"login":"Staars","id":5481060,"node_id":"MDQ6VXNlcjU0ODEwNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5481060?v=4","gravatar_id":"","url":"https://api.github.com/users/Staars","html_url":"https://github.com/Staars","followers_url":"https://api.github.com/users/Staars/followers","following_url":"https://api.github.com/users/Staars/following{/other_user}","gists_url":"https://api.github.com/users/Staars/gists{/gist_id}","starred_url":"https://api.github.com/users/Staars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Staars/subscriptions","organizations_url":"https://api.github.com/users/Staars/orgs","repos_url":"https://api.github.com/users/Staars/repos","events_url":"https://api.github.com/users/Staars/events{/privacy}","received_events_url":"https://api.github.com/users/Staars/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":55,"created_at":"2018-06-23T11:35:53Z","updated_at":"2018-07-30T21:00:24Z","closed_at":"2018-06-26T15:23:45Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/pulls/3051","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/3051","diff_url":"https://github.com/arendst/Sonoff-Tasmota/pull/3051.diff","patch_url":"https://github.com/arendst/Sonoff-Tasmota/pull/3051.patch"},"body":"This driver supports the APDS9960 in TASMOTA based on the recent code base (developed on 6.0a). The code is a stripped down and slightly modified version of the driver from Shawn Hymel/Sparkfun, who did the heavy work.\r\n\r\nThe sensor supports several modes (gestures, proximity, light level with color channels) and the driver should cover most of the possibilities. In it’s current form, it is intended to be used as a „user defined driver and sensor“ according to the API. Because of the quite big code size and its somehow exotical nature it is disabled by default. \r\nYou must uncomment: #define USE_APDS9960 in one of the first lines to activate it (and to confirm, that you know, what you are doing ;). There are two (known) conflicting drivers (SHT and VEML6070) which will be deactivated including a compiler warning.\r\n\r\nConnect the wires and configure SDA and SDL for I2C in Tasmota and the sensor should start in „gesture mode“.\r\n\r\nWith „rules“ in mind the gestures generate tele-mqtt-messages with the payload in the following scheme:\r\n\r\n„APDS9960“:{„Up“:1}       for UP\r\n„APDS9960“:{„Right“:1}   for RIGHT\r\n„APDS9960“:{„Down“:1}  for DOWN\r\n„APDS9960“:{„Left“:1}     for LEFT\r\n„APDS9960“:{„Long“:1}   for LONG\r\n„APDS9960“:{„None“:1}  for NONE\r\n\r\nThese can be used for rules too:\r\nrule1 on Tele-APDS9960#Up do command endon\r\n\r\nThe LONG gesture will trigger after leaving the hand for a certain amount of time above the sensor and was initially introduced, to prevent a crash, because without it, the run loop will be blocked for ever. But it’s usable as a quite stable gesture (long press or long hold) and after it, the sensor will be switched on and off (and report this via mqtt).\r\n\r\nNONE is simply a not recognised gesture, but shows, that there is some movement in front of the sensor.\r\n\r\nWith the command GESTURE you can switch between two modes:\r\ngesture 1  -> read gestures\r\ngesture 0 -> read light level and proximity (and report as TELE-message - also usable for rules).\r\ngesture    -> get gesture mode (On or OFF, see both lines above)\r\n\r\nIn the non-gesture mode the JSON includes Red, Green, Blue and Proximity as raw sensor values (search for the data sheet of the APDS9960) and the ambient value should be Lux.\r\n\r\nPlease keep in mind, that there are hardware limits to the sensor (which is available for under 2 €) and the necessary and quite expensive computations in the run loop are fore sure not ideal for an environment like TASMOTA. \r\nSome sources in the internet suggest to use a small capacitor between VCC and Ground (I use 100µF), but maybe you come away without one.\r\n\r\nI want to thank member Renne for his valuable feedback and hope, this is useful for sombody. \r\nIf the maintainers do not intend to include this in the main project, it would be nice to get a response. In this case I will put the driver in small repository on its own.\r\n\r\nP.S.:\r\nI restart this PR because I accidentally deleted my old fork. I will close the old PR.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/comments/409008721","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/3051#issuecomment-409008721","issue_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/3051","id":409008721,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTAwODcyMQ==","user":{"login":"Staars","id":5481060,"node_id":"MDQ6VXNlcjU0ODEwNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5481060?v=4","gravatar_id":"","url":"https://api.github.com/users/Staars","html_url":"https://github.com/Staars","followers_url":"https://api.github.com/users/Staars/followers","following_url":"https://api.github.com/users/Staars/following{/other_user}","gists_url":"https://api.github.com/users/Staars/gists{/gist_id}","starred_url":"https://api.github.com/users/Staars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Staars/subscriptions","organizations_url":"https://api.github.com/users/Staars/orgs","repos_url":"https://api.github.com/users/Staars/repos","events_url":"https://api.github.com/users/Staars/events{/privacy}","received_events_url":"https://api.github.com/users/Staars/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T21:00:24Z","updated_at":"2018-07-30T21:00:24Z","author_association":"CONTRIBUTOR","body":"I guess it was LED-boost from 300 to 100. Take a look here, as it seems the sensors on the market do really differ substantially: https://github.com/sparkfun/SparkFun_APDS-9960_Sensor_Arduino_Library/issues/9\n\nTry to build the most basic example on the ESP to rule out hardware related problems.\n\nBTW, I just ordered „your“ sensor, but this will take a while.\n\n\n> Am 30.07.2018 um 22:54 schrieb Jason2866 <notifications@github.com>:\n> \n> @Staars\n> Arduino sketch is working with my sensor. Can i copy the initializing settings?\n> With which settings i can play around? What settings from your code differs to the arduinp code?\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n"}}
{"actor":{"display_login":"Staars"}}