Joke Collection Website - Blessing messages - How to use python to send sensor data and messages to SMS and WeChat?

How to use python to send sensor data and messages to SMS and WeChat?

This answer does not involve the selection of sensors and the use of Python calls. It is suggested to clean up Taobao or refer to other problems according to your own machine (although there is no such thing now).

Brief description:

* language: python 2.7. 1 1

* third party library: itchat

* Need equipment: equipment for collecting humidity (computer in the computer room? ), sensor, and an email address of 139 (if SMS prompt is needed).

Process:

* Identify machines and sensors.

* I learned how to get sensor data through Python through instructions (or the owner ...)

* Write a judgment statement and output a warning at the command line.

* Use WeChat tips or email tips instead of warnings.

Wechat personal number notification:

Import itchat

itchat.auto_login()

Itchat.send ('temperature warning')

The documentation for this plug-in is here: itchat.

E-mail notification:

I wrote a simple demo in master littlecodersh /easierlife github: easierlife/plugins/mailnotification.

Import email notifications from email notifications

Use MailNotification () as a message:

Mail.send_notification ("temperature warning")

SMS notification:

You can choose to use various SMS platforms, but the easiest way is to register an email address of 139, and then send an email through the above email address notification method, and you will receive the corresponding SMS prompt.