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

yaml for removing remote control and add a pushbutton #20

Open
bepppppo opened this issue Feb 27, 2025 · 6 comments
Open

yaml for removing remote control and add a pushbutton #20

bepppppo opened this issue Feb 27, 2025 · 6 comments

Comments

@bepppppo
Copy link

bepppppo commented Feb 27, 2025

Hello,
Is it possible to change the yaml to remove the RF remote and add an external pushbutton on GPIO0 to cycle between the 3 fan speeds? Like for example first press, speed 1, second press speed 2, third press speed 3 and forth press fan off.
I can use another gpio to control the light, like gpio3 wich is used for the remote control
This is so I can install the ifan04 on the wall plate with 2 pushbuttons

@rh1rich
Copy link
Owner

rh1rich commented Feb 27, 2025

Because GPIO0 is directly connected to the internal button, I would use GPIO4 and GPIO5 for the external buttons. In my template these GPIOs are used for I2C but you can also use them for other purposes. These GPIOs are easely accessible via the test points on the pcb (--> first pcb image in the readme).
If the external buttons connect the GPIOs to GND, then the configuration could be as follows:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO4
      mode:
        input: true
        pullup: true
      inverted: true
    name: Light button
    filters:
      - delayed_off: 10ms   # debouncing
    on_click:
      then:
        - switch.toggle: light_comp
  - platform: gpio
    pin:
      number: GPIO5
      mode:
        input: true
        pullup: true
      inverted: true
    name: Fan button
    filters:
      - delayed_off: 10ms   # debouncing
    on_click:
      then:
        - fan.cycle: fan_comp

@rh1rich
Copy link
Owner

rh1rich commented Feb 27, 2025

If you use GPIO4 and 5 for button inputs you have to remove the i2c component in the configuration.

@bepppppo
Copy link
Author

Thank you for the code, looks nice! I have tried it but when I compile I get this error:

Unable to find action with the name 'fan.cycle'.
fan.cycle: fan_comp

I think there is something I am misssing maybe

@bepppppo
Copy link
Author

changing the code like this it compiles:

on_click:
  then:
    - fan.cycle_speed: fan_comp

and for the light

on_click:
  then:
    - light.toggle: light_comp

@rh1rich
Copy link
Owner

rh1rich commented Feb 28, 2025

Sorry! Two mistakes in one short configuration. Shame on me. 😁

@bepppppo
Copy link
Author

That's ok, it happens to the best 😉.
Thank you for the code, I use esphome and got few ifan04, love the buzzer sound on each speed level.
I converted all of them from tasmota, in my opinion esphome is way better.

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

2 participants