Baldhor / Homey-ESPhome-Enhanced

This is an Homey app which adds support for ESPHome devices. ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems. More information on their homepage: https://www.esphome.io/
GNU General Public License v3.0
4 stars 3 forks source link

Can not connect to device #20

Closed JoachimVeulemans closed 10 months ago

JoachimVeulemans commented 10 months ago

Describe the bug Sorry for the spam of problems but I am still experiencing some issues.

When I try to add Shelly or Sonoff basic devices (one virtual device), everthing is working. When I try to create a custom esp with multiple virtual devices, I am now stuck at the first step. After entering the ip, port & password, it does not connect to the device.

Another bug I have found is when a device goes offline (due to power/wifi issues) and comes back online, it is no longer accessible in Homey. When I try to reconnect (add new device -> update existing), it is still not responding. A solution that I have found is to restart the ESPhome app in Homey. After the restart, the device is back accessible until the next power/wifi issue.

Screenshots Scherm­afbeelding 2023-08-19 om 15 25 22 Scherm­afbeelding 2023-08-19 om 15 26 25

Baldhor commented 10 months ago

@JoachimVeulemans The connection is refused: image

I don't know why but the Object is like "empty", but it means an error from the physical device (like if password was incorrect).

Possible to check on logs on the device side (webserver) ? And maybe share the yaml?

For my test, I use a device with a yml configuration including over 20 differents entities, so I don't think it is the problem.

NB I still fixed this bug on the way: image (but I think you don't care lol)

Baldhor commented 10 months ago

@JoachimVeulemans did you configure the logger in your yml ?

# Enable logging
logger:
  baud_rate: 0
  level: DEBUG #(by default)
Baldhor commented 10 months ago

@JoachimVeulemans are you using password or encryption key for the concerned device? I will add support for encryption key (probably today).

JoachimVeulemans commented 10 months ago

Hi @Baldhor yes, I checked the config earlier, I was using an encryption key. Completely looked over it... I have removed the encryption key, it is working now. Might re-add it when you support it.

The problem of the reboot is still present. I have to restart the app to regain control.

Also, cover devices are not showing up in the virtual capabilities. Is this not supported yet?

JoachimVeulemans commented 10 months ago

Also for the cover, I have no open/closed sensor for the gate within the same physical device.

I have an open/closed sensor connected to Homey. It would be great if I could update the status of the cover when the state of the sensor changes.

Thanks.

Baldhor commented 10 months ago

@JoachimVeulemans encryption key => implemented, I'm testing :) Cover => main device I use, so yes it is fully supported, including tilt

JoachimVeulemans commented 10 months ago

The cover is not showing up in the list of unbind native capabilities. Anything wrong in my config?

Also, one small improvement, I have a sensor for the Wi-Fi signal but the capability is missing in the list. I have picked measure_pressure, but it is not entirely correct.

Scherm­afbeelding 2023-08-20 om 14 02 42

Config:

esphome:
  name: REDACTED
  platform: ESP8266
  board: d1_mini
  comment: "RelayBoard001"

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret ota_password

ota:
  password: !secret ota_password

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

  ap:
    ssid: ${devicename}
    password: !secret wifi_password

captive_portal:

web_server:
  port: 80
  auth:
    username: REDACTED
    password: !secret ota_password

sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s

cover:
  - platform: template
    name: "Garage Door"
    open_action:
      # Cancel any previous action
      - switch.turn_off: garagepoort_trigger
      # Turn the OPEN switch on briefly
      - switch.turn_on: garagepoort_trigger
      - delay: 0.3s
      - switch.turn_off: garagepoort_trigger
    close_action:
      # Cancel any previous action
      - switch.turn_off: garagepoort_trigger
      # Turn the OPEN switch on briefly
      - switch.turn_on: garagepoort_trigger
      - delay: 0.3s
      - switch.turn_off: garagepoort_trigger
    optimistic: true
    assumed_state: true

switch:
  - platform: gpio
    pin:
      number: D3
      inverted: true
    name: "Garagepoort"
    id: garagepoort_trigger
Baldhor commented 10 months ago

About capability available: https://apps-sdk-v3.developer.homey.app/tutorial-device-capabilities.html Those are the capability natively supported by Homey 'standard capability'. And there are no wifi in the list.

The good thing with using standard capability is how the capability appear (logo, ...), you can set the tile 'WIFI quality' in the option. Maybe measure_current would better fit your need here.

You can also use the 'number' capability (which is not standard). But then no logo (no idea how to implement that), and it's currently untested (but I will fix any issue encountered).

About your 'cover', which is a garage door, to be honest, I have no idea why the native capability doesn't appear, so please open a separate issue about it. => I will need logs :)

Baldhor commented 10 months ago

I understood why your cover doesn't work, it is not a "position' based cover but a 'open/close' cover ... more like binary. I think I need add support for windowcoverings_closed capability.

I will create an enhancement ticket, but please your log are welcome, I'm unsure I can simulate it.

Baldhor commented 10 months ago

Closing this ticket, initial issue is solved.