Editing SmartPlug Help File
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
− | Help file for smart plug application ( | + | Help file for smart plug application ( Ver4 ) |
Line 8: | Line 8: | ||
*Works with multiple smartplugs. | *Works with multiple smartplugs. | ||
− | *Provides on, off, timing, and energy recording functions from a graphical user interface ( gui ) | + | *Provides on, off, timing, and energy recording functions from a graphical user interface ( gui ) |
− | *Supports graphing of data | + | *Supports graphing of data. |
− | *Supports | + | *Supports csv output of data. |
*Saves data to a sql lite database that you can use any way you wish. | *Saves data to a sql lite database that you can use any way you wish. | ||
*Highly configurable. | *Highly configurable. | ||
Line 16: | Line 16: | ||
= Two Applications = | = Two Applications = | ||
− | This program is actually 2 main programs. The first program is for control of the smartplugs and capture of data, the second for the graphing and processing of the data. The main routines may be run by respectively running: smart_plug.py graph_smart_plug.py I think ( but have not tested ) they may be run at the same time. | + | This program is actually 2 main programs ( I may merge them later ). The first program is for control of the smartplugs and capture of data, the second for the graphing and processing of the data. The main routines may be run by respectively running: smart_plug.py graph_smart_plug.py I think ( but have not tested ) they may be run at the same time. |
= Download and Install = | = Download and Install = | ||
− | There is really no install program. Currently the application is intended for those who have at least a little familiarity with Python coding and can just insert the downloaded code into their development environment and run it. | + | There is really no install program. Currently the application is intended for those who have at least a little familiarity with Python coding and can just insert the downloaded code into their development environment and run it. For most of you it will not run due to dependency problems. You will need to add them. Pretty much read the error messages and install the missing code. I use Anaconda Spyder so my preferred tool is conda ( conda install pyHS100 ). If conda does not work or you do not use it use pip. pyHS100, a library for smart plugs is pretty likely to be missing ( pip install pyHS100) . Depending on your installation there may be more. |
Much of the application is configurable through the parameter.py file, but the default should give you an application that runs, including a default database. You probably will not be able to talk to your smartplugs, because the parameters do need to be told what and where ( tcpip address ) they are. | Much of the application is configurable through the parameter.py file, but the default should give you an application that runs, including a default database. You probably will not be able to talk to your smartplugs, because the parameters do need to be told what and where ( tcpip address ) they are. | ||
Line 41: | Line 41: | ||
= How To:... = | = How To:... = | ||
− | + | *Edit the parameter file: | |
+ | *View the log: | ||
+ | *Create a new empty database: | ||
+ | *Add a new device: | ||
+ | *Record data: | ||
+ | *Set a timer: | ||
+ | *See status: | ||
+ | *Make a graph: | ||
+ | *Export a csv file: | ||
+ | *Install: | ||
+ | *Debug: | ||
+ | *Change Parameters: | ||
+ | *Retrieve data from plug: On the GUI, but not implemented. | ||
+ | = How to Use the Parameter File = | ||
− | + | You need a text editor sutiable for .py files to manage the parameter file ( parameters.py ) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | You need a text editor | ||
This includes most text editors. I particularity like: | This includes most text editors. I particularity like: | ||
− | + | notepad++ | |
− | + | geany | |
− | You can also use the editor that comes in many python development environments, the | + | You can also use the editor that comes in many python development environments, the simples of |
which may be Idle. But there are many many others. If you are reading this you probably have | which may be Idle. But there are many many others. If you are reading this you probably have | ||
some experience. | some experience. | ||
− | + | A couple of gotchas to watch out for. | |
+ | * Python cares about capitalization, use the capitalization indicated in the default | ||
+ | files and the example code. | ||
+ | * Python also cares a lot about how lines are indented. Do not change the indentation from | ||
+ | the sample files, and always indent using spaces ( not tabs. most text editors will use spaces | ||
+ | automatically for .py files, even if you use the tab key ) | ||
− | + | First time editing of the parameters.py file | |
− | |||
− | |||
− | + | Use your chosen text editor to open the file parameters | |
− | + | specify in parameters.py with | |
− | + | self.ex_editor = r"D:\apps\Notepad++\notepad++.exe" # use r" or the backslashes will not work, or you can use forward slashes instead they may be wrong | |
− | + | but they work. | |
− | |||
− | |||
− | |||
− | |||
− | |||
= Working With Database Files = | = Working With Database Files = | ||
Line 135: | Line 100: | ||
see: [[SmartPlug GUI Images]] | see: [[SmartPlug GUI Images]] | ||
+ | |||
+ | = General = | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | = System Buttons = | ||
+ | |||
+ | * The edit functions work only after you have configured parameters.py for your systems text editor | ||
+ | <Edit Log> >Open the application python log file using the system editor specified in parameters.py file | ||
+ | <Edit Parms> >Open the application parameters.py file using the system editor, after the file has been modified | ||
+ | the system can be quickly restarted using the Restart button. | ||
+ | |||
+ | |||
+ | <Restart> >Quickly restarts the system after the parameters.py file is changed or any time you want to restart the system | ||
+ | from its current defaults | ||
= Debugging = | = Debugging = | ||
Line 145: | Line 126: | ||
Most issues will probably be missing libraries, parameters.py issues, or just bugs in my code (email me ). | Most issues will probably be missing libraries, parameters.py issues, or just bugs in my code (email me ). | ||
− | |||
− | |||
− | |||
− | |||
= Work Flow Overview = | = Work Flow Overview = | ||
Line 173: | Line 150: | ||
It may give you useful feedback on what the system is doing. | It may give you useful feedback on what the system is doing. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[Category:Python SmartPlug]] [[category:Python | + | [[Category:Python SmartPlug]] [[category:Python]] |