[APP][Pro] ESPhome - Control your ESP8266/ESP32 by simple configuration files

Hello,
Just add a topic to share about the ESPhome app for Homey.

It can handle many things: cover, sensor, switch, button, …
But not all ESPhome entity types are supported yet, it all depends if there are any need for them.

Currently supported ESPhome components

  • BinarySensor
  • Button
  • Climate
  • Cover
  • Light: onoff and brightness only
  • Number
  • Select
  • Sensor
  • Switch
  • TextSensor

I need logs or money to implement the others :slight_smile:
image

I wrote a wiki to explain all the concepts, and it includes a user guide:

Just to show off how the Wizard looks like:

4 Likes

Hi,
I have tried to add a ESP8266 device but I get a message
‘Could not connect to the device, or something went wrong’
does it something to do with the code I use or with the board I use?

esphome:
  name: bed_sensor
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "Wi-Fi-netwerk"
  password: "password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bed Sensor Fallback Hotspot"
    password: "gr5Bodv9My"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "MmnLzW2bDYDSLTtaO36eevqciNrIqeZnR50ZrsGLCf8="

ota:
  password: "password"

binary_sensor:
  - platform: gpio
    pin:
      number: D2
      mode: INPUT_PULLUP
      inverted: True
    filters:
      delayed_on_off: 60s
    name: "bed-links"
    device_class: occupancy
  - platform: gpio
    pin:
      number: D3
      mode: INPUT_PULLUP
      inverted: True
    filters:
      delayed_on_off: 60s
    name: "bed-rechts"
    device_class: occupancy

Hello, yes probably because of the encryption key.
Can you try without it?
You can use a password:

api:
  password: !secret ota_password

I will check if I can add support for encryption key

NB: You published your encryption key on the web, you are good to change them lol

Will try tonight, I’m at the beach right now
It’s not the whole key you see there :grinning:

@JeroenD encryption key are now supported : ESPhome | Homey

Hi @Baldhor, it works now. I have removed the encryption. I can’t create a encryption key without =.
And it is not posable to paste the key with ‘=’ in the app.

Only think is I have now 2 devices with one sensor. Is it also possible to create one device with two sensors? The window to add the sensors is really small.

I have removed the encryption. I can’t create a encryption key without =.

It was a small bug on my part, the input field was limited to 20 characters instead of 44 => new test version correct it!

Only think is I have now 2 devices with one sensor. Is it also possible to create one device with two sensors? The window to add the sensors is really small.

With the Wizard driver, you can create 2 “homey” devices linked to one physical device.
But you cannot merge 2 physical devices into one “homey” device.

And yes, the wizard need to show lot of informations but the size available is small on a smartphone :slight_smile:
You can use your computer, and use a console command to double the driver window:

while (window.parent.document.querySelector("[data-is-small-view=true]") !== null) {document.querySelector("[data-is-small-view=true]").attributes["data-is-small-view"].nodeValue = "false";}
1 Like

And one physical device with two sensors in one “homey” device is that possible?
Or only not two general alarm sensors.

That’s 100% possible, I have a test device with over 20 differents entities (sensors, switch, cover, buttons, …), all matched in a single Homey device or not (depend which test I try to do).

1 Like

Indeed it works! Thank you

My ‘slimmelezer’ seems to be offline fairly quick after app restart.
bf3603db-4508-457c-a787-ea89a88d770c

Console.re does not seem to work for me.

I will take a look tonight

1 Like

Slimmelzer use DSMR component to connect to dutch whatever and obtain data.

In you rlog I can see:

2023-08-30T13:45:59.109Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] e[0;36m[D][text_sensor:064]: 'DSMR Identification': Sending state 'Ene5\T211 ESMR 5.0'e[0m
2023-08-30T13:45:59.116Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] e[0;36m[D][text_sensor:064]: 'DSMR Version': Sending state '50'e[0m
2023-08-30T13:45:59.121Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] e[0;33m[W][component:204]: Component dsmr took a long time for an operation (0.06 s).e[0m
2023-08-30T13:45:59.158Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] Device slimmelezer disconnected
...
30 seconds later (which match the reconnection delay!)
...
2023-08-30T13:46:29.217Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] e[0;33m[W][component:205]2	slimmelezer (esphome v2023.8.2)"slimmele
2023-08-30T13:46:29.219Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c5b9067c-c545-40d6-8ff8-477bf824aa21] Error on device slimmelezer: Error: Bad format. Expected 0 at the begin
    at PlaintextFrameHelper.deserialize (/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:33:19)
    at PlaintextFrameHelper.onData (/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:55:36)
    at Socket.<anonymous> (/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:7:47)
    at Socket.emit (node:events:526:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

---- stderr ----

In my current understanding, the connection between your device and the dutch whatever gone wrong, and your device crash/reboot.
At reconnection, it sent a ‘strange’ message to homey which resulted in a bad handling …

kind of a bug chain: bug → worst bug → even worst

You are currently using the old (deprecated driver) for your device, possible to migrate to the wizard driver?
You need to remove your device and redo it using the wizard …
I’m sorry I know it will break some of your flows if any …
But the wizard offer more possibilities and much much more logs …

Remark: I don’t think migration to the wizard will solve the problem, but more logs should help understand and fix it!

As about console.re, there are no reason for it not to work as expected.
Can you try to open the app settings, disable it, save, enable it again, save!
(It will force renew the connection)

I did not see your message here, I’m sorry for the delay.

Here the crash with the new device
caa999c9-66fa-495a-a3e4-f2ac212c0a3d

@Robin_van_Kekem I’m a little naked on this one.

Please open an issue in the github and include your yml configuration!

At start everythings looks fine, then your device seems to “crash”, and when reconnecting, it sends “bad format” message.
I do not have a slimmezer, so I can’t do a lot here.

1/ Can you check your device configuration: DSMR Component — ESPHome
→ Which version you have, …

2/ I noticed you don’t use encryptionKey, maybe it could change the behaviour ?
=> Can you enable encryption and try ?

api:
  encryption:
    key: !secret api_encryption_key

Offcourse: Slimmelezer ESP device keeps crashing periodically · Issue #35 · Baldhor/Homey-ESPhome-Enhanced · GitHub

Thanks for lookin into this. :ok_hand:

I have recently set up an ESPhome connected to my Panasonic heat pump, and originally planned to control it with MQTT, based on this project: GitHub - DomiStyle/esphome-panasonic-ac: Open source alternative for Panasonic air condition wifi adapters that works locally without the Comfort Cloud

When i access the ESPhome web UI i can see the different controls for the heat pump:

However, when i connect to the ESPhome from the Homey App, only the temperature is available in the list of native capabilities.

Is this because the climate component is not added to the app, or is there anything i can do to correct this myself?

My yaml file:

esphome:
  name: panasonic-ac
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: "xx"
  password: "xx"

logger:
  level: DEBUG
#  baud_rate: 0 # ESP8266 only

api:

ota:

# mqtt:
#  broker: 192.168.1.102

web_server:
  port: 80

# Requires ESPHome 1.15.0+ for the even parity option
uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600
  parity: EVEN

external_components:
  source: github://DomiStyle/esphome-panasonic-ac
  components: [panasonic_ac]


climate:
  - platform: panasonic_ac
    # For CZ-TACG1
    type: cnt

    # For DNSK-P11
    # type: wlan

    name: Panasonic AC
    horizontal_swing_select:
      name: Panasonic AC Horizontal Swing Mode
    vertical_swing_select:
      name: Panasonic AC Vertical Swing Mode
    outside_temperature:
      name: Panasonic AC Outside Temperature

    # Enable as needed
    # eco_switch:
    #   name: Panasonic AC Eco Switch
    econavi_switch:
      name: Panasonic AC Econavi Switch
    # nanoex_switch:
    #   name: Panasonic AC NanoeX Switch
    # mild_dry_switch:
    #   name: Panasonic AC Mild Dry Switch
    current_power_consumption:
      name: Panasonic AC Power Consumption

    # Useful when the ac does not report a current temperature (CZ-TACG1 only)
    # current_temperature_sensor: temperature_sensor_id

@Nettopp Hello, Climate component are handled at low level client, but not in the app, I need logs to add support for it.

You need to enable console.re in app setting, and collect the “Received a newentity:,Object{7}”
Once I have the logs, it should take about 1h to implement it.

Please open an enhancement request in github: Issues · Baldhor/Homey-ESPhome-Enhanced · GitHub

It looks like this:

Remark: I am surprised you do not have at least the swiotch and the power consumption in the list …

Thank you for the detailed description, I have opened a request at github.
You are right, the power consumption and the econavi switch is in the list now, I might have forgotten to uncomment those earlier.

Great find! :partying_face:

Nice app! I managed to add my ESPhome devices to Homey and wrote a little how-to.