<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>[Upcycle It] WiFi Connected Smoke Detector #3: Connecting dots - MQTT + Node.js + Slack</title><link>/challenges-projects/design-challenges/upcycleit/b/blog/posts/upcycle-it-wifi-connected-smoke-detector-3-connecting-dots---mqtt-node-js-slack</link><description>&amp;lt;&amp;lt; Previous Project Index Next &amp;gt;&amp;gt; Integration Design Once sensor detects smoke, it will publish a message to MQTT topic. Then this message will be passed to a mobile application and at the same time will be converted to a command to sw...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: [Upcycle It] WiFi Connected Smoke Detector #3: Connecting dots - MQTT + Node.js + Slack</title><link>https://community.element14.com/challenges-projects/design-challenges/upcycleit/b/blog/posts/upcycle-it-wifi-connected-smoke-detector-3-connecting-dots---mqtt-node-js-slack</link><pubDate>Mon, 10 Apr 2017 10:35:02 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:1201469e-6b6a-467b-8257-4f934c758dcd</guid><dc:creator>jasonwier92</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Very good write up and thought into your topic.&amp;nbsp; I really like the idea, and I have never done this, is put in if a device type, assuming it is only doing one function.&amp;nbsp;&amp;nbsp; But in reality, the MQTT topic for each sensor inside a device and be specific to what it does.&amp;nbsp; Then in the future you can monitor based off this structure.&amp;nbsp; So your Node application, can listen for #/#/smoke/state and get state changes for all locations.&amp;nbsp; Then query a database to see what to do based off the structure of the topic.&amp;nbsp; Only suggestions I would make would be the following.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Work in a device name or indicator to the structure. I think this would be at the start of the structure, since it is the most broad level you will have.&amp;nbsp; For example, I have a light controller in my basement, well it also monitors current flow to my 80 tower, so I know when power is out to the tower.&amp;nbsp; It controls lights for several devices around my home.&amp;nbsp; So all of it&amp;#39;s MQTT topics start with rpi01/...&amp;nbsp; This way I know what device is doing what and do not need to refer to a document to find what device has that message and command.&amp;nbsp; Full example like you gave above based off an Edison with IP reservation ending in 138:&lt;br /&gt;&amp;quot;&lt;strong&gt;Eddy138/kitchen/alarm/smoke/connected&amp;quot;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;With this example a device might have several locations or might not.&amp;nbsp; Most likely it will have several functions, like sensor or alarm or power. Also several types and commands|state&lt;/li&gt;&lt;li&gt;Not really MQTT topic structure important, but it will be done via MQTT. One needs to know when sensors are not responding, so I think the best way to do that is with heartbeats being sent out on a regular basis. Last thing you want is a fire that was not detected, because a sensor has stopped working two months ago. If the Edison stops working or gets powered off, it does not send out it&amp;#39;s heartbeat and a process at central command can monitor for this heartbeat and alert you when a device is non-responsive.&amp;nbsp; Two ways to do this:&lt;ol&gt;&lt;li&gt;Every minute send out a MQTT topic of &amp;lt;devicename&amp;gt;/heartbeat with a message of &amp;quot;alive&amp;quot;&lt;/li&gt;&lt;li&gt;Have a process that responds to alive queries, like a master node that publishes &amp;lt;device&amp;gt;/query/status and the device then responds with &amp;lt;device&amp;gt;/alive with a message of &amp;quot;yes&amp;quot;, maybe also report battery level, etc.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Once again, great job on getting this started and let me know if we want to roll in a device name. &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2845&amp;AppID=147&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: [Upcycle It] WiFi Connected Smoke Detector #3: Connecting dots - MQTT + Node.js + Slack</title><link>https://community.element14.com/challenges-projects/design-challenges/upcycleit/b/blog/posts/upcycle-it-wifi-connected-smoke-detector-3-connecting-dots---mqtt-node-js-slack</link><pubDate>Sun, 09 Apr 2017 17:07:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:1201469e-6b6a-467b-8257-4f934c758dcd</guid><dc:creator>DAB</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Nice update and explanation of your planned implementation.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You have a good structure to build upon.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2845&amp;AppID=147&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: [Upcycle It] WiFi Connected Smoke Detector #3: Connecting dots - MQTT + Node.js + Slack</title><link>https://community.element14.com/challenges-projects/design-challenges/upcycleit/b/blog/posts/upcycle-it-wifi-connected-smoke-detector-3-connecting-dots---mqtt-node-js-slack</link><pubDate>Sun, 09 Apr 2017 00:03:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:1201469e-6b6a-467b-8257-4f934c758dcd</guid><dc:creator>mcb1</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Good post setting out all the options.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;On our systems we have the four states, connected, stale (not there), alarms, okay.&lt;/p&gt;&lt;p&gt;These states can be expanded to include :- local (tech working on it), bypass, on battery and quite a few others.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You may wish to ensure that the detection end will respond correctly without having to individually check each state.&lt;/p&gt;&lt;p&gt;ie when a smoke detector goes off (*/alarm/smoke/state/true), you want to shut down power on every connected device, or just the workshop.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mark&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2845&amp;AppID=147&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>