So basically I am trying to send notification from my Pi to my smart-phone but I am not getting the output on the phone.I want to send a notification everyday at 8oclock stating that it’s morning.Please Help.
Code:
Well, you have to do something to activate the command… button, timer, happy thoughts… something.
Probably the simple Timer Widget that sends a 1 and 0 at Start and Stop times… Assign it a vPin and then use the code I already showed, set with the same vPin (minus the V) and when the Start (1) is sent so is the notification. You could even use the Stop (0) to send a “Good Night” notification
@blynk.VIRTUAL_WRITE(vPin) // Timer Widget on vPin (NO V)
def my_write_handler(value):
if int(value) == 1:
blynk.notify('Good Morning')
else:
blynk.notify('Good Night')
The above code that you just sent,sends a good morning text once I push a Virtual pin.I don’t want to do that,I just want to send a GoodMorning at 8oclock in the morning where the user doesn’t need to push any buttons to get a notification.
Add the line, all on one line to your crontab at 8:am.
YOU’LL have to research crontab… its really easy, there are 1 billion google articles about it.
curl --header "Content-Type: application/json" --request POST --data '{"body": "google is our friend."}' http://blynk-cloud.com/<AUTH>/notify
Again… I just offered a suggestion I am sure with a little reading of the documentation you can figure out a way to use something “button like, but not a button” to trigger your actions… if only Blynk had timer widgets… perhaps if Python/RPi only had clock features… alas, if only the scarecrow had a brain…