Device state+ schedule

Hello,
Firstly, thanks to BLYNK team. Now it is very happinest to use BLYNk app. Even support “Azerbaijan” alphabet.

My question about automation :
How can i combine schedule with device state?

Example :
Pump is filling water tank by automation schedule.
Ultrasonic sensor measure level and by certain lenght it will trigger (TankLevel is on example) that tanks is full.
This state must stop schedule until the next TankLevel is off ( Below max level).

Blynk 2 /1.5.3 version / android

You can create two automations. The first will turn on the pump when the water level is less than 15% for example, and the second will turn off the pump when the tank is full.
Or you can use coding, which will give you more options.

I would also like to know, does it make a conflict when creating two automation for one virtual pin? Which will the program prefer? Is it safe?

Personally, I’d do it in the code running on your device (which is hopefully a NodeMCU or ESP32).

Use a timer to take a reading of the water level. If it’s below x level then turn on the pump, if it’s at or above y level then turn off the pump.

You could use Blynk to show the water level in the app, and manually override the logic described above if you wish.
You could also use the app to input certain parameter such as the minimum and maximum water levels in the tank (the x and y levels I mentioned) and if you wanted to take things further you could add some time information into the equation so that you don’t run the pumps at night for example.

It really depends on how complex you want the project to be, and how good your C++ coding skills are.

Pete.

No, there’s nothing wrong with that.

Yes.

Hi,
Thanks for advice.
I am facing these problems. This is artesian well pump, artesian water is cold and dirty. In order not to destroy the irrigation system and the trees, after filling tank, I wait 24 hours.
That is why schedule is important for my case.

There is such a problem with coding. For security reasons, I wrote that blynk should disable all outputs while the server is not connected and sync when the server comes back up. Therefore, if the pump turns off with the code, it will synchronize with the server and turn the pump on again.

So what exactly is your question, and why are you supplying tiny pieces of information about your project in each post, rather than explaining your project and whatever question it is that you have in your initial post?

Pete.

My question
How i can combine state and schedule automation together?
It is not obvious?

Codes not going to work.

explations only-only for you. You are always unhappy. I dont know what to do dont see your unhappy comments. I relize that, you wrote unhappy comment to everyone.

Okay, I’ll refrain from engaging with you in future.

Good luck with your project.

Pete.

Dear John,
Such an idea came to my mind, I can create two virtual pin for same pin. One of virtual pin going to work with schedule and inside code an additional state can control process. Second virtual pin can control directly without any state.

Problem solved, thanks