$6 MQTT Push Button for Sonoff Devices and Home Assistant

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ค. 2024
  • Looking to control your Sonoff devices with something else other than your phone or Alexa? Look no further! This device only costs $6 to make!
    New Software for Button: • $6 Wifi Pushbutton mee...
    RAW OLD CODE:
    github.com/davolesh/mqtt_push...
    Amazon Affiliate Links:
    Sonoff Basic R2: amzn.to/2n7GN5i
    USB to Serial Adapter: amzn.to/2oQlu8L
    Wemos D1 Mini: amzn.to/33CdZBv
    Arcade Pushbutton: amzn.to/31i2NYS
    Blank Plate: amzn.to/2nhhQ7l
    Music:
    Bensound - Creative Minds
    Purple Planet Music - Moment of Inspiration
    Filmstro - Puma
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 55

  • @kimhawkk9544
    @kimhawkk9544 5 ปีที่แล้ว +2

    Very helpful work! and volume up plz.

  • @TerraMagnus
    @TerraMagnus 4 ปีที่แล้ว +1

    Very cool project and nice walk-through.

  • @johnm4962
    @johnm4962 2 ปีที่แล้ว +1

    I really liked this video. Opened my eyes to the fact that all does not need to be programmed via esp home. Thanks hope to watch more great content!

    • @DaveOTech
      @DaveOTech  2 ปีที่แล้ว

      Thanks! I never really jumped on the the ESP Home train....I've always enjoyed the simplicity of Tasmota. Glad you enjoyed!

  • @Sine1040
    @Sine1040 4 ปีที่แล้ว +2

    Top tip: Get yourself a step drill bit. Even the cheap ones from ali make it very easy and quick to make large round holes for switches and the like.

  • @ForSquirel
    @ForSquirel 5 ปีที่แล้ว

    Nice work.

  • @BoneyardHauntedHouse
    @BoneyardHauntedHouse 4 ปีที่แล้ว

    Good job, enjoyEd your videos, keep um coming

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Thanks! Got a few more planned, life gets in the way sometimes :/

  • @lelandclayton5462
    @lelandclayton5462 3 ปีที่แล้ว +1

    Seems like an idea to add a switch without playing with AC Mains to add a three/four way switching. Wonder if the code can be refined to use a sleep mode and run the Switch off a 123A or a 18650 cell.
    As for the arcade button I would try a touch sensor.

    • @DaveOTech
      @DaveOTech  3 ปีที่แล้ว

      Definitely a possibility. Check out my latest video where I flash Tasmota onto the button instead of the code I used in this one. Tasmota has sleep mode functionality so it's definitely worth checking out.
      The arcade buttons really grew on me :). I like their simplistic design. The touch sensors are actually cheaper than the arcade buttons. However I have to idea how to use then or properly set them up.

  • @georgei2480
    @georgei2480 3 ปีที่แล้ว +1

    Hey
    DaveOTech. I know you made a new video where you explain how to set up Tasmota on the ESP, but I like working with raw code, I understand it better and I can do things with more confidence. Can you link to where I can find the sketch you used in this video? Thanks!

    • @DaveOTech
      @DaveOTech  3 ปีที่แล้ว

      Absolutely! I added the link to both videos, I didn't realize I removed it.

  • @composer47
    @composer47 5 ปีที่แล้ว +5

    Nice video! You forgot about the power supply in your cost. Does your spouse/gf approve of arcade buttons on the wall? You can do something similar using cheap WiFi switches ($12-16) and Tasmota firmware and you don't have to stuff a power brick in your outlet box.

    • @WhatAmIGonnaGet
      @WhatAmIGonnaGet 2 ปีที่แล้ว

      Yes. It is $3 for the wemos. $5 - $10+ for power supply.

  • @vladimirpotapov7050
    @vladimirpotapov7050 2 ปีที่แล้ว +1

    Good job, thank you! (:

  • @DirkTas
    @DirkTas 4 ปีที่แล้ว

    Very nice video
    Is it possible to have multiple switches on one d1 mini ? And how do you have to configure tasmota on a d1 mini so that it can act as a switch(or multiple switches)

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hey! I'm glad you asked! Check out my latest video. I use Tasmota on the button, and everything can be customized!

  • @StePhanMckillen
    @StePhanMckillen 5 ปีที่แล้ว +1

    Nice like it would used a esp01 tho

  • @feddejorritsma5076
    @feddejorritsma5076 2 ปีที่แล้ว +1

    Is it possible to make some sort of knob using a rotary encoder or potentiometer to control for example the brightness of a lamp?

    • @WhatAmIGonnaGet
      @WhatAmIGonnaGet 2 ปีที่แล้ว +1

      It can be done. Enough google searching and I am sure you can find a project where someone has done that.
      It is far more complicated. The led driver output has to be compatible with the Tasmoto code. Whereas, toggling a simple on off relay is basically easy and universal.
      Or just go buy a pre made smart dimmer, save yourself months of code learning, firmware burning, soldering, trial and error.

  • @consig1iere294
    @consig1iere294 4 ปีที่แล้ว +2

    Hi Dave, I'm a bit confused. How did you power the 5v Wemos? Where is the relay?

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hey, the wemos is powered by 5v usb. The relay is in the Sonoff device.

  • @cheloautomation4994
    @cheloautomation4994 5 ปีที่แล้ว +2

    How did you add the power supply inside the wall? That was genius!

  • @MrHbpatel
    @MrHbpatel 5 ปีที่แล้ว

    Q: why you have not consider sonoff basic instead of d1 mini as it has one input channel also and power supply built in.

    • @WhatAmIGonnaGet
      @WhatAmIGonnaGet 2 ปีที่แล้ว

      Good point. Between all those components it does compete for cost within dollars and dimes. The sonoff device is already tried and tested, conpared to a person's soldering, wire and software skills - more room for error when you do yourself.
      I guess if someone wanted like 10 switches, have on their private network and like tinkering, it's probably just more a fun learning exercise.

  • @domesor
    @domesor 4 ปีที่แล้ว

    Hello, beautiful project. How can I change the code for esp32? Thank you :)

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว +1

      Hey! Check out my latest video. I show how to configure the button with Tasmota.
      If you install tasmota on to you esp32, then this will work! :)

    • @waynejones3160
      @waynejones3160 4 ปีที่แล้ว

      @@DaveOTech your link to the video says its private and wont play.

  • @andassys
    @andassys 4 ปีที่แล้ว

    hello, excellent video!
    I need help, my mqtt server requires login and password, as I implement this request in the code.
    thanks

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Thanks, glad you enjoyed!
      I updated the code to include an MQTT user/pass section. Please see lines 19-21 and 59-60.
      I actually have this button working through Tasmota now, with both short and long presses controlling 2 lights! I will be making a video on this as well.
      If you encounter any problems, please let me know.

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hey, check out my latest video. I use Tasmota on the button, and everything can be customized!

  • @SmuuS
    @SmuuS 4 ปีที่แล้ว

    Hi man loved the video! , but i have a issue with the code. On my local Mqtt-Broker ( HA addon) i use a username and password, and i can't get it to work i only get " failed, rc=-2 try again in 5 seconds
    " can you point me in the right direction where i can get it to work. have trying for 2 weeks and starting to give up. if i use ur code and a public broker that dont use a password it works fine but my local with a password, no luck!
    Have a nice day and keep up the good work! :D

    • @SmuuS
      @SmuuS 4 ปีที่แล้ว

      looks like these guys have about the same problem i have, but nobody seem to solve it :(
      github.com/knolleary/pubsubclient/issues/203

  • @davidmalawey
    @davidmalawey 4 ปีที่แล้ว

    How do you hook up the board to the PC for programming?

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      The wemos d1 mini has a micro USB port on it

  • @evertonterra9880
    @evertonterra9880 4 ปีที่แล้ว

    hello I really liked the automation but I could not make it work with my broker that is authenticated, even uncommenting the line and used the options to authenticate the error in the code, would be possible to put this file with the broker method with authentication? Thank you very much in advance

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hey, check out my latest video. I use Tasmota on the button, you no longer have to deal with this code :).

  • @SLindberg
    @SLindberg 4 ปีที่แล้ว

    How to add deep sleep mode to your code for Battery use?

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hey, check out my latest video. I use Tasmota on the button. I believe Tasmota has deep sleep options.

  • @AbdoTechChannel
    @AbdoTechChannel 3 ปีที่แล้ว

    Can it be used with IFTTT ??

    • @DaveOTech
      @DaveOTech  3 ปีที่แล้ว +1

      Yes, if you use it with home assistant. Home assistant has support for IFTTT.

    • @AbdoTechChannel
      @AbdoTechChannel 3 ปีที่แล้ว

      @@DaveOTech I wanna use it in my car which has an Android 10 Stereo so how can I make it work?

    • @DaveOTech
      @DaveOTech  3 ปีที่แล้ว

      You can use the Arduino IDE, and manually program the button press to emulate some kind of keyboard button press.
      www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardpress/
      Then you could use a remapper program in your Android 10 Stereo to make it do whatever you want.
      play.google.com/store/apps/details?id=com.irishin.buttonsremapper
      I did something like this in the past, so it should theoretically work, but is kinda messy.

    • @AbdoTechChannel
      @AbdoTechChannel 3 ปีที่แล้ว

      @@DaveOTech Yeah that's a great idea. I would appreciate it if you made a video showing us how. I'm sure the rest of the subscribers in the channel will enjoy this video as well as new subscribers you can target from the cars tech niche. What do you think?

  • @coedshowers
    @coedshowers 2 ปีที่แล้ว

    use a step bit

    • @DaveOTech
      @DaveOTech  2 ปีที่แล้ว

      I have gotten one since then, big difference!

  • @autoworkscorp
    @autoworkscorp 4 ปีที่แล้ว

    Hi,
    Would you be interested in selling me one please?

    • @DaveOTech
      @DaveOTech  4 ปีที่แล้ว

      Hi, please email me at daveotech@gmail.com

    • @mickwhelan1022
      @mickwhelan1022 4 ปีที่แล้ว +1

      @@DaveOTech Dear God don't start selling this. When some idiot fries himself or burns his house down, you'll be liable. (FWIW, I'm also not a lawyer) Seriously Dave, for your own good, don't do it. I'm not kidding. You described every step pretty well. If this person can't figure out this simple of a project, he has no business mucking around inside his walls.

    • @benjaminlately
      @benjaminlately 3 ปีที่แล้ว

      I second the don't sell this idea. If you know what you are doing it's probably OK, but there is a lot of opportunity to short things doing this.