bruxy70 / Venetian-Blinds-Control

Control Shutters or Venetian blinds via buttons and MQTT. Use 2 relays (up and down) and 2 binary inputs to independently control position and tilt.
MIT License
44 stars 19 forks source link

Buttons dont work #22

Closed LukasJerabek closed 4 months ago

LukasJerabek commented 4 months ago

Hi Vaclav, thank you so much for blinds tilting firmware! I am using shelly 2PM plus and I can control blinds perfectly from home assistant now, however buttons dont do anything. I cant belive I would have messed up wiring, because I have checked many times, it should be fine. Could it be that documentation binary_sensor section no longer works? Or could you help me please, do you see a problem anywhere in my config:

esphome:
  name: zaluzie-jidelna
  friendly_name: Zaluzie Jidelna

external_components:
  - source:
      type: git
      url: https://github.com/bruxy70/Venetian-Blinds-Control
      ref: master
    components: [venetian_blinds]

esp32:
  board: esp32doit-devkit-v1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ---
ota:
  password: ---

web_server:
  port: 80

sensor:
  - platform: wifi_signal
    name: Shelly Wifi Signal Strength
    update_interval: 60s
  - platform: uptime
    name: Shelly Uptime

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Zaluzie-Jidelna Fallback Hotspot"
    password: ---
  manual_ip:
    static_ip: ---
    gateway: ---
    subnet: ---

captive_portal:

cover:
  - platform: venetian_blinds
    name: "Zaluzie jidelna"
    id: cover1
    open_action:
      - switch.turn_on: relay1
    open_duration: 34550ms
    close_action:
      - switch.turn_on: relay2
    close_duration: 34260ms
    tilt_duration: 1600ms
    stop_action:
      - switch.turn_off: relay1
      - switch.turn_off: relay2

binary_sensor:
  - id: key1
    platform: gpio
    pin:
      number: GPIO05
      mode:
        input: true
        pullup: true
      inverted: True
    on_press:
      then:
        - cover.open: cover1
    on_release:
      then:
        - cover.stop: cover1
  - id: key2
    platform: gpio
    pin:
      number: GPIO18
      mode:
        input: true
        pullup: true
      inverted: True
    on_press:
      then:
        - cover.close: cover1
    on_release:
      then:
        - cover.stop: cover1

switch:
  - platform: gpio
    name: "Zaluzie jidelna 1"
    pin: GPIO13 
    id: relay1
    interlock: [relay2]
  - platform: gpio
    name: "Zaluzie jidelna 1"
    pin: GPIO12
    id: relay2
    interlock: [relay1]
LukasJerabek commented 4 months ago

I have bought another shelly plus 2PM and attach it to other shutter and the same happened. I cant figure this out, I think wiring is alright according to https://www.youtube.com/watch?v=w_Olv8cQOv8.

bruxy70 commented 4 months ago

I do not have any Shelly 2PM, so I can't test the code. But what I'd do is, I'd first try to make the binary switch to toggle the relay directly, without the blinds control. Once you have this working, just add the cover.

LukasJerabek commented 4 months ago

I have already tried that :/ have noticed you can "Download diagnostic" for esphome device and binary_sensor does not appear there, although it does on another devices diagnostic. I guess that must be a bug in esphome otherwise I dont get it... If the config still runs on you devices, then I suppose its not the configuration and we can close this.

LukasJerabek commented 4 months ago

https://github.com/esphome/issues/issues/5523

LukasJerabek commented 3 months ago

Btw solution is in the esphome issue, it was my bad. Your configs are still fine.