Arduino NodeMCU AC Light Dimmer + MQTT+ Alexa | Part #2 | Tutorial # 33

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • AC Light Dimmer with Home Assistant (MQTT) & Alexa echo dot & NodeMcu
    Part 1: • NodeMcu AC Light Dimme...
    In this tutorial, we will build AC light dimmer with NodeMcu and RobotDyn Zero Crossing dimmer.
    RobotDyn Dimmer:
    Project Source Code On GitHub:
    github.com/nas...
    mqtt:
    password: "welcome"
    light:
    - platform: mqtt
    name: "Office Lights"
    state_topic: "netmedias/office lights/status"
    command_topic: "netmedias/office lights/switch"
    brightness_state_topic: 'netmedias/office lights/brightness'
    brightness_command_topic: 'netmedias/office lights/brightness/set'
    qos: 0
    optimistic: false

КОМЕНТАРІ • 134

  • @VeyrmanKatituta
    @VeyrmanKatituta 4 роки тому +2

    That's great!!! I did it!!! Thank you very much!!! I used your project to control the fan. Everything works!!! Yes!!! Respect from Russia!

    • @netmedias7657
      @netmedias7657  4 роки тому +1

      Thank you for your valuable feedback.

  • @tomasind6840
    @tomasind6840 5 років тому +2

    It would be great if you could connect the buttons for dimming. Good job :)

  • @aniketkumthekar5088
    @aniketkumthekar5088 5 років тому +2

    Sir can u show on Google assistant

  • @ClarkKent-ls6ic
    @ClarkKent-ls6ic 4 роки тому

    Hi i get the following error please guide
    Connecting to WiFi
    Connecting.....
    Connected to Home Prime
    IP address: 192.168.0.8
    INFO: Turn light off...
    INFO: Attempting MQTT connection...
    ERROR: failed, rc=-2DEBUG: try again in 5 seconds
    INFO: Attempting MQTT connection...
    ERROR: failed, rc=-2DEBUG: try again in 5 seconds
    INFO: Attempting MQTT connection...

  • @razidaufaa9626
    @razidaufaa9626 2 місяці тому

    Excusme Sir, i am sorry, i done compile my program, but error = exit status 1
    ets_sys.h: No such file or directory
    do you can help me sir? thanks

  • @JuanPabloCook
    @JuanPabloCook 5 років тому +1

    Can I make this to use an AC 220v ceiling fan?

  • @nandaeko89
    @nandaeko89 2 роки тому

    sorry, i want to ask something, why my dimmer module cannot control lamp brightness? please help. thank you

  • @paslertomas
    @paslertomas 5 років тому +1

    Hello, I like this project a lot, i have a few questions on you about. Is it possible to use D1mini board instead of nodemcu? Is it possible to add a external button (mechanical push button attached to board) for turn on/off output? I am using HA with mqqt broker installed on it, and using tasmota on my mqqt devices. But tasmota doesn't allow to use dimmer like this. So i found your awesome project. But i am not so well in coding sketch like this. I think it should work, but D1mini has different pins, so.
    I am looking for your answer. Keep up doing things like this. It is awesome :)

    • @netmedias7657
      @netmedias7657  5 років тому

      Yes, you can use Wemos d1 mini and use it as 3-way switch. You will need to do current sensing and modify the code to handle it. I will be doing a tutorial on it soon. In meanwhile you can check out my 3-Way switch tutorials. Good Luck.
      ua-cam.com/video/5SgB6wzgxY0/v-deo.html
      ua-cam.com/video/QaY5m5RmB7M/v-deo.html
      ua-cam.com/video/_jeQWu23xqs/v-deo.html

    • @jakubgorski8196
      @jakubgorski8196 4 роки тому

      Hi, do you modified the code to the button? Is it working? Because I got problems with it. Can you please share your code?

  • @rumitshah7136
    @rumitshah7136 2 роки тому

    Hey can you make a video of how to Dc Light Dimmer with alexa.

  • @thetechrumble6596
    @thetechrumble6596 4 роки тому

    Pleas help me by using above circuit i can control my ceiling fan it worked but it gives humming sound/ noise at low speed and as soon as i increase the speed upto 75% humming sound goes off but it stuck on that speed and circuit lost the control over speed in order to control speed again i need to switch off the circuit ... humming sound will not apper on low and high speeds ....please help
    P.S. Light dimming through above circuit works perfectly

  • @gastonche1
    @gastonche1 5 років тому

    hello Netmedia
    s
    Can you help me with the sketch? I have a wemos d1 mini, I modify the ssid and the password but I can't connect to the Wi-Fi, I have the following error: "Cannot connect to WiFi. Please check data and reset the ESP.
    "

  • @animusdsouza9718
    @animusdsouza9718 5 років тому +1

    So you're using pwm to control the brightness, so as it is esp8266 only one device could be dimmed , right ?

    • @netmedias7657
      @netmedias7657  5 років тому

      temporary account1 I am planning to do a video with multiple dimmers. Please stay tuned.

    • @animusdsouza9718
      @animusdsouza9718 5 років тому

      @@netmedias7657
      Are you going to use ZCD ( zero cross detection ) and triacs for dimming, cause there's some flickering issue there, however it can be rectified, perhaps using proper edge detection or something ( I don't remember correctly ).
      Do let me know your approach , may be it might help me too ( cause I've been working on it for some time now )

    • @netmedias7657
      @netmedias7657  5 років тому +1

      temporary account1 I am not seeing any flickering issue may be because I am using led lights. I let you know if have a similar issue.

    • @animusdsouza9718
      @animusdsouza9718 5 років тому

      Sure @@netmedias7657

  • @kalh53
    @kalh53 2 роки тому

    Sir, on google assistant please!

  • @DanangWidiantoro
    @DanangWidiantoro Рік тому

    my alexa getting crazy

  • @Zerous_12
    @Zerous_12 5 років тому +2

    can be configured to work with a motion sensor and a switch for bathrooms?

    • @netmedias7657
      @netmedias7657  5 років тому

      Richard Mequert Yes, It requires a small change in code and sensor. I will try to add it to the future tutorial.

    • @Zerous_12
      @Zerous_12 5 років тому

      @@netmedias7657 I look forward to it, and keep it up!
      Thanks to you I was able to automate the whole room and part of the house with ALEXA, now I am focusing on the reinforcement of the security of the network to counteract any possible infiltration, I know that it is paranoid but it is not too much to be prepared.

    • @netmedias7657
      @netmedias7657  5 років тому +2

      Richard Mequert you are right to be concern about the security of your network. It does not matter how secure your network is there is always a chance that it is hackable by hackers but you should not worry since we are at bottom of the hackers list.😄
      I am planning to start making my projects secure by using SSL and fingerprinting methods. So stay tuned. Thank you for your valuable feedback and good luck with your projects.

  • @ptaudio
    @ptaudio 4 роки тому

    can this also work with domoticz and google home ?

  • @yudistra5455
    @yudistra5455 3 роки тому

    this IP address static or not?

  • @bhutchins1991
    @bhutchins1991 5 років тому

    I’ve been trying to figure something out with no luck. I have the dimmer as well as the new 4 channel version
    robotdyn.com/ac-light-dimmer-module-4-channel-3-3v-5v-logic-ac-50-60hz-220v-110v.html
    I would also like to add manual dimmers or a 2way rocker switch, any ideas how I would do this?!
    Thanks so much

  • @modicon1108
    @modicon1108 5 років тому

    Hi and thanks for the Video @netmedias.
    I am trying to use this with Blynk and Alexa so I don't require any MQTT support, but I am having trouble figuring out what support libraries need to be downloaded from github.
    For example, where do I find the "hw_timer.h" library? How do I install the whole library package?
    Thanks for any help you can give.

  • @vigneshbalram7930
    @vigneshbalram7930 4 роки тому

    once i configured in the the yaml file i am getting the below issue. please help me out
    The following integrations and platforms could not be set up:
    mqtt
    mqtt.light
    Please check your config.

    • @netmedias7657
      @netmedias7657  4 роки тому

      Looks like your config file is not formatted correctly. Please verify.

  • @vishalchauhan8735
    @vishalchauhan8735 5 років тому

    Hi.
    Thanks for this video
    I'm playing with HA only. It doesn't work if close serial communication from putty.

  • @sankarmondal89
    @sankarmondal89 5 років тому +3

    can you make a video on a project that is included, NodeMCU + Relay module + Robotdyn AC light dimmer + Blynk? or can I have the coding? I'm trying to make a project like that but really poor in coding. Will you please help?

  • @nomiahmad5268
    @nomiahmad5268 3 роки тому

    nice explanation, i need to ask a question where you define interupt routine in code . with interupt how can we control ac dimmer module in physical?

  • @carlborgen
    @carlborgen 5 років тому

    I see that your light has a fade between states, and I can't see that functionality in your nodemcu code, is that a feature of the espalexa?
    Since I'm trying to make a slow wake up light dimmer, I'm trying to figure out whether to put that functionality locally at the node or have it in home assistant somehow.

    • @netmedias7657
      @netmedias7657  5 років тому

      Please take a look at "robodyn_dimmer.h" file.
      byte fade = 1;

  • @thetinytrader1564
    @thetinytrader1564 5 років тому +1

    Can we also use this dimmer as a fan speed controller ?

    • @netmedias7657
      @netmedias7657  5 років тому

      Harvinder Pal Singh
      yes but you may hear humming noise on low speed.

    • @thetinytrader1564
      @thetinytrader1564 5 років тому

      @@netmedias7657 So what's the solution to that. I want to make a fan speed controller.

    • @netmedias7657
      @netmedias7657  5 років тому

      Harvinder Pal Singh Try is as is. If you hear humming noise on low speed try to add Inductor coil. It should eliminate the noise. They are not that expensive.

  • @jdrosarios
    @jdrosarios 5 років тому

    hi, finally, alexa did detect my light... maybe i gave up very soon at the first try... jejeje after 10 minutes without doing nothing , i command alexa to discover... then light was detected and now i can dimm/turn on/off via alexa. thank you Mr. Malik once again!!!!

  • @HomeAutomationTECH
    @HomeAutomationTECH 4 роки тому

    Dear sir tell me how to control ac fan speed with ir remote and arduino make videos plse

  • @anupammishra3675
    @anupammishra3675 4 роки тому

    Great tutorial. can you list all the libraries required for the sketch to compile in arduino ide?

  • @VeyrmanKatituta
    @VeyrmanKatituta 4 роки тому

    Hello friend! Please tell me! If I want to make a second such dimmer and put it on the same MQTT broker and home assistant, what do I need to change in the sketch?

    • @VeyrmanKatituta
      @VeyrmanKatituta 4 роки тому

      It's all right! Changed topiks and made a second dimmer!

  • @anokhautomation4453
    @anokhautomation4453 4 роки тому

    Nice project.

  • @MarcoAntonio-nw2dq
    @MarcoAntonio-nw2dq 5 років тому

    When installing the bulb on the ceiling of the house, does the esp8266 need to stay on 5v or will it be powered by the ac dimmer board?

    • @netmedias7657
      @netmedias7657  5 років тому

      Marco Antonio
      No. You will need to supply 5v if using NodeMcu or 3.3 to plain ESP8266.

  • @vicbcn5455
    @vicbcn5455 4 роки тому

    Nice video!! Thankyou very much!!

  • @MohamedAbdoLOS
    @MohamedAbdoLOS 3 роки тому

    Sooo coool, do you think i can attach a potentiometer to control this bulb in parallel with the hass, so what ever i do with the pot controls the hass mqtt

    • @netmedias7657
      @netmedias7657  3 роки тому +1

      Yes, you can add code in MCU

    • @MohamedAbdoLOS
      @MohamedAbdoLOS 3 роки тому

      @@netmedias7657 thank you so much, I actually tried but I don’t know where exactly to add my code

    • @MohamedAbdoLOS
      @MohamedAbdoLOS 3 роки тому

      I really would be so grateful for a help or a clue even a psudo code and where to add it

  • @ashishcchauhan
    @ashishcchauhan 5 років тому

    hello Nassir, Can I control the fan speed with this dimmer and use alexa? if NOT what can I use for that. Thank You.

    • @netmedias7657
      @netmedias7657  5 років тому

      Ashish Chauhan yes you can control fan speed. Good luck.

  • @ankitrana007
    @ankitrana007 4 роки тому

    Hi Naseer, can you do the same for 12v / 24v LED strips ?

  • @yawarsaeed6499
    @yawarsaeed6499 5 років тому

    Thanks for sharing this project.
    Do I need mqqt broker on raspberry pi as the project is based on MQTT.
    Please confirm.
    Thanks

    • @netmedias7657
      @netmedias7657  5 років тому

      Yes, You don't need to install MQTT server if you are using home assistant on pi. Any MQTT server will work. Good luck.

  • @tripleakat
    @tripleakat 5 років тому

    Yeahh.. waiting for part 3.. with 4 channel dimmer module & esp32 hardware pwm :)

  • @PaytonShao
    @PaytonShao 4 роки тому

    Can I use this to control my led ceiling light ?

  • @amird8400
    @amird8400 5 років тому

    Can I omit the home assistant part and still have alexa voice command on this project?
    Thank for the tutorial by the way

  • @yogeshitaliya473
    @yogeshitaliya473 5 років тому

    😍😍😍😍😍

  • @ANOOPKUMAR53352
    @ANOOPKUMAR53352 5 років тому

    @Netmedias Thanks for the video. what is the procedure to connect this to alexa. Can you please elobrate step wise.
    Thanks in advance

    • @netmedias7657
      @netmedias7657  5 років тому

      Once dimmer is turned on say 'Alexa, discover devices' to Echo dot or Echo.

  • @jannix861
    @jannix861 5 років тому

    Could you make a tutorial where you create an Alexa Smart Home Skill (not custom skill) with Amazon AWS and control the ESP8266 with it. You are making great tutorials and as I have looked so far there isn't a tutorial for that. (Or not a tutorial with your quality)

    • @netmedias7657
      @netmedias7657  5 років тому

      Stay tuned. It is coming out soon.

    • @michellenaficy6333
      @michellenaficy6333 5 років тому

      I would love that tutorial as well! Had my light up and running so fast with the first part of this tutorial. Thanks! @@netmedias7657

  • @HFSoluciones
    @HFSoluciones 5 років тому

    I only can turn on or off, not dimming

  • @fefeporcodiaccio
    @fefeporcodiaccio 5 років тому

    holle, really nice job! is it possible to give to nodemcu a static ip instead of dhcp?

    • @netmedias7657
      @netmedias7657  5 років тому

      Yes, Watch following tutorial. I am using static IP for this project. Code link is on GitHub. See the video description for code link.
      ua-cam.com/video/sFJE_PsUlm8/v-deo.html

  • @cyril_leonel4713
    @cyril_leonel4713 4 роки тому

    can i use this in esp32 ?

  • @yusufrizqimaulana8987
    @yusufrizqimaulana8987 5 років тому

    sir, can u make Alexa only respond to your voice?

    • @netmedias7657
      @netmedias7657  5 років тому

      It can recognize your voice and have different action executed but you cannot have it respond to a specific voice only.

  • @roystervi
    @roystervi 5 років тому

    How do you turn it on manually ? it would be great if the sketch has some more pins open like adding a dht22 sensor, a pir and a switch

    • @netmedias7657
      @netmedias7657  5 років тому

      bobby royster it is easy to add a switch but not possible to create 3 way/4 way switch.

    • @roystervi
      @roystervi 5 років тому

      and adding a pir and dht22?
      am not a code person like most, but find it hard to use a nodemcu that has 8 pins to only control one thing.
      plus in each room I like to add a light switch, a pir for motion for that room and a dht22 temp sensor to monitor the temp for that room

  • @roystervi
    @roystervi 5 років тому

    Thanks for adding mqtt to ur projects

    • @netmedias7657
      @netmedias7657  5 років тому

      bobby royster thank you for your feedback.

  • @aimanrosli2461
    @aimanrosli2461 5 років тому

    how to do that using goggle assistant,is it the same?

    • @netmedias7657
      @netmedias7657  5 років тому

      I will create a dimmer with Google soon

  • @ady8077
    @ady8077 5 років тому

    Hi, does the ESP8266 need to be powered by its usb port, or does it work off the dimmer module ?

    • @netmedias7657
      @netmedias7657  5 років тому

      Adrian Ewing You can power it from USB or VIN pin 5 volts.

    • @ady8077
      @ady8077 5 років тому

      @@netmedias7657 Can the dimmer module provide the 5 volts ?

    • @netmedias7657
      @netmedias7657  5 років тому

      No, but you can use the following power supply. HLK-PM01 AC-DC 220V to 5V Step-Down Power Supply
      www.ebay.com/itm/NEW-HLK-PM01-AC-DC-220V-to-5V-Step-Down-Power-Supply-Module-Household-Switch/191745800605?epid=1953378887&hash=item2ca4f0b99d:g:4pcAAOSwf-VWVQ1B:rk:1:pf:0

  • @theravian2010
    @theravian2010 5 років тому

    can we add some more channels in the code?

    • @netmedias7657
      @netmedias7657  5 років тому

      Sure, I will add it on next dimmer video. Stay tuned.

  • @djarieljpp
    @djarieljpp 5 років тому

    not WORKING 110AC

    • @netmedias7657
      @netmedias7657  5 років тому

      Please make using you are using the correct version (2.3.0) of esp board manager.

  • @MarcoAntonio-nw2dq
    @MarcoAntonio-nw2dq 5 років тому

    It is possible to make the connection together with a sonoff t1?

    • @netmedias7657
      @netmedias7657  5 років тому

      Do you mean control it with sonnoff only not NodeMcu? Yes it will require some soldering and custom firmware.

    • @MarcoAntonio-nw2dq
      @MarcoAntonio-nw2dq 5 років тому

      @@netmedias7657 I have the dimmable light that is now controlled by a sonoff t1 (tasmota) only the on and off function. I would like to know if I can install the nodemcu between the lamp and sonoff t1. Thanks for listening

  • @shavkats838
    @shavkats838 5 років тому

    Thanks from RobotDyn!

  • @alizafar5732
    @alizafar5732 5 років тому

    Is this same process could be done by using fan instead of light?

    • @netmedias7657
      @netmedias7657  5 років тому +1

      ali zafar It will work but may produce humming noise at low speed. I will not recommend it.

    • @alizafar5732
      @alizafar5732 5 років тому

      ​@@netmedias7657​what i have do for fan?...

    • @juergenfoterek6743
      @juergenfoterek6743 5 років тому

      @@alizafar5732 As Netmedias said , you have to change the Frequency of the PWM Signal that comes from the ESP8266 modul.
      Normaly it is set to 21 kHz, aczeptable operation range is 21 to 28 kHz. Best will be 25 kHz .Search for changing PWM Frequency on a Arduino. I can´t remember what was the correct line in the Setup Section in the Code. But it is only one C-command in Setup. Look this video it shows you what Netmedias mean with noise .
      ua-cam.com/video/AEJ8MQyEOBg/v-deo.html
      Then you have no noice when the Fan is on low speed.
      Rgds
      Juergen

  • @soovui
    @soovui 5 років тому

    Very good and interesting. How to do that in node red instead of home assistant?

    • @netmedias7657
      @netmedias7657  5 років тому +1

      soovui I will do a similar tutorial in node red once done with my current projects.

    • @soovui
      @soovui 5 років тому

      @@netmedias7657 u r the best bro...

  • @rafisheikh1141
    @rafisheikh1141 5 років тому

    hi can you add ota to the sketch so we can update over the air.
    Thanks

    • @netmedias7657
      @netmedias7657  5 років тому

      Sure, I will add it in next tutorial.

    • @rafisheikh1141
      @rafisheikh1141 5 років тому

      Netmedias when will you be doing the next tutorial?

  • @jdrosarios
    @jdrosarios 5 років тому

    what about esp8266-01?

    • @netmedias7657
      @netmedias7657  5 років тому +1

      Yes, It will work with ESP8266-01.

    • @jdrosarios
      @jdrosarios 5 років тому

      @@netmedias7657 thank you for your quick response... and now lets work on my dimmer ;) thank you for your hard work !!

    • @netmedias7657
      @netmedias7657  5 років тому

      Jose Daniel Rosario Thank you for trying this project. Please let us know of your progress. Good Luck.

  • @aimanrosli2461
    @aimanrosli2461 5 років тому

    wanna ask sir.. can i add light level sensor.. so that i can control the light precisely according to surrounding situation?

    • @netmedias7657
      @netmedias7657  5 років тому

      A EYEMAN Yes, but you will need to modify the code. It is very easy, read the light sensor and set the brightness in code.
      tarBrightness = {mapped reading from a sensor}

    • @aimanrosli2461
      @aimanrosli2461 5 років тому

      @@netmedias7657 oo i see ... btw.. is it possible? if i wanna use arduino uno, i also wanna implement iot into it using esp8266 wifi module.. it was my final year studies project...

    • @aimanrosli2461
      @aimanrosli2461 5 років тому

      my lecturer ask me to control the brightness of the lamp using triac and zero crossing detector circuit.. im a little bit lost since im an electrical student not electronic 😂😂

    • @netmedias7657
      @netmedias7657  5 років тому

      Yes, You can use UNO (use the Arduino timer) and connect it to ESP8266 for wifi. I did a tutorial on Uno wifi with NoduMcu. You can use the same code for ESP8266. ua-cam.com/video/SiU-QZwik8w/v-deo.html

    • @netmedias7657
      @netmedias7657  5 років тому +1

      This is exactly kind of circuit you need for a zero crossing detector. You can use this module it is around $3. If the requirement is to build your own then get the module and take out the parts since it will be cheaper and design your own PCB and use the parts. Also tracing the original PCB will help you with new PCB tracing or breadboard hookup. You can use the same code and your project is complete with some modification. Good Luck.

  • @rafisheikh1141
    @rafisheikh1141 5 років тому

    I got it to work but it flickers a lot and it dose not dim low

    • @netmedias7657
      @netmedias7657  5 років тому

      Are you using 220v? What type of bulb?

    • @rafisheikh1141
      @rafisheikh1141 5 років тому

      I am using dimmable Led 220v 50hz

    • @rafisheikh1141
      @rafisheikh1141 5 років тому

      @@netmedias7657 i got it working with the led spot light thanks :)

    • @tomasind6840
      @tomasind6840 4 роки тому

      same for me. what is the solution?