ESPHome binding for the Native API

logo

Binding that communicates with ESPHome flashed devices using the api protocol as an alternative to mqtt.

Latest OH jars can be found here

README

Note that the binding is continously updated, but the changelog below will only be updated in case of breaking or notable changes. To see what’s happening, read the commit log

Streaming support for device logs (04.04.2024)

Important change (29.03.2024):

  • Added support for encrypted communication. At the same time plaintext passwords are now deprecated and will trigger a log warning. Big thanks to @amandel !

Breaking changes (09.12.2023):

  • Climate component channel names now includes component name. Example: esphome:device:mydevice:<climate component name>#<channel name>. Note that this only applies to channels related to the climate entity, and not any auxilliary channels added by some AC integrations (ie power consumption, vane control etc)

Arne

19 Likes

Great idea. I have several spare ESP-01S that can be used to test.

You mean, you’re willing to work on a binding for esphome?

I have a bunch of sensors laying around that esphome has great compatibility with that I would be more than glad to help test :slight_smile:

The way I read it, @seime is going to add support to openHAB for speaking ESPhome’s native API, not the other way around.

1 Like

First build with just some initial support;
Docs - READ FIRST

Jar file for 3.4.X

5 Likes

I’m using OH4, is this jar compatible ?

Dont think so, no addons.xml yet. I’ll add one in a few days.

An easy way to integrate micro-controller powered sensors into OH would be great! A couple years ago, I managed to build a light sensor on a esp8266 and using MQTT to connect, it still runs the lighting in my flat (using OH of course). But I very quickly ended up over my head and became frustrated.
I had looked at espeasy and a few others but JustinG mentioning ESPHome a couple months ago prompted me to take another look. I found the instructions found here for installing the web interface in a Docker to be the easiest way to get started. Instead of the API built for HA, I just used my already running MQTT server.

1 Like

Ain’t that the truth. Though I persisted and now I’m having fun with presence sensors, atmospheric sensors and some other bits and bobs.
Having esphome would be simply amazing thanks to the amount of work the devs have put into it and the ease of adopting new devices.
I’m looking forward to this :smiley:

The dashboard can be installed as an HA add-in. Does the OP plan such integration for OH?
For me, the dashboard was very intuitive and gave many more visual cues then the arduino IDE. It made commissioning multiple sensors around the flat super easy and over the air updates are cooked in. It asks a few simple questions and then writes the initial yml file for you.

Good on ya :+1:
For me, it provided enough successes that I got confident enough to go back to the Arduino IDE and attempt much more complex projects

1 Like

Do not know how to add another menu entry to mainui, anyone knows and want to contribute?

My plan is to add support for more types of devices, next out is probably the aircon type so i can get rid of Panasonic and Mitsubishi cloud services.

Cheers

What do you mean with another menu entry ?
I don‘t think we are going to have binding spcefic menu entries in mainUI, as they cannot be added or removed dynamically.
That‘s one of the reasons for existence of shelly manager servlet.
Those servlets can then be added to the tiles menu.

1 Like

I was thinking on the left hand menu. Not familiar with the Shelly approach, I know about the special link but found that in the docs, not via mainui.

I’ll check out tiles.

As said, that’s not dynamic so not possible I am afraid.

Tested it now on the latest 4 snapshot. Seems to run well

EDIT: OH started complaining

Hi,

Thnks for the binding.
I installed the binding via console, then found the ESP32, added as thing, but get the following error:

Thing ‘esphome:device:esp32’ changed from UNKNOWN: Connecting to 192.168.1.201:6053 to OFFLINE (COMMUNICATION_ERROR): Parse error

Any idea?
Thank a lot

Patrick

Just guessing; your ESPHome config is using encryption which isn’t supported by the binding yet

@seime
Thanks for reply.
I try remove the encryption and it goes online in OH.
Will try add sensor to it and test.
Thanks a lot !

Hello! Great effort, i’ve been of thinking the same. Got a smart plug.

Great job, i’ve successfully backported it to 3.2 and run in demoapp. Found my ESPHome-ified plug like a charm.

I’ll polish it up a bit, test on my real system, and release the build if you don’t mind.

The repo is here: GitHub - Sonic-Amiga/openhab-esphome at openhab-3

1 Like