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
That's great!!! I did it!!! Thank you very much!!! I used your project to control the fan. Everything works!!! Yes!!! Respect from Russia!
Thank you for your valuable feedback.
It would be great if you could connect the buttons for dimming. Good job :)
Sir can u show on Google assistant
Sure, Stay Tuned.
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...
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
Can I make this to use an AC 220v ceiling fan?
Yes,
sorry, i want to ask something, why my dimmer module cannot control lamp brightness? please help. thank you
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 :)
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
Hi, do you modified the code to the button? Is it working? Because I got problems with it. Can you please share your code?
Hey can you make a video of how to Dc Light Dimmer with alexa.
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
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.
"
So you're using pwm to control the brightness, so as it is esp8266 only one device could be dimmed , right ?
temporary account1 I am planning to do a video with multiple dimmers. Please stay tuned.
@@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 )
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.
Sure @@netmedias7657
Sir, on google assistant please!
my alexa getting crazy
can be configured to work with a motion sensor and a switch for bathrooms?
Richard Mequert Yes, It requires a small change in code and sensor. I will try to add it to the future tutorial.
@@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.
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.
can this also work with domoticz and google home ?
No, look at my google home video
this IP address static or not?
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
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.
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.
Looks like your config file is not formatted correctly. Please verify.
Hi.
Thanks for this video
I'm playing with HA only. It doesn't work if close serial communication from putty.
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?
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?
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.
Please take a look at "robodyn_dimmer.h" file.
byte fade = 1;
Can we also use this dimmer as a fan speed controller ?
Harvinder Pal Singh
yes but you may hear humming noise on low speed.
@@netmedias7657 So what's the solution to that. I want to make a fan speed controller.
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.
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!!!!
Thank you
Dear sir tell me how to control ac fan speed with ir remote and arduino make videos plse
Great tutorial. can you list all the libraries required for the sketch to compile in arduino ide?
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?
It's all right! Changed topiks and made a second dimmer!
Nice project.
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?
Marco Antonio
No. You will need to supply 5v if using NodeMcu or 3.3 to plain ESP8266.
Nice video!! Thankyou very much!!
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
Yes, you can add code in MCU
@@netmedias7657 thank you so much, I actually tried but I don’t know where exactly to add my code
I really would be so grateful for a help or a clue even a psudo code and where to add it
hello Nassir, Can I control the fan speed with this dimmer and use alexa? if NOT what can I use for that. Thank You.
Ashish Chauhan yes you can control fan speed. Good luck.
Hi Naseer, can you do the same for 12v / 24v LED strips ?
This circuit for AC voltage only.
Thanks for sharing this project.
Do I need mqqt broker on raspberry pi as the project is based on MQTT.
Please confirm.
Thanks
Yes, You don't need to install MQTT server if you are using home assistant on pi. Any MQTT server will work. Good luck.
Yeahh.. waiting for part 3.. with 4 channel dimmer module & esp32 hardware pwm :)
Stay tuned. Thank you
Can I use this to control my led ceiling light ?
Can I omit the home assistant part and still have alexa voice command on this project?
Thank for the tutorial by the way
Yes
😍😍😍😍😍
@Netmedias Thanks for the video. what is the procedure to connect this to alexa. Can you please elobrate step wise.
Thanks in advance
Once dimmer is turned on say 'Alexa, discover devices' to Echo dot or Echo.
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)
Stay tuned. It is coming out soon.
I would love that tutorial as well! Had my light up and running so fast with the first part of this tutorial. Thanks! @@netmedias7657
I only can turn on or off, not dimming
holle, really nice job! is it possible to give to nodemcu a static ip instead of dhcp?
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
can i use this in esp32 ?
sir, can u make Alexa only respond to your voice?
It can recognize your voice and have different action executed but you cannot have it respond to a specific voice only.
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
bobby royster it is easy to add a switch but not possible to create 3 way/4 way switch.
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
Thanks for adding mqtt to ur projects
bobby royster thank you for your feedback.
how to do that using goggle assistant,is it the same?
I will create a dimmer with Google soon
Hi, does the ESP8266 need to be powered by its usb port, or does it work off the dimmer module ?
Adrian Ewing You can power it from USB or VIN pin 5 volts.
@@netmedias7657 Can the dimmer module provide the 5 volts ?
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
can we add some more channels in the code?
Sure, I will add it on next dimmer video. Stay tuned.
not WORKING 110AC
Please make using you are using the correct version (2.3.0) of esp board manager.
It is possible to make the connection together with a sonoff t1?
Do you mean control it with sonnoff only not NodeMcu? Yes it will require some soldering and custom firmware.
@@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
Thanks from RobotDyn!
Shavkat S Thank you.
Is this same process could be done by using fan instead of light?
ali zafar It will work but may produce humming noise at low speed. I will not recommend it.
@@netmedias7657what i have do for fan?...
@@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
Very good and interesting. How to do that in node red instead of home assistant?
soovui I will do a similar tutorial in node red once done with my current projects.
@@netmedias7657 u r the best bro...
hi can you add ota to the sketch so we can update over the air.
Thanks
Sure, I will add it in next tutorial.
Netmedias when will you be doing the next tutorial?
what about esp8266-01?
Yes, It will work with ESP8266-01.
@@netmedias7657 thank you for your quick response... and now lets work on my dimmer ;) thank you for your hard work !!
Jose Daniel Rosario Thank you for trying this project. Please let us know of your progress. Good Luck.
wanna ask sir.. can i add light level sensor.. so that i can control the light precisely according to surrounding situation?
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}
@@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...
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 😂😂
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
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.
I got it to work but it flickers a lot and it dose not dim low
Are you using 220v? What type of bulb?
I am using dimmable Led 220v 50hz
@@netmedias7657 i got it working with the led spot light thanks :)
same for me. what is the solution?