Time picker scheduler

Hi guys!

I am trying out the time picker function but

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

(ps: can someone guide me if there is a need for me to store my scheduled time in some storage too?)

Thank you guys in advance!

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

or use Taifun’s Tools Extension: https://puravidaapps.com/tools.php

[

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. :cry: You need to understand Programming Your App to Make Decisions

The actual code to do all this will be complex. Perhaps someone will post an example. This might help File component issue (Using Bluetooth, TinyDB to control a Plant watering system) - #36 by jwilliams10026

A 'better' solution to turn something on/off might be to use an extension. This is a paid extension. There might be a free one somewhere How do I go about making a timer/notification event fire from a user-selected time?

Yes. Use a TinyDB.

1 Like