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

Template switch is spamming its state #155

Closed
frog32 opened this Issue Oct 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@frog32

frog32 commented Oct 8, 2018

I have a template switch with the following definition and this publishes its state multiple times a second. When I subscribe to its mqtt topics I get the this output:

coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF
coffee_machine/switch/coffee_machine/state OFF

switch:
  - platform: template
    name: "Coffee Machine"
    icon: "mdi:coffee"
    lambda: >-
      if (id(power_led).value) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - switch.turn_on:
          id: power_btn
      - delay: 2s
      - switch.turn_off:
          id: power_btn
    turn_off_action:
      - switch.turn_on:
          id: power_btn
      - delay: 2s
      - switch.turn_off:
          id: power_btn
@OttoWinter

This comment has been minimized.

Owner

OttoWinter commented Oct 8, 2018

Ah yes, missed that when refactoring the core switch code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment