{ "info": { "author": "Fabian Affolter", "author_email": "fabian@affolter-engineering.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "python-mystrom |License| |PyPI|\n===================================\n\nPython API for interacting with `myStrom `_ devices.\n\nThis module is not official, developed, supported or endorsed by myStrom AG.\nFor questions and other inquiries, use the issue tracker in this repo please.\n\nWithout the support of myStrom AG it would have taken much longer to create\nthis module which is the base for the integration into\n`Home Assistant `_. myStrom AG has provided and is\nstill providing hardware, valuable feedback and advice. Their continuous\nsupport make further development of this module possible.\n\nRequirements\n------------\n\nYou need to have `Python `_ installed.\n\n- `myStrom `_ device (bulb, plug or button)\n- `requests `_\n- Network connection\n- Devices connected to your network\n\nInstallation\n------------\n\nThe package is available in the `Python Package Index `_ .\n\n.. code:: bash\n\n $ pip install python-mystrom\n\nPlug/switch\n-----------\n\nAt the moment the following endpoints are covered:\n\n- ``/report``: for getting the current state and the power consumption\n- ``/relay``: for setting the relay state\n\nYou will still be able to use your device with the smartphone application,\n``curl`` or other tools. The samples below shows how to use the switch with\n``httpie`` and ``curl`` along with ``python-mystrom``.\n\n.. code:: bash\n\n $ http http://IP_ADDRESS_PLUG/report\n HTTP/1.1 200 OK\n Content-Length: 39\n Content-Type: application/json\n Date: Mon, 15 Feb 2016 17:52:21 GMT\n\n {\n \"power\": 51.630947,\n \"relay\": true\n }\n\n.. code:: bash\n\n $ curl -X GET http://IP_ADDRESS_PLUG/relay?state=1\n\n\nBulb\n----\n\nIf the bulb is on then you should be able to retrieve the current state of\nthe bulb.\n\nBrowse to http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB or use a\ncommand-line tool.\n\n.. code:: bash\n\n $ curl -d \"color=0;0;100\" -d \"action=on\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB\n {\n\t\"5DFF7FAHZ987\": \t{\n\t\t\"on\": true,\n\t\t\"color\": \"0;0;100\",\n\t\t\"mode\": \"hsv\",\n\t\t\"ramp\": 100,\n\t\t\"notifyurl\": \"\"\n\t }\n }\n\nThe bulbs are not able to handle payload formatted as JSON. It's required to\nuse ``application/x-www-form-urlencoded``. Keep that in mind if something is\nnot working, especially around setting the color with HSV.\n\nIf you are planning to use your bulbs with `Home Assistant `_\nset the bulb to a state from `Colors` with the app or use the command below.\n\n.. code:: bash\n\n $ curl -d \"color=0;0;100\" IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB\n\n\nSet State\n`````````\nYou can set the state with a POST request and a payload.\n\n- **on**: ``curl -d \"action=on\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n- **off**: ``curl -d \"action=off\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n- **toggle**: ``$ curl -d \"action=toggle\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n\nSet Color RGB\n`````````````\nOne of the supported modes for setting the color is **RBG**.\n\n- **white**: ``$ curl -d \"color=FF000000\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n- **red**: ``$ curl -d \"color=00FF0000\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n- **green**: ``$ curl -d \"color=0000FF00\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n- **blue**: ``$ curl -d \"color=000000FF\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB``\n\nSet Color HSV (Hue, Saturation, Value)\n``````````````````````````````````````\nIt's also possible to use **HSV**.\n\n.. code:: bash\n\n $ curl -d \"color=0;0;100\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB\n\nWhile \"color=\" is composed with hue, saturation, and value.\n\nSet Mono (white)\n````````````````\nIf you only want to set the \"white\" color of the bulb, use **mono**.\n\n.. code:: bash\n\n $ curl -d \"color=10;100\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB\n\n\"color=\" contains the value for the color temperature (from 1 to 18) and the\nbrightness (from 0 to 100).\n\nDimming (ramp)\n``````````````\nAdd **ramp** and an interval to set up the transition time while changing\ncolors.\n\n.. code:: bash\n\n $ curl -d \"action=on&ramp=1000&color=00FF0000\" http://IP_ADDRESS_BULB/api/v1/device/MAC_ADDRESS_BULB\n\nThe unit of measurement for ramp is milliseconds (ms).\n\nButton\n------\nThe buttons can be set with the myStrom app or directly via HTTP requests.\n\nTo set the configuration the payload must contains the relevant details for\nthe actions:\n\n``$ curl -v -d \"single=&double=&long=&touch=\" http://IP_ADDRESS_BUTTON/api/v1/device/MAC_ADDRESS_BUTTON``\n\nAvailable actions:\n\n- **single**: Short push (approx. 1/2 seconds)\n- **double**: 2x sequential short pushes (within 2 seconds)\n- **long**: Long push (approx. 2 seconds)\n- **touch**: Touch of the button's surface (only affective for the WiFi\n Button +)\n\nThe button is set up to extend the life span of the battery as much as\npossible. This means that only within the first 3 minutes or when connected\nto an USB port/USB charger and the battery is not full, the button is able\nto receive configuration information or publish its details.\n\n``mystrom`` helper tool\n-----------------------\nThe command-line tool ``mystrom`` can help to set up the buttons and get the\ndetails from bulbs and plugs.\n\n.. code:: bash\n\n $ mystrom\n Usage: mystrom [OPTIONS] COMMAND [ARGS]...\n\n Simple command-line tool to get and set the values of a myStrom devices.\n\n This tool can set the targets of a myStrom button for the different\n available actions single, double, long and touch.\n\n Options:\n --version Show the version and exit.\n --help Show this message and exit.\n\n Commands:\n bulb Get and set details of a myStrom bulb.\n button Get and set details of a myStrom button.\n config Get and set the configuration of a myStrom...\n\n\nThe examples shows how to get the details of a given bulb.\n\n.. code:: bash\n\n $ mystrom config read\n IP address of the myStrom device: IP_ADDRESS_BULB\n MAC address of the device: MAC_ADDRESS_BULB\n Read configuration from IP_ADDRESS_BULB\n {\n 'MAC_ADDRESS_BULB':{\n 'type':'rgblamp',\n 'battery':False,\n 'reachable':True,\n 'meshroot':False,\n 'on':True,\n 'color':'191;90;14',\n 'mode':'hsv',\n 'ramp':100,\n 'power':0.953,\n 'fw_version':'2.25'\n }\n }\n\nExample usage of the module\n---------------------------\nThe sample below shows how to use this Python module.\n\n.. code:: python\n\n import pymystrom\n\n plug = pymystrom.MyStromPlug('IP_ADDRESS_PLUG')\n\n # Preserve state\n STATE_ON = plug.get_relay_state()\n\n # Switch relay on if the plug is currently off\n if not STATE_ON:\n print(\"Relay will be switched on\")\n plug.set_relay_on()\n # Wait a few seconds to get a reading of the power consumption\n print(\"Waiting for a couple of seconds...\")\n time.sleep(10)\n\n # Get the new state of the switch\n print(\"Relay state:\", plug.get_relay_state())\n print(\"Power consumption:\", plug.get_consumption())\n\n # Switch relay off if it was off.\n if not STATE_ON:\n plug.set_relay_off()\n\nExamples for the bulb can be found in the directory ``examples``.\n\nLicense\n-------\n\n``python-mystrom`` is licensed under MIT, for more details check LICENSE.\n\n.. |License| image:: https://img.shields.io/badge/License-MIT-green.svg\n :target: https://pypi.python.org/pypi/python-mystrom\n :alt: License\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/python-mystrom.svg\n :target: https://pypi.python.org/pypi/python-mystrom\n :alt: PyPI release\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fabaff/python-mystrom", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-mystrom", "package_url": "https://pypi.org/project/python-mystrom/", "platform": "", "project_url": "https://pypi.org/project/python-mystrom/", "project_urls": { "Homepage": "https://github.com/fabaff/python-mystrom" }, "release_url": "https://pypi.org/project/python-mystrom/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Python API for interacting with myStrom devices", "version": "0.5.0" }, "last_serial": 4873749, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "dcdbe66efd4839b77947425af14e8507", "sha256": "e6cebc8c5a031b633371a08cc61488754185e9f82ffd5eeea99a715b18f9d6fc" }, "downloads": -1, "filename": "python-mystrom-0.2.1.tar.gz", "has_sig": false, "md5_digest": "dcdbe66efd4839b77947425af14e8507", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2173, "upload_time": "2016-02-17T23:28:55", "url": "https://files.pythonhosted.org/packages/d8/64/e4003bbc1968daa0cb7a361e8238d8e86d0c6977b301537962d047bda797/python-mystrom-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "0ee13aa521c9cf61ce53d2d8f010a047", "sha256": "aa164f4cafbd6e1e99d5d8caa4b3b3726758a1ff3591da1dbd30eedf36106d48" }, "downloads": -1, "filename": "python-mystrom-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0ee13aa521c9cf61ce53d2d8f010a047", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2287, "upload_time": "2016-02-17T23:32:24", "url": "https://files.pythonhosted.org/packages/63/5d/478a1007e4d42f4b4936aaeba7fa975a9fa20b899df55167dcc73b1b1ba4/python-mystrom-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6f18c2fca5a9f8bcce598264477f7576", "sha256": "0f00136fb5908842d5396af513d94b0c8c4cbdac6fd16f7fb24f322843b1e33d" }, "downloads": -1, "filename": "python-mystrom-0.2.3.tar.gz", "has_sig": false, "md5_digest": "6f18c2fca5a9f8bcce598264477f7576", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2451, "upload_time": "2016-03-25T23:41:21", "url": "https://files.pythonhosted.org/packages/48/78/d95caba887a49d116b44033405672d8e96a48992214a272860caee471c1a/python-mystrom-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "63595129472e687fe411cd63c2cc8adf", "sha256": "05de3eaa6e2f75a854fc9f1dfec0cfa196fdae85116ada3e3f01c9a12463d645" }, "downloads": -1, "filename": "python-mystrom-0.2.4.tar.gz", "has_sig": false, "md5_digest": "63595129472e687fe411cd63c2cc8adf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2504, "upload_time": "2016-06-27T12:24:47", "url": "https://files.pythonhosted.org/packages/8c/57/969d5554a0e9d4f46eb13d0c683fb1f5c84eb49b80f84899e71f45d735db/python-mystrom-0.2.4.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "35c07418c7c12c89e82c8a02b69bba44", "sha256": "6decbb847de409eeb96ab4cb7105a3804c3f5d3b83cee966a7816d60fc7da515" }, "downloads": -1, "filename": "python-mystrom-0.3.1.tar.gz", "has_sig": false, "md5_digest": "35c07418c7c12c89e82c8a02b69bba44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2487, "upload_time": "2016-06-29T18:28:19", "url": "https://files.pythonhosted.org/packages/cb/7d/7075bb3ae9dbf7e0552fe38d0bc5f7c35214c7eb79ad20a8f1535c58e280/python-mystrom-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "f00231dbe4560f6acdc67ebb4d95a2b8", "sha256": "f40e43153ea23eac96e53f7656120b6b036afac60e0899649fcf0539c0e4fe28" }, "downloads": -1, "filename": "python-mystrom-0.3.2.tar.gz", "has_sig": false, "md5_digest": "f00231dbe4560f6acdc67ebb4d95a2b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2487, "upload_time": "2016-06-29T18:41:35", "url": "https://files.pythonhosted.org/packages/97/93/c8223575d30d48cc8528badf66004de91a09685b5dac069a4622a6050de7/python-mystrom-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "4e95cc2c135e1dfcb8801d5f816ec365", "sha256": "f28931ee6bec3707366abef63ca2c1a6d553f5d952481e2393e8f3c2e5c803a5" }, "downloads": -1, "filename": "python-mystrom-0.3.3.tar.gz", "has_sig": false, "md5_digest": "4e95cc2c135e1dfcb8801d5f816ec365", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2522, "upload_time": "2016-07-15T09:25:07", "url": "https://files.pythonhosted.org/packages/a0/5d/4541481c8bfd5e8ac9ed4585794d67d1187de8fd1f17831e0af1e60677b0/python-mystrom-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "e889868a9c5f1c99a6d2fce4fc74c12e", "sha256": "b7ddd1d583875fbc19a9c0cc9161d0b7744e3cbf3edf8253d3b0c7d5c31d2ca1" }, "downloads": -1, "filename": "python-mystrom-0.3.4.tar.gz", "has_sig": false, "md5_digest": "e889868a9c5f1c99a6d2fce4fc74c12e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2507, "upload_time": "2016-07-15T10:01:33", "url": "https://files.pythonhosted.org/packages/70/c3/cba223f6b925276cbcac82c014d065b91b5ce69d2fb6252b814984d67604/python-mystrom-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "047a4dc0f63163e3c1ec5120efbae2fe", "sha256": "d6cf2a170615ff98091a05350ec656fc0f5a983035a62123e714996b0063e0ef" }, "downloads": -1, "filename": "python-mystrom-0.3.5.tar.gz", "has_sig": false, "md5_digest": "047a4dc0f63163e3c1ec5120efbae2fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2521, "upload_time": "2016-07-15T14:06:06", "url": "https://files.pythonhosted.org/packages/b4/f0/900cdb3b212a13f653b0c873226216c56930dd5f7ad2e9763fcb01da3017/python-mystrom-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "b02039068f4c4b5c2ba29201aadbb941", "sha256": "01b732d222779a0f39e45720d4e757143952979c5a2d71ce00ed3bf72a8ec32d" }, "downloads": -1, "filename": "python-mystrom-0.3.6.tar.gz", "has_sig": false, "md5_digest": "b02039068f4c4b5c2ba29201aadbb941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2961, "upload_time": "2016-07-15T14:30:54", "url": "https://files.pythonhosted.org/packages/4c/0d/be83accf6308bdc1cee96b3ab592ec166c3d16fdca7f7aa313b80b11b2e3/python-mystrom-0.3.6.tar.gz" } ], "0.3.7": [ { "comment_text": "", "digests": { "md5": "bdb680e9993c9defc8867681e3742597", "sha256": "deefe29b7dd9c335ca758242c702ea033eb4daf13f8b5c8d1906fcd30524d6bc" }, "downloads": -1, "filename": "python-mystrom-0.3.7.tar.gz", "has_sig": false, "md5_digest": "bdb680e9993c9defc8867681e3742597", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4156, "upload_time": "2017-04-08T16:19:13", "url": "https://files.pythonhosted.org/packages/b8/be/5db770c4c7a57520573e77b43245898a87c757761288038bdbf4ad4e8a71/python-mystrom-0.3.7.tar.gz" } ], "0.3.8": [ { "comment_text": "", "digests": { "md5": "6f410ce01874bce31c9a3a319c4f0350", "sha256": "db2aa526a7eed2c3a7e9d14b98e0f0bdc2f4c020efb489e36bac2ec2009c9281" }, "downloads": -1, "filename": "python-mystrom-0.3.8.tar.gz", "has_sig": false, "md5_digest": "6f410ce01874bce31c9a3a319c4f0350", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4214, "upload_time": "2017-04-17T20:13:57", "url": "https://files.pythonhosted.org/packages/40/1b/38b29e5a05d22fefd86bd9825ebdaf6f50f47ae32a421195d574056cc08b/python-mystrom-0.3.8.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "bd400567db4103002719838c8dee97d5", "sha256": "2f16ddd265ea52389d1711431081accdd6f2d160b24ad45f4c0a22748f781ff9" }, "downloads": -1, "filename": "python-mystrom-0.4.0.tar.gz", "has_sig": false, "md5_digest": "bd400567db4103002719838c8dee97d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6853, "upload_time": "2018-01-23T11:34:48", "url": "https://files.pythonhosted.org/packages/38/58/3cc2028b7d473527f560fdbc319593df0263a9db77df9ef45ce389bbb002/python-mystrom-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "aa6db83536041501d2e2af17ba616da3", "sha256": "3fbf21854cc202153fc6db87efce8f119f8bb8c61419dc52b207aa62dac6d595" }, "downloads": -1, "filename": "python-mystrom-0.4.1.tar.gz", "has_sig": false, "md5_digest": "aa6db83536041501d2e2af17ba616da3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9124, "upload_time": "2018-03-27T07:51:01", "url": "https://files.pythonhosted.org/packages/c3/07/e75a18d823e225b63824989f7f108f055c37869f54a81c0b8920460150b3/python-mystrom-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "316c2cfea3bd5c58ca2f8f90bba147bc", "sha256": "b0092dc013d6bef9fb1711268d2928254305453007590dba1eba454e854b21a1" }, "downloads": -1, "filename": "python-mystrom-0.4.2.tar.gz", "has_sig": false, "md5_digest": "316c2cfea3bd5c58ca2f8f90bba147bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9143, "upload_time": "2018-03-27T07:59:00", "url": "https://files.pythonhosted.org/packages/fe/be/a9faecf75217286b8e9afbe4e9dc5213a1f615d7f01f869f657d4dda3dbd/python-mystrom-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "506d93ce2b99f2ce0a4449d2bc8845c3", "sha256": "60b3ba396aec3dc00ab5622e64066f44dcd570291d4718079ac2d0a0c885e131" }, "downloads": -1, "filename": "python-mystrom-0.4.3.tar.gz", "has_sig": false, "md5_digest": "506d93ce2b99f2ce0a4449d2bc8845c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9448, "upload_time": "2018-06-07T06:33:23", "url": "https://files.pythonhosted.org/packages/b4/51/4729299ea31f7734277c0a4760694d1cf30ba23c9cfed239455435dab696/python-mystrom-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "afba65a1416b22e4dd0b74cd3982053e", "sha256": "d46f8538709553b5b807d7060f6bc79c8010ad1e87a565314afe821250d775aa" }, "downloads": -1, "filename": "python-mystrom-0.4.4.tar.gz", "has_sig": false, "md5_digest": "afba65a1416b22e4dd0b74cd3982053e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9425, "upload_time": "2018-06-07T07:11:08", "url": "https://files.pythonhosted.org/packages/64/d9/3a4d3ec273e5b34b7001845ec1f7ad6aef0c353066b3556ecd45a3b2c153/python-mystrom-0.4.4.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "5c70863db9c4ccf7d46995d4396f4e23", "sha256": "3de3b9c0e5d5492e8870a19a0dde43fbd1a66f263ecf89c1885b92c7f62fa925" }, "downloads": -1, "filename": "python-mystrom-0.5.0.tar.gz", "has_sig": false, "md5_digest": "5c70863db9c4ccf7d46995d4396f4e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9633, "upload_time": "2019-02-27T11:18:54", "url": "https://files.pythonhosted.org/packages/a1/bf/74b97251ff36ca937c4de615543bde0cbb77c82913a3be7eb3f092c882a8/python-mystrom-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5c70863db9c4ccf7d46995d4396f4e23", "sha256": "3de3b9c0e5d5492e8870a19a0dde43fbd1a66f263ecf89c1885b92c7f62fa925" }, "downloads": -1, "filename": "python-mystrom-0.5.0.tar.gz", "has_sig": false, "md5_digest": "5c70863db9c4ccf7d46995d4396f4e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9633, "upload_time": "2019-02-27T11:18:54", "url": "https://files.pythonhosted.org/packages/a1/bf/74b97251ff36ca937c4de615543bde0cbb77c82913a3be7eb3f092c882a8/python-mystrom-0.5.0.tar.gz" } ] }