{ "info": { "author": "Dominik Schloesser", "author_email": "dsc@dosc.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License" ], "description": "[![PyPI version](https://badge.fury.io/py/fhem.svg)](https://badge.fury.io/py/fhem)\n[![TravisCI Test Status](https://travis-ci.org/domschl/python-fhem.svg?branch=master)](https://travis-ci.org/domschl/python-fhem)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/116e9e988d934aaa9cfbfa5b8aef7f78)](https://www.codacy.com/app/dominik.schloesser/python-fhem?utm_source=github.com&utm_medium=referral&utm_content=domschl/python-fhem&utm_campaign=Badge_Grade)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE)\n\n# python-fhem\n\nPython FHEM (home automation server) API\n\nSimple API to connect to the [FHEM home automation server](https://fhem.de/) via sockets or http(s), using the telnet or web port on FHEM with optional SSL (TLS) and password or basicAuth support.\n\n**Note:** Python 2.x deprecation warning. `python-fhem` versions 0.6.x will be the last versions supporting Python 2.x.\n\n## Installation\n\n### PIP installation (PyPI)\n\nSee the [PyPI page](https://pypi.python.org/pypi?:action=display&name=fhem) for additional information about the package.\n\n```bash\npip install [-U] fhem\n```\n\n### From source\n\nIn `python-fhem/fhem`:\n\nGet a copy of README for the install (required by setup.py):\n\n```bash\ncp ../README.md .\n```\n\nthen:\n\n```bash\npip install [-U] .\n```\n\nor, as developer installation, allowing inplace editing:\n\n```bash\npip install [-U] -e .\n```\n\n## History\n\n* 0.6.3 (2019-09-26): Bug fixes for socket connection exceptions [#18](https://github.com/domschl/python-fhem/issues/18) by [TK67](https://forum.fhem.de/index.php/topic,63816.msg968089.html#msg968089) [FHEM forum] and EventQueue crashes in datetime parsing [#19](https://github.com/domschl/python-fhem/issues/19) by party-pansen. Self-test now also covers FhemEventQueue() class.\n* 0.6.2 (2019-06-06): Bug fix, get_device_reading() could return additional unrelated readings. [#14](https://github.com/domschl/python-fhem/issues/14). Default blocking mode for telnet has been set to non-blocking. This can be changed with parameter `blocking=True` (telnet only). Use of HTTP(S) is recommended (superior\nperformance and faster)\n* [build environment] (2019-07-22): Initial support for TravisCI automated self-tests.\n* 0.6.1 (2018-12-26): New API used telnet non-blocking on get which caused problems (d1nd141, [#12](https://github.com/domschl/python-fhem/issues/12)), fixed\nby using blocking telnet i/o.\n* 0.6.0 (2018-12-16): Enhanced and expanded get-API (Andre0512 [#10](https://github.com/domschl/python-fhem/pull/10)). See [online documentation](https://domschl.github.io/python-fhem/doc/_build/html/index.html), especially the new get() method for details on the new functionality. Proprietary logging functions marked deprecated. \n* 0.5.5 (2018-08-26): Documentation cleanup, automatic documentation with sphinx.\n* 0.5.3 (2018-08-26): Fix syntax in exception handler\n* 0.5.2 (2018-06-09): Fix for crash on invalid csrf-return\n* 0.5.1 (2018-01-29): Removed call to logging.basicConfig(), since it was unnecessary and causes breakage if other modules use this too. (heilerich [#8](https://github.com/domschl/python-fhem/issues/8))\n* 0.5: API cleanup (breaking change!). Removed deprecated functions: sendCmd, sendRcvCmd, getDevState, getDevReading (replaced with PEP8 conform names, s.b.). Renamed parameter ssl= -> use_ssl=\n* 0.4.4: Merged python logger support (ChuckMoe, [#6](https://github.com/domschl/python-fhem/commit/25843d79986031cd654f87781f37d1266d0b116b))\n* 0.4.3: Merged API extensions for getting time of last reading change (logi85, [#5](https://github.com/domschl/python-fhem/commit/11719b41b29a8c2c6192210e3848d9d8aedc5337))\n* 0.4.2: deprecation error message fixed (Ivermue, [#4](https://github.com/domschl/python-fhem/commit/098cd774f2f714267645adbf2ee4556edf426229))\n* 0.4.0: csrf token support (FHEM 5.8 requirement)\n\n## Usage\n\n### Set and get transactions\n\nDefault telnet connection without password and without encryption:\n\n```python\nimport logging\nimport fhem\n\nlogging.basicConfig(level=logging.DEBUG)\n\n## Connect via HTTP, port 8083:\nfh = fhem.Fhem(\"myserver.home.org\", protocol=\"http\", port=8083)\n# Send a command to FHEM (this automatically connects() in case of telnet)\nfh.send_cmd(\"set lamp on\")\n# Get temperatur of LivingThermometer\ntemp = fh.get_device_reading(\"LivingThermometer\", \"temperature\")\n# return a dictionary with reading-value and time of last change:\n# {'Value': 25.6, 'Time': datetime.datetime(2019, 7, 27, 8, 19, 24)}\nprint(\"The living-room temperature is {}, measured at {}\".format(temp[\"Value\"], temp[\"Time\"]))\n# Output: The living-room temperature is 25.6, measured at 2019-07-27 08:19:24\n\n# Get a dict of kitchen lights with light on:\nlights = fh.get_states(group=\"Kitchen\", state=\"on\", device_type=\"light\", value_only=True)\n# Get all data of specific tvs\ntvs = fh.get(device_type=[\"LGTV\", \"STV\"])\n# Get indoor thermometers with low battery\nlow = fh.get_readings(name=\".*Thermometer\", not_room=\"outdoor\", filter={\"battery!\": \"ok\"})\n# Get temperature readings from all devices that have a temperature reading:\nall_temps = fh.get_readings('temperature')\n```\n\nHTTPS connection:\n\n```python\nfh = fhem.Fhem('myserver.home.org', port=8085, protocol='https')\n```\n\nSelf-signed certs are accepted (since no `cafile` option is given).\n\nTo connect via https with SSL and basicAuth:\n\n```python\nfh = fhem.Fhem('myserver.home.org', port=8086, protocol='https',\n cafile=mycertfile, username=\"myuser\", password=\"secretsauce\")\n```\n\nIf no public certificate `cafile` is given, then self-signed certs are accepted.\n\n## Connect via default protocol telnet, default port 7072: (deprecated)\n\n*Note*: Connection via telnet is not reliable for large requests, which\nincludes everything that uses wildcard-funcionality.\n\n```python\nfh = fhem.Fhem(\"myserver.home.org\")\n```\n\nTo connect via telnet with SSL and password:\n\n```python\nfh = fhem.Fhem(\"myserver.home.org\", port=7073, use_ssl=True, password='mysecret')\nfh.connect()\nif fh.connected():\n # Do things\n```\n\nIt is recommended to use HTTP(S) to connect to Fhem instead.\n\n### Event queues (currently telnet only)\n\nThe library can create an event queue that uses a background thread to receive\nand dispatch FHEM events:\n\n```python\ntry:\n # Python 3.x\n import queue\nexcept:\n # Python 2.x\n import Queue as queue\nimport fhem\n\nque = queue.Queue()\nfhemev = fhem.FhemEventQueue(\"myserver.home.org\", que)\n\nwhile True:\n ev = que.get()\n # FHEM events are parsed into a Python dictionary:\n print(ev)\n que.task_done()\n```\n\n# Documentation\n\nsee: [python-fhem documentation](https://domschl.github.io/python-fhem/index.html)\n\n# References\n\n* [Fhem home automation project page](https://fhem.de/)\n* [Fhem server wiki](https://wiki.fhem.de/)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/domschl/python-fhem", "keywords": "fhem home automation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "fhem", "package_url": "https://pypi.org/project/fhem/", "platform": "", "project_url": "https://pypi.org/project/fhem/", "project_urls": { "Homepage": "http://github.com/domschl/python-fhem" }, "release_url": "https://pypi.org/project/fhem/0.6.3/", "requires_dist": null, "requires_python": "", "summary": "Python API for FHEM home automation server", "version": "0.6.3" }, "last_serial": 5890392, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "44bbaf292339c0ae0300c2b4a61271de", "sha256": "0e4cf4d7fe33935aa023d3a2ca8d4102c6c5ae5f7156aeb21e9445943ddbeef2" }, "downloads": -1, "filename": "fhem-0.1.tar.gz", "has_sig": false, "md5_digest": "44bbaf292339c0ae0300c2b4a61271de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4320, "upload_time": "2017-01-01T09:31:00", "url": "https://files.pythonhosted.org/packages/c5/bb/3af41f63a524fdc31b15cebe18c43e19d337688bd41a15ac05e6f1616c2b/fhem-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4230b6e706422dc84e233214b82e3ac8", "sha256": "4015ba386cf46ded66ec43bf825f1772a8fb3a66f5c2af259e1d6d365778c03e" }, "downloads": -1, "filename": "fhem-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4230b6e706422dc84e233214b82e3ac8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4314, "upload_time": "2017-01-01T11:58:10", "url": "https://files.pythonhosted.org/packages/9b/41/583a09b39b81ee07db8a0ac368ec4baf5ddfba65f5e58b79c4f3bdf09950/fhem-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "764bf5eed3c657172d3b9b4059fcf42e", "sha256": "ef8c5f597439ba0990c0007baa4500386c28cd3c7e8f0680e087a5d45dfdc632" }, "downloads": -1, "filename": "fhem-0.1.2.tar.gz", "has_sig": false, "md5_digest": "764bf5eed3c657172d3b9b4059fcf42e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4285, "upload_time": "2017-01-01T12:03:10", "url": "https://files.pythonhosted.org/packages/b3/53/979b9789ddce00aa28310373645860fbc93f068109155076a093e9a7466a/fhem-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "3542bf6230c521ed4b00c4a13c6e703b", "sha256": "9a63d7e8887ca21202cdb8ec752b3f5dca1b393ade2ffbe4de5804d920e58490" }, "downloads": -1, "filename": "fhem-0.1.3.tar.gz", "has_sig": false, "md5_digest": "3542bf6230c521ed4b00c4a13c6e703b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4290, "upload_time": "2017-01-05T08:43:49", "url": "https://files.pythonhosted.org/packages/3a/16/0e0a2cbd4a9c8e96553e7f6aa8cff0b28b8054150651d5e10812b5c6faf5/fhem-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "b1b408c114bdb25041d754ec90f9c462", "sha256": "28b776084cb4b5f6c75696bab117e71a65d8d7ed569b0e2b0a2d1a9b91193d95" }, "downloads": -1, "filename": "fhem-0.1.4.tar.gz", "has_sig": false, "md5_digest": "b1b408c114bdb25041d754ec90f9c462", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4292, "upload_time": "2017-01-05T09:00:47", "url": "https://files.pythonhosted.org/packages/7e/52/c246dae46ecdbb25ac5608bd0bd098f4cd22b9d9590f443c28fdd0673fe7/fhem-0.1.4.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cceaa1f3783f0a22b33846e0cbd543e9", "sha256": "223af8244df4b5613def6674acb2756e3592f5c67b55a9fc784420b9fb977a11" }, "downloads": -1, "filename": "fhem-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cceaa1f3783f0a22b33846e0cbd543e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5418, "upload_time": "2017-01-08T17:06:43", "url": "https://files.pythonhosted.org/packages/89/fb/3859b205f67ea22d10c40f546906c5eedbfbb24c6e5b5440e3c7e9828dce/fhem-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "893ca9b3aac8dd21dd23939d14be3a72", "sha256": "e0daf33b4c8ef38da5d4020eb16d4641dc1b8c6f8da4f22fa2aeac51ea9be24e" }, "downloads": -1, "filename": "fhem-0.3.0.tar.gz", "has_sig": false, "md5_digest": "893ca9b3aac8dd21dd23939d14be3a72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5574, "upload_time": "2017-03-14T13:51:21", "url": "https://files.pythonhosted.org/packages/47/a6/cfe24c1ba1475404618bf730991a2cd675582d725ede121fa89880dfab41/fhem-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "b538f4362e8202b20355f6ff17e1a271", "sha256": "450042660239f69e3b266641c4a14fe7d954d321e581a25ff5a3284f0da5da56" }, "downloads": -1, "filename": "fhem-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b538f4362e8202b20355f6ff17e1a271", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5917, "upload_time": "2017-03-30T13:37:14", "url": "https://files.pythonhosted.org/packages/a7/29/0772f4ba05b8aa9b0092f28d9662f7e8a405b2689d5a36dc1b2f5eb05e62/fhem-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "30848b48b2deb85f708e7e796162d8d2", "sha256": "c1634d6e751eb7c67642a7e5a3aa4fe6679cb8ac1b8f9c6cd3425a8a144770d9" }, "downloads": -1, "filename": "fhem-0.4.1.tar.gz", "has_sig": false, "md5_digest": "30848b48b2deb85f708e7e796162d8d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5893, "upload_time": "2017-03-30T13:57:49", "url": "https://files.pythonhosted.org/packages/89/70/ae6ff00ec006513dd3592b3375809f01742c0f864b203550fe669610142d/fhem-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "2ceddd26dd22e119cbca4028951a2cce", "sha256": "4580e4ec154f0708f72a626411118350dc203e9a84a2011adb3e03294f523667" }, "downloads": -1, "filename": "fhem-0.4.2.tar.gz", "has_sig": false, "md5_digest": "2ceddd26dd22e119cbca4028951a2cce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5897, "upload_time": "2017-06-28T16:11:27", "url": "https://files.pythonhosted.org/packages/5a/1b/38074bc9e6cc0359e2af7ca508080a9ec41e1692789d0a5759e87ce0deb9/fhem-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "06d65128a39806694d65cdfd67ae753a", "sha256": "af4a735236b0a3ba317fe89c849c8729120945e77a3053edce9dc92d9fdb0aa5" }, "downloads": -1, "filename": "fhem-0.5.0.tar.gz", "has_sig": false, "md5_digest": "06d65128a39806694d65cdfd67ae753a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8039, "upload_time": "2018-01-14T14:19:13", "url": "https://files.pythonhosted.org/packages/f2/68/7a931afab96137c2a3447ef25b2330e9ce9466334727c8cbcd9af2ec2f92/fhem-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "766404924374b6ba0505ae243b5eb6df", "sha256": "b0d5e9ee6b025753ac5df493c394d4e6108a14baa2512caf4df6b88f37843f63" }, "downloads": -1, "filename": "fhem-0.5.1.tar.gz", "has_sig": false, "md5_digest": "766404924374b6ba0505ae243b5eb6df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8008, "upload_time": "2018-01-29T09:39:33", "url": "https://files.pythonhosted.org/packages/4e/cc/e9fe265a6870491c0d00304b8f7be27e31605aacb986919b52b67ac9a181/fhem-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "513a0e1940ef7888231c1e7fe07d031e", "sha256": "1af6997a9d65151f0c5b85bf36cf79d80bdd467bfc832ab5c4d5e69e1752446f" }, "downloads": -1, "filename": "fhem-0.5.2.tar.gz", "has_sig": false, "md5_digest": "513a0e1940ef7888231c1e7fe07d031e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8166, "upload_time": "2018-06-09T13:35:20", "url": "https://files.pythonhosted.org/packages/1d/da/d0b1191532511c2019f74e63420b9e21754dd437cb39f76b8eb934f1277e/fhem-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "e3e907c5bfd24d56157b1cc5cad76c9e", "sha256": "7701454d8201e8a3e791abb2141409cfe7628cf90d0f98473b3c24b57d108d9d" }, "downloads": -1, "filename": "fhem-0.5.3.tar.gz", "has_sig": false, "md5_digest": "e3e907c5bfd24d56157b1cc5cad76c9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6164, "upload_time": "2018-08-26T06:44:05", "url": "https://files.pythonhosted.org/packages/25/d0/ff46d682e0a587fa34d354b7f0fdc4ad23ea5da100d9bb9b773502085dd1/fhem-0.5.3.tar.gz" } ], "0.5.5": [ { "comment_text": "", "digests": { "md5": "270742f224ab689ae8e8f687ce8def4a", "sha256": "c72617ef95aa26113f899f7f7d720982611d6467ccfcf5da858048f99a176388" }, "downloads": -1, "filename": "fhem-0.5.5.tar.gz", "has_sig": false, "md5_digest": "270742f224ab689ae8e8f687ce8def4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8817, "upload_time": "2018-08-26T07:58:32", "url": "https://files.pythonhosted.org/packages/93/16/5938e59eced8499c5f2c06bb47b44a866280ab726fcc11bdd8dd5624ee6d/fhem-0.5.5.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "2a87f02febaaeb02d62ac065d40fe304", "sha256": "ebd69e3f42349818e27762eb5d702f96f11aabf5a4d22e6d14d9e96848f6ada0" }, "downloads": -1, "filename": "fhem-0.6.0.tar.gz", "has_sig": false, "md5_digest": "2a87f02febaaeb02d62ac065d40fe304", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12409, "upload_time": "2018-12-16T16:27:01", "url": "https://files.pythonhosted.org/packages/4f/fc/5212e028e671e933e9116ad335465ebb4f953af602c36b9fe21a9f09d9f6/fhem-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "cb2130a364744ff0b87a1faf03a8880f", "sha256": "ee4110d2471e948b188cb2af3b55c4870dde59c4789592acb5d0c9dcc6f31893" }, "downloads": -1, "filename": "fhem-0.6.1.tar.gz", "has_sig": false, "md5_digest": "cb2130a364744ff0b87a1faf03a8880f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12698, "upload_time": "2018-12-26T11:03:16", "url": "https://files.pythonhosted.org/packages/a7/05/5ade9244aa9c124c6f94abbd40871d145b3a2e1002fa0bc4e05b252c2262/fhem-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "24dea6ac7b4a8457b1c97a692505b1d9", "sha256": "b8dc651d1f00a7845a2a6aec59a0e3f8956fbcd7876295b329fa3565a4f5f009" }, "downloads": -1, "filename": "fhem-0.6.2.tar.gz", "has_sig": false, "md5_digest": "24dea6ac7b4a8457b1c97a692505b1d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13806, "upload_time": "2019-07-22T16:32:31", "url": "https://files.pythonhosted.org/packages/0f/fa/82e169ad233982eb51441f0d85400c8f0577a90446ea92a70ca19b78f456/fhem-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "230b9dd156e92204044b59692278da7f", "sha256": "52108a175a684dc3ef4f3bf82e798eba3a5785432a3789fd55eff5f570b56297" }, "downloads": -1, "filename": "fhem-0.6.3.tar.gz", "has_sig": false, "md5_digest": "230b9dd156e92204044b59692278da7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14846, "upload_time": "2019-09-26T12:31:52", "url": "https://files.pythonhosted.org/packages/da/0a/271c892034b061b9a783d503d1e8a308fed54bb38ab4be24339e2ee3a4ac/fhem-0.6.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "230b9dd156e92204044b59692278da7f", "sha256": "52108a175a684dc3ef4f3bf82e798eba3a5785432a3789fd55eff5f570b56297" }, "downloads": -1, "filename": "fhem-0.6.3.tar.gz", "has_sig": false, "md5_digest": "230b9dd156e92204044b59692278da7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14846, "upload_time": "2019-09-26T12:31:52", "url": "https://files.pythonhosted.org/packages/da/0a/271c892034b061b9a783d503d1e8a308fed54bb38ab4be24339e2ee3a4ac/fhem-0.6.3.tar.gz" } ] }