AC Dimmer control using google assistance and alexa to with the help of IFTTT

Sir,
How to use SPIFFS to store the state of blynk outval.

Google is your friend!

Pete.

Just put this line in void loop and enjoy

dimmer.setPower(50)

When you restart or power will on your dimmr will start at 50% :wink:

Thanks me later :slightly_smiling_face:

Well, putting that in the void loop would mean that the brightness would be reset to 50% every time the void loop was processed (which is hundreds of time per second) so you’d lose all control of the dimmer from the app.

Putting it into void setup would be a more sensible approach, but again somewhat flawed. You may not want a light to turn on at 50% brightness whenever the MCU chooses to reboot, and this could be annoying in some situations, such as a light in a bedroom which would suddenly go to 50% brightness in the middle of the night. It could also result in considerable unwanted energy usage if the ESP32 starts while you’re away and goes undetected for some time. As there is no synchronisation to reflect the 50% setting back to the app, checking the app would not alert the user to the issue.

As the sketch uses the blocking Blynk.begin command, the light would turn on to 50% brightness and remain there until a WiFi connection is established and then a connection to the Blynk server is established. If this is impossible then the light would be on at 50% brightness permanently, until this issue is resolved. Given that the Blynk cloud servers used for Blynk 0.1 (which this sketch uses) will be decommissioned fairly soon (maybe as early as 5-6 months time), it will soon be impossible to contact the Blynk server and the light will be stuck at 50% brightness permanently.

I suspect that @Rizwan_Saeed’s desire to store the last brightness setting in NVR is because he thinks that this will give some additional usability in offline mode, but the use of the blocking Blynk.begin function makes it unlikely that this will work as anticipated, although it depends on how its implemented.

The symptom of

would be solved by my BLYNK_CONNECTED / Blynk.syncVirtual solution.

If he’s trying to solve a different or additional issue then explaining that in detail would be a good starting point.

Pete.

Thanks Pete and Yogendraj for suggestion,

The first issue is that my dimmer light bulb start flickering when the MCU is reboot unless i change the value from blynk, If i use this line
dimmer.setPower(50)
then as Pete Sir said this could be annoying in some situations, such as a light in a bedroom which would suddenly go to 50% brightness in the middle of the night
First i want to stop dimmer light flickering when MCU reboot before BLYNK_CONNECTED / Blynk.syncVirtual.

Can we store its state using writing EEPROM/SPIFFS memory and after reboot restore state using reading EEPROM/SPIFFS memory.

TBH, the period between boot-up and BLYNK_CONNECTED executing isn’t that long.

I think you should be more concerned about converting the project to Blynk 2.0 than anything else.

Pete.

Sir Blynk older version will also keep working or will it stop after sometime.

Pete.

Thanks Pete for the info.

Hi Rizwan_Saeed, so have you tried this project on new blynk version ?

Today I am trying this project on new blynk app 2.0 /esp32/

And I am facing same issue dimming value doesn’t work or we can say our map doesn’t work right now

Hi Yogendraj,

I haven’t started working on blynk new version yet. If i do i will update.

1 Like

Ok see you soon buddy

Finally I completed this project with new blynk app 2.0

4 channel relaye ON/OFF
1 Fan Speed using Rbdimeer

We can control this project using mobile app, web desk and manual control with live feedback

Yes you are thinking right we can control Rbdimeer using manual push button, up and down in 5 steps completely off and completely 100%

And best part of this synchronise with slider.

Ahhh, waiting for alexa and Google without having third party

You’ll obviously need a Plus or PRO subscription for that to work.

Pete.

1 Like

Dear sir , I just want to know how it will work with alexa or Google?

Like sinric or sinric pro, bcz thay have skills Google and alexa.

Blynk have skills for Google and alexa?

I have no idea.
You should ask Blynk.

Pete.

1 Like

On blynk io portal show it will come in July months. Let’s waiting for it.

But still remaining few for things in this project

  • Ir control

And most important thing last state remember using eeprom

Let’s working on it

Project updates
we can control all the features with remote also

1 Like

Dear Yogendraj,

Can you share the dimmer code with manual control.

Thanks in advanced

Dear Yogendraj,

Can you share the dimmer code with manual control.

Thanks in advanced