Shelly1 controlled by blynk

Hi Community,

i want to know if someone has experience with Shelly 1. Is it possible to flash this type and control then with the blynk app?

Thanks

Yes, it’s certainly possible.

I use Blynk in a different way to most people, so I don’t have any code that I could share with you (and my Shelly 1 is in a different country right now so I can’t test any generic Blynk code).

My testing/research with the Shelly1 showed the following…

The relay is attached to GPIO4. Pulling GPIO4 HIGH turns the load On, and LOW turns the load Off.

If you want to use a physical switch with the Shelly1 then the switch is connected between the SW contact and the contact labelled L(-). When the switch is on (the contacts are shorted together) then this pulls GPIO5 LOW, otherwise GPIO5 is HIGH.

There are two ways to approach the addition of a physical switch, one is to use a momentary push button and the other is to to use a latching switch. Because of the physical format of the Shelly1 it lends itself to being embedded in a wall behind a light switch, so it may be used with the original light switch to turn it into a smart switch. Obviously this approach requires the existing mains power to be disconnected from the original switch before wiring it across the Shelly1’s contacts.

The Shelly1 requires either a mains or 12v supply (depending on the position of the jumper) and most European wiring doesn’t have a Neutral wire available in wall mounted light switches (the light switch is used to switch the Line only). In this scenario you’d need to either run a Neutral wire to the Shelly1, or take a different approach to the wiring (which I’m not going to go into here).

The important thing I found when working with an external switch in the Shelly1 is that you can’t use interrupts. I’m not exactly sure why this is, but I think there is some additional circuitry which enables a long press on the physical button to carry-out an additional function when using the original firmware.Interrupts work when a short press on a physical button is used, but a latching switch, or a long press on a non-latching button will produce undesired interrupt triggers.
I’ve found that the best approach is to poll GPIO5 every 100ms and use a flag to store the previous state of the button and take action of the state has changed.

Of course if you just want to use it as a remote relay with no physical switch then life is much simpler.

Hope this helps.

Pete.