Eventor and button state

I have Eventor set to turn on a digital pin when the temperature reaches 26C. This pin turns on a relay which is connected to a fan. I also have a button in the Blynk app connected to this digital pin that can turn the fan on or off manually. My question is when Eventor turns on this digital pin how can I get the app to update the button state to on, to reflect the state of the pin.

Dear friend,

you can use a trick like this:

digitalWrite(12,HIGH);
       Blynk.virtualWrite(V16, (digitalRead(12)));

Where 12 is digital pin 12 ( GPIO12) and is given as example.
V16 ( or whatever else you have choose ) is the virtual switch widget at Blynk application

Does the above make sense to you?

Best Regards,
Mike Kranidis

@busa that’s a bug. Will be fixed with next update. As workaround you may use @mikekgr proposed solution.

Thanks @mikekgr, @Dmitriy, will wait for the next update. :slight_smile:

@Dmitriy, thanks for the update. It solved my problem without having to change any of my code. :relaxed:

@Dmitriy
Only seems to work properly while Blynk is open. If my phone goes into standby it doesn’t work. Have just checked with the App open on my phone. Eventor switched off the fan and the button went to the off state as it should. Shortly after my phone went into standby and when I bought it out of standby the button went to the on state again even though the fan had switched off and remained off. At other times when the phone is in standby and Eventor switches the fan on or off the button will not change state. Hope this is explained properly.
Regards

@busa yeap. it is clear. thank you. In fact this issue is already fixed and will be deployed today.

@Dmitriy Good work. You guys sure get on top of things quickly. Thanks for all the great work you are all doing, it is a fantastic app and I am having heaps of fun with it :grin:

1 Like