evgeni / esphome-configs

38 stars 12 forks source link

cover only respond to prog #9

Open ageurtse opened 1 year ago

ageurtse commented 1 year ago

Hello,

tryed your code, but the covers only respond to the prog command. but the rest isn't working, what could be wrong ?

  name: somfy
  platform: ESP32
  board: nodemcu-32s
  libraries:
    - EEPROM
    - SPI
    - SmartRC-CC1101-Driver-Lib@2.5.7
    - Somfy_Remote_Lib@0.4.1
  includes:
    - somfy_secrets.h
    - somfy_cover.h

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: test
    password: abcdefgh

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ******

ota:
  password: ******

web_server:
  port: 80

sensor:
  - platform: uptime
    name: Uptime Sensor

  - platform: wifi_signal
    name: "WiFi Signal Sensor"

cover:
  - platform: custom
    lambda: |-
      auto somfy_remote = new SomfyESPRemote();
      somfy_remote->add_cover("somfy", "woonkamer", SOMFY_REMOTE_WOONKAMER);
      somfy_remote->add_cover("somfy", "keuken", SOMFY_REMOTE_KEUKEN);
      somfy_remote->add_cover("somfy", "slaapkamer", SOMFY_REMOTE_SLAAPKAMER);
      somfy_remote->add_cover("somfy", "deur woonkamer", SOMFY_REMOTE_LOGEERKAMER);
      App.register_component(somfy_remote);
      return somfy_remote->covers;

    covers:
      - id: "somfy1"
        name: "Somfy woonkamer"
      - id: "somfy2"
        name: "Somfy keuken"
      - id: "somfy3"
        name: "Somfy slaapkamer"
      - id: "somfy4"
        name: "Somfy deur woonkamer"

switch:
  - platform: template
    name: "PROG1"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy1))->program();
  - platform: template
    name: "STOP"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy1))->stop();
  - platform: template
    name: "PROG2"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy2))->program();
  - platform: template
    name: "STOP2"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy2))->stop();
  - platform: template
    name: "PROG3"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy3))->program();
  - platform: template
    name: "STOP3"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy3))->stop();
  - platform: template
    name: "PROG4"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy4))->program();
  - platform: template
    name: "STOP4"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy4))->stop();
evgeni commented 1 year ago

I recall someone reporting a similar issue, and their solution was to send the commands with fewer repetitions.

https://github.com/evgeni/esphome-configs/blob/70240e32c8227c7b8429ab0d35a6c4cb574fc957/somfy_cover.h#L35

One can add an optional repeat parameter here. It defaults to 4. Maybe try

remote->sendCommand(command, 2);
ageurtse commented 1 year ago

that didn't solve it. do you have more clue's.

could it be somthing with the memory

evgeni commented 1 year ago

Do you happen to have an SDR that you could use for listening on 433MHz?

ageurtse commented 1 year ago

Nu i dont have a sdr

ageurtse commented 1 year ago

Got my sdr and looking at the data, it is sending somtimes some data.

stop isn't working, up and down somtimes work, somtimes not. looks like, when on the telis hit down, then C1101 is sending down and up isn't working. so i don;t know.

The id programmed in the secret file isn't displayed ons the sdr output. ID 39F3e1 = telis ID 574322 = esphome

image

CorjanV commented 1 year ago

Any progress so far? I'm reporting the same issue: cover is only responding to PROG. Tried changing the variable 'repeat' in sendCommand(), but no luck so far. I have no SDR unfortunately..

esphome:
  name: somfy-dsmr-brievenbus
  friendly_name: somfy_dsmr_brievenbus
  libraries:
    - EEPROM
    - SPI
    - SmartRC-CC1101-Driver-Lib@2.5.6
    - Somfy_Remote_Lib@0.4.1
  includes:
    - config/somfy_secrets.h
    - config/somfy_cover.h

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "s0m3k3y"

ota:
  password: !secret ota_pass

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pass

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "somfy-dsmr-brievenbus"
    password: "Eql10QGx3T3K"

captive_portal:

uart:
  id: uart_dsmr
  rx_pin: 
    number: 3
    inverted: true
  baud_rate: 115200
  # debug:
  #   direction: RX
  #   after:
  #     delimiter: "\r\n"
  #   sequence:
  #     - lambda: UARTDebug::log_string(direction, bytes);

dsmr:
  uart_id: uart_dsmr 
  #receive_timeout: 500ms
  #request_interval: 10s

sensor:
  - platform: dsmr
    power_delivered_l1 :
      name: test Energy Consumed Tariff 1

cover:
  - platform: custom
    lambda: |-
      auto somfy_remote = new SomfyESPRemote();
      somfy_remote->add_cover("somfy", "zonnescherm_links", SOMFY_REMOTE_LINKS);
      somfy_remote->add_cover("somfy", "zonnescherm_midden", SOMFY_REMOTE_MIDDEN);
      somfy_remote->add_cover("somfy", "zonnescherm_rechts", SOMFY_REMOTE_RECHTS);
      App.register_component(somfy_remote);
      return somfy_remote->covers;
    covers:
      - id: "somfy"
        name: "Somfy Cover L"
      - id: "somfy2"
        name: "Somfy Cover M"
      - id: "somfy3"
        name: "Somfy Cover R"

switch:
  - platform: template
    name: "PROG_L"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy))->program();
  - platform: template
    name: "STOP_L"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy))->make_call().set_command_stop();
  - platform: template
    name: "PROG_M"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy2))->program();
  - platform: template
    name: "STOP_M"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy2))->make_call().set_command_stop();
  - platform: template
    name: "PROG_R"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy3))->program();
  - platform: template
    name: "STOP_R"
    turn_on_action:
      - lambda: |-
          ((SomfyESPCover*)id(somfy3))->make_call().set_command_stop();

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP  
    name: "Brievenbus"
    id: brievenbus
    filters:
      - delayed_on: 10ms    
ageurtse commented 1 year ago

No progress, i switched to rflink and that works flawless

CorjanV commented 1 year ago

What transmitter do you use for rflink now? I'm trying to find differences in my design, and I noticed @evgeni uses the 10 pin version of the CC1101. I'm using the 8 pin version so maybe this version is not as good as the 10 pin version?

Micha70 commented 1 year ago

I have a similar issue. Is only reacting on PROG button during learning. I have changed also already the repetition counter to 2. What I have discovered in RDS is the rolling counter is always the same, is not incrementing. Any clue what happens?

evgeni commented 1 year ago

Too long name? The variable storage on the ESP32 is limited to 15 byte long keys (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_flash.html)

Micha70 commented 1 year ago

Too long name? The variable storage on the ESP32 is limited to 15 byte long keys (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_flash.html)

Thanks, you are my hero!

Very good! I like it!