total-connect-client


Nametotal-connect-client JSON
Version 2024.4 PyPI version JSON
download
home_pageNone
SummaryInteract with Total Connect 2 alarm systems
upload_time2024-04-28 23:14:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords alarm totalconnect
VCS
bugtrack_url
requirements zeep
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Total-Connect-Client
Total-Connect-Client is a python client for interacting with the [TotalConnect2](https://totalconnect2.com) alarm system.

Started by @craigjmidwinter to add alarm support for his personal HomeAssistant set-up, with later contributions from others.

To use with Home Assistant, follow the instructions to set up [Total Connect](https://www.home-assistant.io/integrations/totalconnect/).

For command line or other uses, the package can be downloaded at [PyPI](https://pypi.org/project/total-connect-client/).

The code currently supports:
 - Arming (away, stay, night)
 - Disarming
 - Getting panel status (armed, bypassed, etc)
 - Getting zone status (normal, fault, trouble, low battery, etc)

## Zone Status

To see zones that are faulted (open), your Total Connect account must have “Sensor Activities” enabled. Your alarm monitoring company may charge an extra fee to enable this. If available, these can be found in the Total Connect 2 web portal at **Notifications -> Sensor Activities**. Alternately, they can be found in the Total Connect mobile app at **More -> Settings -> Notifications -> Sensor Activities**. 

## Troubleshooting

If you're having trouble with your system, or find an error message, we may ask you to submit information about your alarm system.  

### From Home Assistant

- Go to https://<your_home_assistant>/config/integrations
- Find the TotalConnect integration card and click on the three dots in the bottom right corner
- Click on Download Diagnostics

### From the command line

Do the following steps:
 
`python3 -m total_connect_client username`
 
If you want to easily put the info into a file for sharing: 
 - `python3 -m total_connect_client username > my_info.txt`
 - Now the file my_info.txt in the same directory will hold all of that information

**WARNING**:  the output of this command includes private information including your username and password.  Carefully remove it before sharing with the developers or posting on Github.

Create an Issue on Github and post both your problem and your system information.

Why do we ask for this information?  The TotalConnect API documentation provides little information on the status codes and other information it returns about your system.  We developed as best we could using the codes our own systems returned.  We have seen many times that other users with issues have different system status codes.

Also consider looking at the [Total Connect system status](https://status.resideo.com/) to see if there is a system wide problem. 

## Developer Interface

If you're an end user, just install Home Assistant and things should just work.

If you're a developer and want to interface to TotalConnect from a system other than Home Assistant:

```
pip install total-connect-client
```

```
from total_connect_client import TotalConnectClient, ArmType, ArmingHelper
```

To arm or disarm the system you must provide the usercode.
The usercodes dictionary maps locationid to usercode; if
the locationid is not found it uses the default usercode.
```python
usercodes = { 'default': '1234' }
client = TotalConnectClient(username, password, usercodes)

for location in client.locations:
    # location.arming_state can be matched against the ArmingState enum members
    # or you can call the ArmingState convenience methods:
    location.arming_state.is_disarmed()
    location.arming_state.is_armed() # true if system is armed in any way
    location.arming_state.is_armed_away()
    location.arming_state.is_pending() # true if system is arming or disarming
    location.arming_state.is_triggered() # true if system is in any alarm state
    location.arming_state.is_triggered_gas() # true if in carbon monoxide alarm state
    #    and many more convenience methods

    # you can pass one of the ArmType enum members to location.arm(), e.g.
    #    location.arm(ArmType.STAY_INSTANT)
    # or, equivalently, you can use any of the specific methods on ArmingHelper:
    #    ArmingHelper(location).arm_away()

    location.disarm()

    location.zone_bypass(zoneid)

    location.is_ac_loss()
    location.is_low_battery()
    location.is_cover_tampered()
    location.last_updated_timestamp_ticks
    location.configuration_sequence_number

    for (zone_id, zone) in location.zones.items():
        zone.is_bypassed()
        zone.is_faulted()
        zone.is_tampered()
        zone.is_low_battery()
        zone.is_troubled()
        zone.is_triggered()

        # zone.zone_type_id can be matched against the ZoneType enum members,
        # or you can call the following convenience methods:
        zone.is_type_button()
        zone.is_type_security()
        zone.is_type_motion()
        zone.is_type_fire() # heat detector or smoke detector
        zone.is_type_carbon_monoxide()
        zone.is_type_medical()

        zone.partition # the partition ID
        zone.description
        zone.can_be_bypassed
        zone.status
        zone.battery_level
        zone.signal_strength
        zone.chime_state
        zone.supervision_type
        zone.alarm_report_state
        zone.loop_number
        zone.sensor_serial_number
        zone.device_type

    # to refresh a location
    location.get_partition_details()
    location.get_zone_details()
    location.get_panel_meta_data()

    # to arm or disarm by partition
    for (partition_id, partition) in location.partitions.items():
        ArmingHelper(partition).arm_stay()
        etc.
```

## Recent Interface Changes

* Partition support has been added. The TotalConnectLocation.arm and disarm family of methods now accept an optional partition_id parameter, and a single TotalConnectPartition object has arm() and disarm() methods and can be used with ArmingHelper.
* Previously most methods returned True on success and False on failure, with no exceptions expected. Now successful methods return but on failure raise subclasses of TotalConnectError.
* The arming control methods in TotalConnectClient have been deprecated; instead use the
similar methods on the values of self.locations.

## Likely Future Interface Changes

* Previously if the usercodes dictionary was invalid, the DEFAULT_USERCODE
was silently used. In a future release, we will raise an exception on an invalid dictionary.

If there's something about the interface you don't understand, check out the [Home Assistant integration](https://github.com/home-assistant/core/blob/dev/homeassistant/components/totalconnect/) that uses this package, or [submit an issue](https://github.com/craigjmidwinter/total-connect-client/issues).

During development, if you discover new status codes or other information not handled, please [submit an issue](https://github.com/craigjmidwinter/total-connect-client/issues) to let us know, or even better submit a [pull request](https://github.com/craigjmidwinter/total-connect-client/pulls).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "total-connect-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "alarm, TotalConnect",
    "author": null,
    "author_email": "\"Craig J. Midwinter\" <craig.j.midwinter@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/be/f3/edafcf7d60fdfca62be6764ad3c01a79d5cad228c477959ad7597a34e76e/total_connect_client-2024.4.tar.gz",
    "platform": null,
    "description": "# Total-Connect-Client\nTotal-Connect-Client is a python client for interacting with the [TotalConnect2](https://totalconnect2.com) alarm system.\n\nStarted by @craigjmidwinter to add alarm support for his personal HomeAssistant set-up, with later contributions from others.\n\nTo use with Home Assistant, follow the instructions to set up [Total Connect](https://www.home-assistant.io/integrations/totalconnect/).\n\nFor command line or other uses, the package can be downloaded at [PyPI](https://pypi.org/project/total-connect-client/).\n\nThe code currently supports:\n - Arming (away, stay, night)\n - Disarming\n - Getting panel status (armed, bypassed, etc)\n - Getting zone status (normal, fault, trouble, low battery, etc)\n\n## Zone Status\n\nTo see zones that are faulted (open), your Total Connect account must have \u201cSensor Activities\u201d enabled. Your alarm monitoring company may charge an extra fee to enable this. If available, these can be found in the Total Connect 2 web portal at **Notifications -> Sensor Activities**. Alternately, they can be found in the Total Connect mobile app at **More -> Settings -> Notifications -> Sensor Activities**. \n\n## Troubleshooting\n\nIf you're having trouble with your system, or find an error message, we may ask you to submit information about your alarm system.  \n\n### From Home Assistant\n\n- Go to https://<your_home_assistant>/config/integrations\n- Find the TotalConnect integration card and click on the three dots in the bottom right corner\n- Click on Download Diagnostics\n\n### From the command line\n\nDo the following steps:\n \n`python3 -m total_connect_client username`\n \nIf you want to easily put the info into a file for sharing: \n - `python3 -m total_connect_client username > my_info.txt`\n - Now the file my_info.txt in the same directory will hold all of that information\n\n**WARNING**:  the output of this command includes private information including your username and password.  Carefully remove it before sharing with the developers or posting on Github.\n\nCreate an Issue on Github and post both your problem and your system information.\n\nWhy do we ask for this information?  The TotalConnect API documentation provides little information on the status codes and other information it returns about your system.  We developed as best we could using the codes our own systems returned.  We have seen many times that other users with issues have different system status codes.\n\nAlso consider looking at the [Total Connect system status](https://status.resideo.com/) to see if there is a system wide problem. \n\n## Developer Interface\n\nIf you're an end user, just install Home Assistant and things should just work.\n\nIf you're a developer and want to interface to TotalConnect from a system other than Home Assistant:\n\n```\npip install total-connect-client\n```\n\n```\nfrom total_connect_client import TotalConnectClient, ArmType, ArmingHelper\n```\n\nTo arm or disarm the system you must provide the usercode.\nThe usercodes dictionary maps locationid to usercode; if\nthe locationid is not found it uses the default usercode.\n```python\nusercodes = { 'default': '1234' }\nclient = TotalConnectClient(username, password, usercodes)\n\nfor location in client.locations:\n    # location.arming_state can be matched against the ArmingState enum members\n    # or you can call the ArmingState convenience methods:\n    location.arming_state.is_disarmed()\n    location.arming_state.is_armed() # true if system is armed in any way\n    location.arming_state.is_armed_away()\n    location.arming_state.is_pending() # true if system is arming or disarming\n    location.arming_state.is_triggered() # true if system is in any alarm state\n    location.arming_state.is_triggered_gas() # true if in carbon monoxide alarm state\n    #    and many more convenience methods\n\n    # you can pass one of the ArmType enum members to location.arm(), e.g.\n    #    location.arm(ArmType.STAY_INSTANT)\n    # or, equivalently, you can use any of the specific methods on ArmingHelper:\n    #    ArmingHelper(location).arm_away()\n\n    location.disarm()\n\n    location.zone_bypass(zoneid)\n\n    location.is_ac_loss()\n    location.is_low_battery()\n    location.is_cover_tampered()\n    location.last_updated_timestamp_ticks\n    location.configuration_sequence_number\n\n    for (zone_id, zone) in location.zones.items():\n        zone.is_bypassed()\n        zone.is_faulted()\n        zone.is_tampered()\n        zone.is_low_battery()\n        zone.is_troubled()\n        zone.is_triggered()\n\n        # zone.zone_type_id can be matched against the ZoneType enum members,\n        # or you can call the following convenience methods:\n        zone.is_type_button()\n        zone.is_type_security()\n        zone.is_type_motion()\n        zone.is_type_fire() # heat detector or smoke detector\n        zone.is_type_carbon_monoxide()\n        zone.is_type_medical()\n\n        zone.partition # the partition ID\n        zone.description\n        zone.can_be_bypassed\n        zone.status\n        zone.battery_level\n        zone.signal_strength\n        zone.chime_state\n        zone.supervision_type\n        zone.alarm_report_state\n        zone.loop_number\n        zone.sensor_serial_number\n        zone.device_type\n\n    # to refresh a location\n    location.get_partition_details()\n    location.get_zone_details()\n    location.get_panel_meta_data()\n\n    # to arm or disarm by partition\n    for (partition_id, partition) in location.partitions.items():\n        ArmingHelper(partition).arm_stay()\n        etc.\n```\n\n## Recent Interface Changes\n\n* Partition support has been added. The TotalConnectLocation.arm and disarm family of methods now accept an optional partition_id parameter, and a single TotalConnectPartition object has arm() and disarm() methods and can be used with ArmingHelper.\n* Previously most methods returned True on success and False on failure, with no exceptions expected. Now successful methods return but on failure raise subclasses of TotalConnectError.\n* The arming control methods in TotalConnectClient have been deprecated; instead use the\nsimilar methods on the values of self.locations.\n\n## Likely Future Interface Changes\n\n* Previously if the usercodes dictionary was invalid, the DEFAULT_USERCODE\nwas silently used. In a future release, we will raise an exception on an invalid dictionary.\n\nIf there's something about the interface you don't understand, check out the [Home Assistant integration](https://github.com/home-assistant/core/blob/dev/homeassistant/components/totalconnect/) that uses this package, or [submit an issue](https://github.com/craigjmidwinter/total-connect-client/issues).\n\nDuring development, if you discover new status codes or other information not handled, please [submit an issue](https://github.com/craigjmidwinter/total-connect-client/issues) to let us know, or even better submit a [pull request](https://github.com/craigjmidwinter/total-connect-client/pulls).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Interact with Total Connect 2 alarm systems",
    "version": "2024.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/craigjmidwinter/total-connect-client/issues",
        "Homepage": "https://github.com/craigjmidwinter/total-connect-client"
    },
    "split_keywords": [
        "alarm",
        " totalconnect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "baea2b0c730bd82ed73894e7ec295d6aaf8e282ede520666ff7b72317e3d5a02",
                "md5": "e4a0a9d138dc0cdddc17d968ff5bdac9",
                "sha256": "84d79f4effac5c391340abc0c8e9ccb2ff042093009582c47b69d158dbb1c5df"
            },
            "downloads": -1,
            "filename": "total_connect_client-2024.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4a0a9d138dc0cdddc17d968ff5bdac9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 27636,
            "upload_time": "2024-04-28T23:14:10",
            "upload_time_iso_8601": "2024-04-28T23:14:10.276640Z",
            "url": "https://files.pythonhosted.org/packages/ba/ea/2b0c730bd82ed73894e7ec295d6aaf8e282ede520666ff7b72317e3d5a02/total_connect_client-2024.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bef3edafcf7d60fdfca62be6764ad3c01a79d5cad228c477959ad7597a34e76e",
                "md5": "1ead7d6ce71e1b21816f607991046e81",
                "sha256": "5de7013341e1e4a1706bb5bf2926a37700d23bf88bd5cf6a9b8c9fcd33d86222"
            },
            "downloads": -1,
            "filename": "total_connect_client-2024.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1ead7d6ce71e1b21816f607991046e81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 33822,
            "upload_time": "2024-04-28T23:14:12",
            "upload_time_iso_8601": "2024-04-28T23:14:12.927651Z",
            "url": "https://files.pythonhosted.org/packages/be/f3/edafcf7d60fdfca62be6764ad3c01a79d5cad228c477959ad7597a34e76e/total_connect_client-2024.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 23:14:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "craigjmidwinter",
    "github_project": "total-connect-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "zeep",
            "specs": [
                [
                    ">=",
                    "4.2.1"
                ]
            ]
        }
    ],
    "lcname": "total-connect-client"
}
        
Elapsed time: 0.34605s