{"id":383,"date":"2018-04-10T13:25:36","date_gmt":"2018-04-10T17:25:36","guid":{"rendered":"http:\/\/www.thesmarthomehookup.com\/test_install\/?p=383"},"modified":"2023-02-08T17:21:35","modified_gmt":"2023-02-08T22:21:35","slug":"hidden-features-in-the-ultimate-5-smart-home-switch","status":"publish","type":"post","link":"http:\/\/www.thesmarthomehookup.com\/test_install\/hidden-features-in-the-ultimate-5-smart-home-switch\/","title":{"rendered":"Hidden Features in the Ultimate $5 Smart Home Switch"},"content":{"rendered":"<p><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/OHANkpE7s4A\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen=\"\"><\/iframe><\/p>\n<p><strong>Multipurpose Tasmota Sonoffs<\/strong><\/p>\n<p>Today on the hookup we\u2019re going to learn how to use some hidden functionality on &nbsp;everyone\u2019s favorite $5 smart switch, the sonoff basic with tasmota.<\/p>\n<p>First let me start by saying this is not going to be a video about setting up tasmota for the first time.&nbsp; If you\u2019ve never used a sonoff with tasmota before I highly recommend you check out Dr. Zzzs videos on the subject, he\u2019s got everything you need to get started including wiring, programming, and even a little bit on safety.<\/p>\n<p>Come to think of it\u2026 I hope I\u2019m not stepping on his toes by doing a Tasmota video, I know it\u2019s kinda his thing.<\/p>\n<p>Anyways, lets check out some advanced functionality that you may not be aware of.<\/p>\n<p>The first feature you may not be using is the LED built into the sonoff basic.&nbsp; By default this light turns on and off based on whether the relay is engaged, but it can be controlled separately via it\u2019s own MQTT command, which means you can use it as an indicator for anything connected to your smart home.&nbsp; In my house this light switch by the main entry hall lights up when the exterior alarms are active, and this light switch by the door into the garage lights up as a visual indicator that the garage door has been left open.<\/p>\n<p>In order to use your sonoff LED as an indicator light you\u2019ll need to first unlink it from the relay state.&nbsp; The command to do this in the tasmota console is LedState (space) 0.&nbsp; After you have unlinked the LED from the relay state, controlling the onboard LED is as simple as sending an MQTT message to topic cmnd\/[ and then the name of name of your sonoff]\/LedPower with a payload of either 1 for on, or zero for off.&nbsp; In NodeRED I have an events state node with the entity ID for the garage door, a function node that turns the on and off payloads into 1s and 0s, and an MQTT publish topic to the topic cmnd\/Garage_Entry\/LedPower.<\/p>\n<p>I designed 3D printed decora switch plates for the push buttons that operate the sonoffs.&nbsp; For the plate that has the alarm indicator I printed a special switch plate at 95% infill that has a thinner silhouette of an alarm bell included in it, this allows the light to shine through the alarm icon, but not through the rest of the switch panel giving it a nice effect.<\/p>\n<p>If you don\u2019t have access to a 3d printer you can also buy these metal decora blanks from lowes and drill out a hole for the button.&nbsp; After you\u2019ve got a hole for the button you can drill a smaller hole underneath it to act as your indicator LED.&nbsp; I bought some f these plastic earring backers to defuse the light and give it a more finished look than just a hole.<\/p>\n<p>A side note on this:&nbsp; Amazon is amazing for so many products but switch plates and blanks are an exception.&nbsp; You\u2019ll pay at least twice as much on amazon as you would just going to Lowes or Home Depot.&nbsp; Moving on!<\/p>\n<p>The second feature you may not know about is the ability to send both a short press and a long press command with your sonoff buttons.&nbsp; Normally I have my short button press tied to whatever switch I replaced with the sonoff, but by utilizing the hold functionality I can activate any of my switches, automations or scripts from home assistant.&nbsp; For instance, I am almost always the last person awake in my house and it\u2019s my job to make sure all the lights are off, the doors are locked, and the alarm is on.&nbsp; I\u2019ve created a flow in node red that turns does all of this stuff at once, and I\u2019ve set the trigger for this action to be the message&nbsp; \u201cHOLD\u201d on the topic cmnd\/uplights\/POWER, which is the topic of the sonoff that is closest to my desk.<\/p>\n<p>To set this up you\u2019ll utilize the following commands in the tasmota console:<\/p>\n<p>First you\u2019ll need to set your switchmode.&nbsp; Most people utilize switchmode 4 when using momentary push button switches, but switchmode 5 is the same as 4, but with the hold functionality enabled.<\/p>\n<p>The second thing you need to do to get the hold functionality working is to set a custom topic using switchtopic.&nbsp; If you want to keep your default switch topic just copy your default topic from one of the messages in the console and then type switchtopic (space) and then paste in your old topic name.&nbsp; Now when you short press it sends a on\/off command, and a long press sends the hold command.<\/p>\n<p>By default the hold command activates after 4 seconds, but you can change that if you\u2019d like by typing SetOption32 and then entering the hold time you want in deciseconds\u2026 in other words if you wanted to hold for 1 second you\u2019d type SetOption32 (space) 10, for 4 seconds you\u2019d type 40\u2026 you get the idea.<\/p>\n<p>Tasmota is full of other features that are just waiting to be utilized.&nbsp; Let me know down in the comments if you\u2019ve found any other hidden features that you use in automation.<\/p>\n<p>If you enjoyed this video please consider subscribing.&nbsp; As always, thanks for watching the hookup.<\/p>\n<h3>Links<\/h3>\n<p>Sonoff Basic (6 pack): <a href=\"https:\/\/amzn.to\/2vmAvBU\">https:\/\/amzn.to\/2vmAvBU<\/a><br \/>\nChrome Push Buttons: <a href=\"https:\/\/amzn.to\/2qFUbw2\">https:\/\/amzn.to\/2qFUbw2<\/a><br \/>\nEarring Backers(LED Diffusers): <a href=\"https:\/\/amzn.to\/2HcC07n\">https:\/\/amzn.to\/2HcC07n<\/a><\/p>\n<p>Node Red Function Node to Convert on\/off to 1\/0:<br \/>\n<a href=\"https:\/\/gist.github.com\/thehookup\/96a3688c655ee22a67498380abdfc3d8\">https:\/\/gist.github.com\/thehookup\/96a3688c655ee22a67498380abdfc3d8<\/a><\/p>\n<p>Decora Switch Plate .stl file:<br \/>\n<a href=\"https:\/\/www.thingiverse.com\/thing:2856891\">https:\/\/www.thingiverse.com\/thing:2856891<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Support my channel:<br \/>\nPatreon:&nbsp;<a href=\"https:\/\/www.patreon.com\/thehookup\">https:\/\/www.patreon.com\/thehookup<\/a><\/p>\n<p>music by www.bensound.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Multipurpose Tasmota Sonoffs Today on the hookup we\u2019re going to learn how to use some hidden functionality on &nbsp;everyone\u2019s favorite $5 smart switch, the sonoff basic with tasmota. First let me start by saying this is not going to be a video about setting up tasmota for the first time.&nbsp; If you\u2019ve never used a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2616,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-tutorials"],"acf":[],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":4,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":2371,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/383\/revisions\/2371"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media\/2616"}],"wp:attachment":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}