Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to link it with an entity ? #11

Open
cba42 opened this issue Dec 12, 2020 · 5 comments
Open

How to link it with an entity ? #11

cba42 opened this issue Dec 12, 2020 · 5 comments

Comments

@cba42
Copy link

cba42 commented Dec 12, 2020

Hello,

I have added a switch as per the documentation.
However, I don't understand how to link this to an entity ?
Ultimate goal is to display a button on lovelace that would trigger this switch

Thanks for your help !

@twrecked
Copy link
Owner

Hi.

The momentary switch is just a standard switch so you can use switch.turn_on with the tap_action. I haven't had chance to test this but something like this should work:

type: button
name: Test Momentary Switch
show_state: false
tap_action:
  action: call-service
  service: script.turn_on
  service_data:
    entity_id: switch.momentary_test

@vsirianos
Copy link

I have the same problem

I want to open my garage door without pressing my shelly switch (switch.shelly1) multiple times

I have created the momentary switch in the config.yaml
How do I link this momentary switch with the real switch.shelly1 entity

@jsnfwlr
Copy link

jsnfwlr commented Jul 4, 2021

@twrecked I get that momentary switches are stand alone, but it would be awesome to have an optional config definition that allows us to specify an entity that the momentary switch will then control. This would save us creating automations in addition to momentary switches.

- platform: momentary
  name: Kids Bedroom Light
  mode: on
  toggle_for: 3600
  entity: light.kids_bedroom

@egorgam
Copy link

egorgam commented Sep 10, 2021

@cba64 @jsnfwlr you can try this https://github.com/egorgam/hass-momentary

you can run call any entity like this:

  - platform: momentary
    name: Vacuum return to base
    mode: on
    toggle_for:
      milliseconds: 50
    cancellable: False
    turn_on:
      service: vacuum.return_to_base
      entity_id: vacuum.robot_pylesos

@Noblast
Copy link

Noblast commented Jul 23, 2023

Hello,

I have also performed the installation according to the instructions and also do not get any error messages when checking the configuration.
But unfortunately I can not find the switch I specified under the name.

Where should I find it?
What am I doing wrong and how can I use it to control a device (switch). In my case it is also the garage control switch, which only requires a pushbutton pulse.

I did it in this way. Where could I find the "MomTest" Switch in HA?

momentary:

switch:

  • platform: momentary
    name: "MomTest"
    mode: "on"
    toggle_for: 1
    cancellable: True

Thanks and greetings
the Noblast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants