Problem with scheduling

I would like to signal this problem. When programming the timers, the program does not take into account whether the load status has changed in the meantime. For example, if a light at a certain time has to be switched off and in the meantime it has been manually switched off, the program will switch it on again.

Esp8266 dashboard web

why will it switch ON again or did you mean to switch OFF again?

the timer is programmed to turn it off. But if I turn it off first manually he does not know it and at the scheduled time it turns it off instead of doing nothing. I have already tried to set up various triggers. I state that the lights come on and off with buttons and not switches. How can I give the command: if it is already on, do nothing?

but turning it OFF again won’t cause any problem.

you can do this by comparing the state if it is ON or OFF.

no I think we understand each other. I ask the question in other words. In CAYENNE_IN how do I understand if the command comes from a button or scheduling. So I can write the code to correct the problem.

or in other words: scheduling does the opposite of the state of the load, if it is switched on, it turns it off and if it is off it turns it on

you can not differentiate whether it is from button or scheduling. there is a workaround that you can give a try.
Use two button: button A and button B. Button A is for manual turning ON/OFF while Button B is for scheduling. Then compare both the states in the code and do whatever you want.

1 Like

so if, for example, the timer is set to switch off if the load is on, it turns it off and if it is already off it does not do anything. this is the correct behavior. I can also correct it in my sketch but I need to know if the command from Cayenne comes to me from a button or scheduling. Sorry my horrible English

ok I try now let’s see what happens. Thank you

1 Like