Smoke=ttk.Button(screen, text="smoke",image=smoke_im, style = 'TButton') Lights=ttk.Button(screen, text="lights",image=light_im, style = 'TButton') Temperature=ttk.Button(screen, text="temperature",image =temp_im, style = 'TButton') Temp_im=PhotoImage(file="temperature.png") nfigure('TButton', font =('Chilanka', 12, 'bold'), foreground = 'black', background="#383838", relief=FLAT )Ĭamera=ttk.Button(screen, text="camera",image= cam_im,style = 'TButton',)Ĭace(relx=0.5, rely=0.165, anchor=CENTER) They can also be easily styled using a package of Tkinter, ttk.ĭef app(wc_msg): # takes the welcome message as inputīack = PhotoImage(file="background3.png") We can easily customize and position them. Line 18 of the code, checks the same, start is the starting time, and time.time() gives the present time.īuttons form the core of Tkinter’s functions.Line 1 imports the time module in python, it calculates the time elapsed, through which we can move on from the welcome message after some seconds.# Since the loop is exited, the present sscreen is to be destroyed If(int(time.time()-start)& amp amp amp amp gt 7): Panel1.pack(side='top', fill='both', expand='yes') # assigning dimensions to our application png format can be read using tkinter.PhotoImageīack = PhotoImage(file="background1.png") In this blog, we will go through each component of the project and code it. Here are the schematic representation and workflow of the project. Tkinter for the application, socket programming, and TCP/IP protocol for communication between the home and the user, also for transferring data, cv2 for the live feed, pickle for decoding and encoding data, RPI.GPIO for accessing the general-purpose input/output pins of the raspberry pi connected to our home and some other sensor-specific libraries for accessing them and retrieving data. It can also detect the temperature of your home, detect smoke levels in your home, and access its security cameras to show live feed.Ī home monitoring system is a pure IoT project that lets a user monitor their homes anytime, anyplace. This project uses a raspberry pi and an application to control the lights and fans of your home. The rest who stay at home might just choose to have an application that helps control their home appliances by not moving at all. You can then display the system information from the Raspberry Pi in your Home Assistant dashboard and, of course, use it in automations and scripts.Most people have day jobs, they have to leave their homes unguarded, not only prone to intrusion or theft but also cases of fire, or simply things like water and electricity wastage. If your Home Assistant has access to the same MQTT broker, it will automatically pull that data using MQTT auto-discovery. The script, which is written in Python, runs every 60 seconds and sends system information data to an MQTT broker. How the Raspberry Pi monitoring script works
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |