{"id":20278779,"url":"https://github.com/twrecked/hass-momentary","last_synced_at":"2025-04-11T06:13:13.863Z","repository":{"id":38388690,"uuid":"204700563","full_name":"twrecked/hass-momentary","owner":"twrecked","description":"Momentary Switch Component for Home Assistant","archived":false,"fork":false,"pushed_at":"2024-09-30T20:24:24.000Z","size":71,"stargazers_count":41,"open_issues_count":10,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T06:13:06.569Z","etag":null,"topics":["home-assistant","home-assistant-integration","momentary","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twrecked.png","metadata":{"files":{"readme":"README.md","changelog":"changelog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-27T12:41:02.000Z","updated_at":"2025-02-19T15:48:00.000Z","dependencies_parsed_at":"2023-10-16T14:20:48.114Z","dependency_job_id":"64226d91-7691-489a-b846-156b0ac8319a","html_url":"https://github.com/twrecked/hass-momentary","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twrecked%2Fhass-momentary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twrecked%2Fhass-momentary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twrecked%2Fhass-momentary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twrecked%2Fhass-momentary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twrecked","download_url":"https://codeload.github.com/twrecked/hass-momentary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351394,"owners_count":21089270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-assistant","home-assistant-integration","momentary","python"],"created_at":"2024-11-14T13:26:16.022Z","updated_at":"2025-04-11T06:13:13.845Z","avatar_url":"https://github.com/twrecked.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Momentary devices for Home Asistant**\n\n_Momentary_ is a component that provides momentary switches for _Home\nAssistant_. That is, it provides a simple switch that once turned on will\nturn itself off.\n\n![icon](images/momentary-icon.png)\n\n# !!!BREAKING CHANGES!!!\nVersion 0.7 supports adding momentary devices using _config flow_. By default it\nwill move your existing devices into a single file `momentary.yaml`. If you\n**DO NOT** want this behaviour add this to your `momentary` configuration.\n\n```yaml\nmomentary:\n  yaml_config: True\n```\n\n\u003c!-- TOC --\u003e\n* [**Momentary devices for Home Asistant**](#momentary-devices-for-home-asistant)\n* [!!!BREAKING CHANGES!!!](#breaking-changes)\n* [Introduction](#introduction)\n  * [Notes](#notes)\n  * [Version 0.6 Documentation](#version-06-documentation)\n  * [Thanks](#thanks)\n* [Installation](#installation)\n  * [HACS](#hacs)\n  * [Manually](#manually)\n  * [From Script](#from-script)\n* [Component Configuration](#component-configuration)\n* [Entity Configuration](#entity-configuration)\n  * [Options](#options)\n* [Upgrade Notes](#upgrade-notes)\n  * [After the Upgrade](#after-the-upgrade)\n  * [Names](#names)\n  * [`unique_id`](#unique_id)\n  * [Known Issues](#known-issues)\n* [Turning on Debug](#turning-on-debug)\n\u003c!-- TOC --\u003e\n\n# Introduction\n\n## Notes\n\nWherever you see `/config` in this README it refers to your home-assistant\nconfiguration directory. For me, for example, it's `/home/steve/ha` that is\nmapped to `/config` inside my docker container.\n\n## Version 0.6 Documentation\n**This documentation is for the 0.7x version, you can find the\n0.6.x version** [here](https://github.com/twrecked/hass-momentary/blob/version-0.6.x/README.md).\n\n\n## Thanks\n\nMany thanks to:\n* [JetBrains](https://www.jetbrains.com/?from=hass-aarlo) for the excellent\n  **PyCharm IDE** and providing me with an open source license to speed up the\n  project development.\n \n  [![JetBrains](/images/jetbrains.svg)](https://www.jetbrains.com/?from=hass-aarlo)\n\n* Icon adapted from [svg icons](https://www.onlinewebfonts.com/icon)\n  and is licensed by CC BY 4.0\n\n\n# Installation\n\n## HACS\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration)\n\nMomentary is part of the default HACS store. If you're not interested in\ndevelopment branches this is the easiest way to install.\n\n## Manually\nCopy the `momentary` directory into your `/config/custom_components` directory.\n\n## From Script\nRun the install script. Run it once to make sure the operations look sane and\nrun it a second time with the `go` parameter to do the actual work. If you\nupdate just rerun the script, it will overwrite all installed files.\n\n```sh\ninstall /config\n# check output looks good\ninstall go /config\n```\n\n# Component Configuration\n\n- `yaml_config`; set to `True` to enable backwards compatability, set to `False`\n  to disable it. The default is `False`.\n\nFor example, this enable backwards compatability.\n\n```yaml\nvirtual:\n  yaml_config: True\n```\n\n# Entity Configuration\nAdd the component using the standard _Home Assistant_  _Integration_ method.\n\nBecause this component creates fake entries and because I'm still figuring out\nthe _Config Flow_ interface you still have to configure it by file.\n\nThe default file is named `/config/momentary.yaml` and is a similar format to\nthe standard _Home Assistant_ configuration files. This file will be created\nduring an upgrade or when you add in a _Momentary_ integration. An empty \nfile looks like this:\n\n\n```yaml\nversion: 1\nswitches:\n```\n\nTo create a single momentary device add the following:\n\n```yaml\nversion: 1\nswitches:\n- name: Empty House Trigger\n```\n\nTo create a single momentary device with custom options use:\n\n```yaml\nversion: 1\nswitches:\n- name: Empty House Trigger\n  mode: \"on\"\n  toggle_for: 5\n  cancellable: True\n```\n\nTo create multiple momentary device add more devices at the bottom:\n\n```yaml\nversion: 1\nswitches:\n- name: Empty House Trigger\n  mode: \"on\"\n  toggle_for: 5\n  cancellable: True\n- name: Full House Trigger\n- name: Overflowing House Trigger\n  toggle_for: 2\n```\n\nYou can group switches together under an umbrella device. To do this use a\ndevice name instead of `name:` as the first line of the switch entry. This\nconfig create a device with 3 entities:\n\n```yaml\nversion: 1\nswitches:\n- House Alarm:\n  - name: House to Armed Trigger\n    toggle_for: 1\n  - name: House to Disarmed Trigger\n    toggle_for: 1\n  - name: House to Home Trigger\n    toggle_for: 1\n```\n\nOnce you've updated the file you will need to reload the component from its\nintegration setting.\n\nThe integration uses the name to distinguish different switches. If you update\nthe name of a switch the old name will be deleted and the new name created on\nreload. \n\nThe integration supports multiple installs, you can use this group similar\nmomentary devices together.\n\n## Options\n\nThe following additional parameters can be specified against the switches:\n\n| Field                   | Type       | Default            | Description                                                                        |\n| ----------------------- | ---------- | ------------------ | -------------------------------------------------------------------------------    |\n| name                    | strings    |                    | Name of the switch. Has to be supplied.                                            |\n| mode                    | string     | \"on\"               | Is the switch a momentary ON or OFF switch. Use `\"on\"` for on and `\"off\"` for off. |\n| toggle_for              | seconds    | 1                  | Amount of time to turn toggle switch for.                                          |\n| cancellable             | Boolean    | False              | Allow switched to be untoggled manually.                                           |\n\n\n# Upgrade Notes\n\n## After the Upgrade\n\nCheck the devices and entities on the _Integrations_ page, if everything looks\ngood then you can comment out the old configuration. _Don't delete it yet, this\nis alpha and I might change some settings..._\n\n## Names\n\nThe qualifier applied to the name has changed. The old qualify of `!` has been\nremoved, not adding _momentary_ to the device/entity name is the default. A \nnew qualify of `+` has been created, adding this tells the integration to add \n_momentary_ to the device/entity name.\n\nThe upgrade code will change this for you.\n\n| Old Name             | New Name                      | Entity Name                          |\n|----------------------| ----------------------------- | ------------------------------------ |\n| Empty House Trigger  | +Empty House Trigger          | switch.momentary_empty_house_trigger |\n| !Empty House Trigger | Empty House Trigger           | switch.empty_house_trigger           |\n\n## `unique_id`\n\nDuring an upgrade the original name based unique id will be created. For a new\ninstall a _UUID_ based unique id will be created.\n\nIf you want to move to the new _UUID_ based unique IDs you can manage this\nwith the following:\n\n- Delete the imported _Momentary_ integration.\n- Re-add the imported _Momentary_ integration. You can use the default values\n  for group and file name.\n\nThe system will re-create your devices with the correct entity ids but with\nnew _UUID_ based unique ids.\n\n_I will look at how this can be made cleaner... maybe a config flow button \nor as part of the upgrade._\n\n## Known Issues\n\nYou will see errors like this on upgrade. They don't seem to cause an issue \nand they disappear once you remove the legacy configuration.\n\n```\n2023-10-13 17:28:09.154 ERROR (MainThread) [homeassistant.components.switch] The momentary platform for the switch integration does not support platform setup. Please remove it from your config.\n```\n\n# Turning on Debug\n\nIf you do run into issues you can enable debug with the following configration.\n\n```yaml\nlogger:\n  default: info\n  logs:\n    custom_components.momentary: debug\n```\n\nIf you can create a bug report with this debug output it would help me track \ndown the problem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwrecked%2Fhass-momentary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwrecked%2Fhass-momentary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwrecked%2Fhass-momentary/lists"}