I have met with an issue with my scheduler app, I wanted to control my relay through the server when the time is scheduled through the time picker function, however it is not turning on my relay. Is there a problem with my code ? (find attached)
what I did was to save the time to global and compare it with the timer picker hour and min and then if is true send a HTTP on to turn on my relay
It is possible to use the TimePicker to schedule re-occurring activity using Blocks.
There are multiple issues if you use Blocks.
a) Your app will only trigger an event if the app is active. App Inventor apps do not run in the background. You either need a StayAwake routine or use an extension to run the app in the background. Stay Awake block routine using a Notifier
Using either an extension or a block routine drains your device battery rapidly . These work around methods are not running the app in the Background, they force the app
screen to stay open .
b) you need a compare Block to determine when to trigger the event (remembering that will only happen when the time is reached daily. If the app is not active when that time occurs, you won't water. You need to understand Programming Your App to Make Decisions