{"action":"created","comment":{"url":"https://api.github.com/repos/witheve/Eve/pulls/comments/87907942","pull_request_review_id":8500196,"id":87907942,"diff_hunk":"@@ -0,0 +1,40 @@\n+\n+# MQTT\n+## Temperature\n+From mqtt://mqtt.bitraf.no see http://iot.bitraf.no\n+### Define the sensors\n+```eve\n+commit @shared\n+  [#bitraf #temperature name: \"lab\" topic: \"bitraf/temperature/1\"]\n+  [#bitraf #temperature name: \"office\" topic: \"bitraf/temperature/2/value\"]\n+  [#bitraf #temperature name: \"outside\" topic: \"bitraf/temperature/3/value\"]\n+```\n+### Show latest sensor values\n+```eve\n+search @shared\n+  sensor = [#bitraf #temperature name topic]\n+search @mqtt\n+  message = [#message #incoming topic: topic, payload]\n+  sort[value: payload, per: topic] = 1","path":"examples/mqtt_temperature.eve","position":18,"original_position":18,"commit_id":"38e5fbd1d0511c758b0e35c357e1fa4598452948","original_commit_id":"38e5fbd1d0511c758b0e35c357e1fa4598452948","user":{"login":"convolvatron","id":1807982,"avatar_url":"https://avatars.githubusercontent.com/u/1807982?v=3","gravatar_id":"","url":"https://api.github.com/users/convolvatron","html_url":"https://github.com/convolvatron","followers_url":"https://api.github.com/users/convolvatron/followers","following_url":"https://api.github.com/users/convolvatron/following{/other_user}","gists_url":"https://api.github.com/users/convolvatron/gists{/gist_id}","starred_url":"https://api.github.com/users/convolvatron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/convolvatron/subscriptions","organizations_url":"https://api.github.com/users/convolvatron/orgs","repos_url":"https://api.github.com/users/convolvatron/repos","events_url":"https://api.github.com/users/convolvatron/events{/privacy}","received_events_url":"https://api.github.com/users/convolvatron/received_events","type":"User","site_admin":false},"body":"what is the intent here? does the payload for each topic contain historical samples that you\r\nwant to throw away?","created_at":"2016-11-14T22:29:15Z","updated_at":"2016-11-14T22:29:15Z","html_url":"https://github.com/witheve/Eve/pull/548#discussion_r87907942","pull_request_url":"https://api.github.com/repos/witheve/Eve/pulls/548","_links":{"self":{"href":"https://api.github.com/repos/witheve/Eve/pulls/comments/87907942"},"html":{"href":"https://github.com/witheve/Eve/pull/548#discussion_r87907942"},"pull_request":{"href":"https://api.github.com/repos/witheve/Eve/pulls/548"}}},"pull_request":{"url":"https://api.github.com/repos/witheve/Eve/pulls/548","id":93480855,"html_url":"https://github.com/witheve/Eve/pull/548","diff_url":"https://github.com/witheve/Eve/pull/548.diff","patch_url":"https://github.com/witheve/Eve/pull/548.patch","issue_url":"https://api.github.com/repos/witheve/Eve/issues/548","number":548,"state":"open","locked":false,"title":"Proof of Concept: MQTT database/provider","user":{"login":"jonnor","id":45185,"avatar_url":"https://avatars.githubusercontent.com/u/45185?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnor","html_url":"https://github.com/jonnor","followers_url":"https://api.github.com/users/jonnor/followers","following_url":"https://api.github.com/users/jonnor/following{/other_user}","gists_url":"https://api.github.com/users/jonnor/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnor/subscriptions","organizations_url":"https://api.github.com/users/jonnor/orgs","repos_url":"https://api.github.com/users/jonnor/repos","events_url":"https://api.github.com/users/jonnor/events{/privacy}","received_events_url":"https://api.github.com/users/jonnor/received_events","type":"User","site_admin":false},"body":"NOTE: This is a quick hack, from playing with Eve and trying to apply it to embedded devices and the physical world. The code is not intended to be merged as-is, just using a PR to have the code available for the discussion. \r\n\r\n## Background\r\n[MQTT](https://en.wikipedia.org/wiki/MQTT) is a message broker protocol, commonly for connected embedded devices / IoT / \"Internet of Things\".\r\nMQTT can be supported on client-side using a WebSocket bridge. Mosquitto, one of the most common brokers, supports this out-of-the-box (behind a configuration option). Only Node.js support is implemented here, so far.\r\n\r\n## Open questions\r\n\r\n* Should it support multiple brokers. This would mean having to declare in a search which broker to use. Eg. `[#message #incoming broker: mqtt.bitraf.no topic: 'foo/somename' ]`. I'm inclined to say yes, as this makes it a generic transport, usable with 0, 1 or many brokers, with the decisions being done by the Eve programs (not the runtime).\r\n* Should it automatically add tag based on the MQTT topic name? `myorganization/temperature/office/value` adds tags `myorganization` `temperature` `office` `value`. Might be nifty, but a bit automagical. Better if done via a separate Eve block, which splits the MQTT topic path, and \"enriches\" the records with tags?\r\n* Should it automatically inject timestamps for the records? Or is this something done by Eve core?\r\n* Is the logic done by the HTTP server, where the (top-level?) key/values of a request message is split and provided as separate records, desirable?\r\n* How is error handling to be done inside a database provider?","created_at":"2016-11-13T18:08:03Z","updated_at":"2016-11-14T22:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e80dc0b2e611b520686d7200312a757699a9edad","assignee":{"login":"convolvatron","id":1807982,"avatar_url":"https://avatars.githubusercontent.com/u/1807982?v=3","gravatar_id":"","url":"https://api.github.com/users/convolvatron","html_url":"https://github.com/convolvatron","followers_url":"https://api.github.com/users/convolvatron/followers","following_url":"https://api.github.com/users/convolvatron/following{/other_user}","gists_url":"https://api.github.com/users/convolvatron/gists{/gist_id}","starred_url":"https://api.github.com/users/convolvatron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/convolvatron/subscriptions","organizations_url":"https://api.github.com/users/convolvatron/orgs","repos_url":"https://api.github.com/users/convolvatron/repos","events_url":"https://api.github.com/users/convolvatron/events{/privacy}","received_events_url":"https://api.github.com/users/convolvatron/received_events","type":"User","site_admin":false},"assignees":[{"login":"convolvatron","id":1807982,"avatar_url":"https://avatars.githubusercontent.com/u/1807982?v=3","gravatar_id":"","url":"https://api.github.com/users/convolvatron","html_url":"https://github.com/convolvatron","followers_url":"https://api.github.com/users/convolvatron/followers","following_url":"https://api.github.com/users/convolvatron/following{/other_user}","gists_url":"https://api.github.com/users/convolvatron/gists{/gist_id}","starred_url":"https://api.github.com/users/convolvatron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/convolvatron/subscriptions","organizations_url":"https://api.github.com/users/convolvatron/orgs","repos_url":"https://api.github.com/users/convolvatron/repos","events_url":"https://api.github.com/users/convolvatron/events{/privacy}","received_events_url":"https://api.github.com/users/convolvatron/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/witheve/Eve/pulls/548/commits","review_comments_url":"https://api.github.com/repos/witheve/Eve/pulls/548/comments","review_comment_url":"https://api.github.com/repos/witheve/Eve/pulls/comments{/number}","comments_url":"https://api.github.com/repos/witheve/Eve/issues/548/comments","statuses_url":"https://api.github.com/repos/witheve/Eve/statuses/38e5fbd1d0511c758b0e35c357e1fa4598452948","head":{"label":"jonnor:mqtt-provider","ref":"mqtt-provider","sha":"38e5fbd1d0511c758b0e35c357e1fa4598452948","user":{"login":"jonnor","id":45185,"avatar_url":"https://avatars.githubusercontent.com/u/45185?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnor","html_url":"https://github.com/jonnor","followers_url":"https://api.github.com/users/jonnor/followers","following_url":"https://api.github.com/users/jonnor/following{/other_user}","gists_url":"https://api.github.com/users/jonnor/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnor/subscriptions","organizations_url":"https://api.github.com/users/jonnor/orgs","repos_url":"https://api.github.com/users/jonnor/repos","events_url":"https://api.github.com/users/jonnor/events{/privacy}","received_events_url":"https://api.github.com/users/jonnor/received_events","type":"User","site_admin":false},"repo":{"id":73578590,"name":"Eve","full_name":"jonnor/Eve","owner":{"login":"jonnor","id":45185,"avatar_url":"https://avatars.githubusercontent.com/u/45185?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnor","html_url":"https://github.com/jonnor","followers_url":"https://api.github.com/users/jonnor/followers","following_url":"https://api.github.com/users/jonnor/following{/other_user}","gists_url":"https://api.github.com/users/jonnor/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnor/subscriptions","organizations_url":"https://api.github.com/users/jonnor/orgs","repos_url":"https://api.github.com/users/jonnor/repos","events_url":"https://api.github.com/users/jonnor/events{/privacy}","received_events_url":"https://api.github.com/users/jonnor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonnor/Eve","description":"Better tools for thought","fork":true,"url":"https://api.github.com/repos/jonnor/Eve","forks_url":"https://api.github.com/repos/jonnor/Eve/forks","keys_url":"https://api.github.com/repos/jonnor/Eve/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonnor/Eve/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonnor/Eve/teams","hooks_url":"https://api.github.com/repos/jonnor/Eve/hooks","issue_events_url":"https://api.github.com/repos/jonnor/Eve/issues/events{/number}","events_url":"https://api.github.com/repos/jonnor/Eve/events","assignees_url":"https://api.github.com/repos/jonnor/Eve/assignees{/user}","branches_url":"https://api.github.com/repos/jonnor/Eve/branches{/branch}","tags_url":"https://api.github.com/repos/jonnor/Eve/tags","blobs_url":"https://api.github.com/repos/jonnor/Eve/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonnor/Eve/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonnor/Eve/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonnor/Eve/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonnor/Eve/statuses/{sha}","languages_url":"https://api.github.com/repos/jonnor/Eve/languages","stargazers_url":"https://api.github.com/repos/jonnor/Eve/stargazers","contributors_url":"https://api.github.com/repos/jonnor/Eve/contributors","subscribers_url":"https://api.github.com/repos/jonnor/Eve/subscribers","subscription_url":"https://api.github.com/repos/jonnor/Eve/subscription","commits_url":"https://api.github.com/repos/jonnor/Eve/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonnor/Eve/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonnor/Eve/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonnor/Eve/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonnor/Eve/contents/{+path}","compare_url":"https://api.github.com/repos/jonnor/Eve/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonnor/Eve/merges","archive_url":"https://api.github.com/repos/jonnor/Eve/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonnor/Eve/downloads","issues_url":"https://api.github.com/repos/jonnor/Eve/issues{/number}","pulls_url":"https://api.github.com/repos/jonnor/Eve/pulls{/number}","milestones_url":"https://api.github.com/repos/jonnor/Eve/milestones{/number}","notifications_url":"https://api.github.com/repos/jonnor/Eve/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonnor/Eve/labels{/name}","releases_url":"https://api.github.com/repos/jonnor/Eve/releases{/id}","deployments_url":"https://api.github.com/repos/jonnor/Eve/deployments","created_at":"2016-11-12T21:09:26Z","updated_at":"2016-11-12T21:09:27Z","pushed_at":"2016-11-13T17:44:39Z","git_url":"git://github.com/jonnor/Eve.git","ssh_url":"git@github.com:jonnor/Eve.git","clone_url":"https://github.com/jonnor/Eve.git","svn_url":"https://github.com/jonnor/Eve","homepage":"http://witheve.com","size":10087,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"witheve:master","ref":"master","sha":"a36f6a5b5f49201a7985ab304b0b777d5515de5a","user":{"login":"witheve","id":8482359,"avatar_url":"https://avatars.githubusercontent.com/u/8482359?v=3","gravatar_id":"","url":"https://api.github.com/users/witheve","html_url":"https://github.com/witheve","followers_url":"https://api.github.com/users/witheve/followers","following_url":"https://api.github.com/users/witheve/following{/other_user}","gists_url":"https://api.github.com/users/witheve/gists{/gist_id}","starred_url":"https://api.github.com/users/witheve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witheve/subscriptions","organizations_url":"https://api.github.com/users/witheve/orgs","repos_url":"https://api.github.com/users/witheve/repos","events_url":"https://api.github.com/users/witheve/events{/privacy}","received_events_url":"https://api.github.com/users/witheve/received_events","type":"Organization","site_admin":false},"repo":{"id":12719776,"name":"Eve","full_name":"witheve/Eve","owner":{"login":"witheve","id":8482359,"avatar_url":"https://avatars.githubusercontent.com/u/8482359?v=3","gravatar_id":"","url":"https://api.github.com/users/witheve","html_url":"https://github.com/witheve","followers_url":"https://api.github.com/users/witheve/followers","following_url":"https://api.github.com/users/witheve/following{/other_user}","gists_url":"https://api.github.com/users/witheve/gists{/gist_id}","starred_url":"https://api.github.com/users/witheve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witheve/subscriptions","organizations_url":"https://api.github.com/users/witheve/orgs","repos_url":"https://api.github.com/users/witheve/repos","events_url":"https://api.github.com/users/witheve/events{/privacy}","received_events_url":"https://api.github.com/users/witheve/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/witheve/Eve","description":"Better tools for thought","fork":false,"url":"https://api.github.com/repos/witheve/Eve","forks_url":"https://api.github.com/repos/witheve/Eve/forks","keys_url":"https://api.github.com/repos/witheve/Eve/keys{/key_id}","collaborators_url":"https://api.github.com/repos/witheve/Eve/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/witheve/Eve/teams","hooks_url":"https://api.github.com/repos/witheve/Eve/hooks","issue_events_url":"https://api.github.com/repos/witheve/Eve/issues/events{/number}","events_url":"https://api.github.com/repos/witheve/Eve/events","assignees_url":"https://api.github.com/repos/witheve/Eve/assignees{/user}","branches_url":"https://api.github.com/repos/witheve/Eve/branches{/branch}","tags_url":"https://api.github.com/repos/witheve/Eve/tags","blobs_url":"https://api.github.com/repos/witheve/Eve/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/witheve/Eve/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/witheve/Eve/git/refs{/sha}","trees_url":"https://api.github.com/repos/witheve/Eve/git/trees{/sha}","statuses_url":"https://api.github.com/repos/witheve/Eve/statuses/{sha}","languages_url":"https://api.github.com/repos/witheve/Eve/languages","stargazers_url":"https://api.github.com/repos/witheve/Eve/stargazers","contributors_url":"https://api.github.com/repos/witheve/Eve/contributors","subscribers_url":"https://api.github.com/repos/witheve/Eve/subscribers","subscription_url":"https://api.github.com/repos/witheve/Eve/subscription","commits_url":"https://api.github.com/repos/witheve/Eve/commits{/sha}","git_commits_url":"https://api.github.com/repos/witheve/Eve/git/commits{/sha}","comments_url":"https://api.github.com/repos/witheve/Eve/comments{/number}","issue_comment_url":"https://api.github.com/repos/witheve/Eve/issues/comments{/number}","contents_url":"https://api.github.com/repos/witheve/Eve/contents/{+path}","compare_url":"https://api.github.com/repos/witheve/Eve/compare/{base}...{head}","merges_url":"https://api.github.com/repos/witheve/Eve/merges","archive_url":"https://api.github.com/repos/witheve/Eve/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/witheve/Eve/downloads","issues_url":"https://api.github.com/repos/witheve/Eve/issues{/number}","pulls_url":"https://api.github.com/repos/witheve/Eve/pulls{/number}","milestones_url":"https://api.github.com/repos/witheve/Eve/milestones{/number}","notifications_url":"https://api.github.com/repos/witheve/Eve/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/witheve/Eve/labels{/name}","releases_url":"https://api.github.com/repos/witheve/Eve/releases{/id}","deployments_url":"https://api.github.com/repos/witheve/Eve/deployments","created_at":"2013-09-10T03:52:06Z","updated_at":"2016-11-14T21:47:40Z","pushed_at":"2016-11-14T22:11:23Z","git_url":"git://github.com/witheve/Eve.git","ssh_url":"git@github.com:witheve/Eve.git","clone_url":"https://github.com/witheve/Eve.git","svn_url":"https://github.com/witheve/Eve","homepage":"http://witheve.com","size":65480,"stargazers_count":5358,"watchers_count":5358,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":47,"forks":194,"open_issues":47,"watchers":5358,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/witheve/Eve/pulls/548"},"html":{"href":"https://github.com/witheve/Eve/pull/548"},"issue":{"href":"https://api.github.com/repos/witheve/Eve/issues/548"},"comments":{"href":"https://api.github.com/repos/witheve/Eve/issues/548/comments"},"review_comments":{"href":"https://api.github.com/repos/witheve/Eve/pulls/548/comments"},"review_comment":{"href":"https://api.github.com/repos/witheve/Eve/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/witheve/Eve/pulls/548/commits"},"statuses":{"href":"https://api.github.com/repos/witheve/Eve/statuses/38e5fbd1d0511c758b0e35c357e1fa4598452948"}}}}
{"actor":{"display_login":"convolvatron"}}