Esphomeyaml: pulse-switch?

Hi all,

I’ve just started using esphomeyaml, and really digging it so far. So much that I’m actually intending to upgrade my nodemcus around the house, instead of using ESPeasy. Only problem I have is, I’ve “hacked” an old device, connecting two relays to on and off-button, to simulate a button press.

In espeasy I have to possibility to send at pulse at X milliseconds (on-Xmilliseconds-off). Is that possible with esphomeyaml as well?

I just asked this same question to the developer via discord and yes it is possible with template switches:

switch:

  • platform: gpio
    number: GPIO23
    id: the_pin
  • platform: template
    name: Name
    optimistic: True
    turn_on_action:
    • switch.turn_on: the_pin
    • delay: 100ms
    • switch.turn_off: the_pin
3 Likes

Excellent, thank you very much :slight_smile:

Using ESPhomeyaml and trying to get a pulse switch…
Keep getting errors with this… regarding dictionary for @data turn_on_action
turn_on_action: ?
I have

"
switch:

  • platform: gpio
    pin: GPIO23
    id: gara_bt

  • platform: template
    name: GarageDoorBt
    optimistic: True
    turn_on_action:

    • switch.turn_on: gara_bt
    • delay: 100ms
    • switch.turn_off: gara_bt
      "

solved. just update esphomeyaml :slight_smile: