Alert Notification for sensors

I’m making an app using firebase. The app shows sensor values. I want to show the notification if any sensor value is abnormal . How can i do this ?? .Please help!

1 Like

You can use the math block with simple range of something exceeds from normal value then call an alert
Hope I helped you :ok_hand:

3 Likes

use these blocks
image

Over here i have used barometer as a sensor, you can take any sensor. Also you can replace 100 with the normal value you want to be.

Also in the notifier, instead of the above block, you can use this block,
image
(it will show alert the thing you want) the first one will show a message with a button, choose according to your wish.
Thanka and Regards,
Hope I helped

2 Likes

I am using a label in witch i put the value coming from the firebase (text) so i cant compare a text to a number

1 Like

See About firebase valuetostore - #4 by TIMAI2

2 Likes

If the value in your label is "a number" / "looks like a number" then you can compare it with a number. App Inventor takes care of that for you.

3 Likes

hmm.. :thinking: Maybe it would be easier to know about your problem if you explain your project, or give us the aia to see it ourselves.

Well, i am not sure about it, but can we do it this way-

Everyone is free to correct me if I have done a mistake, because I am quite new and I make a lot of mistakes :stuck_out_tongue_winking_eye:

EDIT- Working well for me-


Because there was no such air pressure, I used -1 instead of 100, and in that way it is showing me the message when I click the button to get the value. there is 0 written in the label because the air pressure is 0.

This might result in runtime error. You see, you have valueIfTagNotFound as a string instead of a number. By comparing a string with a number, runtime error "the operation ... cannot accept the arguments..."

3 Likes

Hmm, yes I just figured out.