BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk.notify() not working in raspberry pi-python

rpi

#1

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:

import BlynkLib
import time

BLYNK_AUTH = 'YourAuthToken'

# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
blynk.notify('Goodmorning.')
blynk.run()

#2

Notifications work for me in Python… do you have the Notification widget placed in your project?

@blynk.VIRTUAL_WRITE(3)  // Button on V3
def my_write_handler(value):
    if int(value) == 1:
        blynk.notify('Button Pressed')

image


#3

I don’t want to keep any buttons.I just want to send a simple notification saying goodmorning.


#4

Silly… you don’t have to do as I did… I just grabbed a sample from my project to show it works and how I call it.

So… do you or do you not have the widget in your project?


#5

I have just a notification as a widget on my blynk app,and with the code I had sent above,I am not getting the notification.Please help.


#6

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 :sleeping:

@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')