Open Staubgeborener opened 2 years ago
I could fix this by removing the .local
in my config:
{
"platform": "esphome",
"devices": [
{
"host": "bedside-lamp-bedroom",
}
],
},
[16:50:58][D][api:098]: Accepted 192.168.178.34 [16:50:58][D][api.connection:771]: esphome-ts (192.168.178.34): Connected successfully
Maybe because ESPHome is running in docker? I don't know. Logfile still looks like a mess. But my lamp is still not recognized in Homebridge. Does a flag or something like that have to be set in the yaml file?
So this sounds a bit like a DNS issue? To be honest I did not fully understand your setup, but you can try running either
nslookup bedside-lamp-bedroom.local
OR
dig A bedside-lamp-bedroom.local +short
on the machine where you run the homebridge instance (you might have to install these tools).
I also have an issue with this. Using nslookup
confirmed the hostname. Running esphome via docker.
Logs from the plugin:
$ cat /tmp/esphome-log-1679541787428-everything-presence-one-6e6f84.json
{"type":2,"payload":"CAEQBxoyZXZlcnl0aGluZy1wcmVzZW5jZS1vbmUtNmU2Zjg0IChlc3Bob21lIHYyMDIzLjMuMSkiHmV2ZXJ5dGhpbmctcHJlc2VuY2Utb25lLTZlNmY4NA==","time":1679541787847}
{"type":4,"payload":"","time":1679541788058}
{"type":1,"payload":"ChIeZXZlcnl0aGluZy1wcmVzZW5jZS1vbmUtNmU2Zjg0GhFDMDo0OTpFRjo2RTo2Rjo5NCIIMjAyMy4zLjEqFU1hciAyMiAyMDIzLCAyMjozNzozNDIIZXNwMzJkZXZCM0V2ZXJ5dGhpbmdfU21hcnRfVGVjaG5vbG9neS5FdmVyeXRoaW5nX1ByZXNlbmNlX09uZUoFMS4xLjNiCUVzcHJlc3Np","time":1679541788086}
{"type":7,"payload":"","time":1679541848090}
{"type":7,"payload":"","time":1679541908198}
Logs from esphome, note the connection is made in the first line!
[23:23:07][D][api:102]: Accepted 192.168.50.27
[23:23:08][D][api.connection:920]: esphome-ts (192.168.50.27): Connected successfully
[23:23:36][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.4lx
[23:23:36][D][sensor:127]: 'living-room Illuminance': Sending state 5.43307 lx with 1 decimals of accuracy
[23:23:41][D][shtcx:100]: Got temperature=28.20°C humidity=31.87%
[23:23:41][D][sensor:127]: 'living-room Temperature': Sending state 25.19794 °C with 1 decimals of accuracy
[23:23:41][D][sensor:127]: 'living-room Humidity': Sending state 36.87408 % with 1 decimals of accuracy
[23:24:06][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.3lx
[23:24:06][D][sensor:127]: 'living-room Illuminance': Sending state 5.31988 lx with 1 decimals of accuracy
[23:24:36][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.5lx
[23:24:36][D][sensor:127]: 'living-room Illuminance': Sending state 5.54626 lx with 1 decimals of accuracy
[23:24:41][D][shtcx:100]: Got temperature=28.24°C humidity=31.79%
[23:24:41][D][sensor:127]: 'living-room Temperature': Sending state 25.24066 °C with 1 decimals of accuracy
[23:24:41][D][sensor:127]: 'living-room Humidity': Sending state 36.79016 % with 1 decimals of accuracy
[23:24:54][D][binary_sensor:036]: 'living-room PIR': Sending state OFF
[23:24:57][D][binary_sensor:036]: 'living-room PIR': Sending state ON
[23:25:06][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.5lx
[23:25:06][D][sensor:127]: 'living-room Illuminance': Sending state 5.54626 lx with 1 decimals of accuracy
[23:25:36][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.5lx
[23:25:36][D][sensor:127]: 'living-room Illuminance': Sending state 5.54626 lx with 1 decimals of accuracy
[23:25:41][D][shtcx:100]: Got temperature=28.35°C humidity=31.54%
[23:25:41][D][sensor:127]: 'living-room Temperature': Sending state 25.35014 °C with 1 decimals of accuracy
[23:25:41][D][sensor:127]: 'living-room Humidity': Sending state 36.53992 % with 1 decimals of accuracy
[23:25:54][D][binary_sensor:036]: 'living-room PIR': Sending state OFF
[23:25:55][D][binary_sensor:036]: 'living-room PIR': Sending state ON
[23:26:06][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.5lx
[23:26:06][D][sensor:127]: 'living-room Illuminance': Sending state 5.54626 lx with 1 decimals of accuracy
[23:26:08][D][binary_sensor:036]: 'living-room PIR': Sending state OFF
[23:26:21][D][binary_sensor:036]: 'living-room PIR': Sending state ON
[23:26:35][D][binary_sensor:036]: 'living-room mmWave': Sending state OFF
[23:26:36][D][bh1750.sensor:159]: 'living-room Illuminance': Got illuminance=5.5lx
[23:26:36][D][sensor:127]: 'living-room Illuminance': Sending state 5.54626 lx with 1 decimals of accuracy
[23:26:36][D][binary_sensor:036]: 'living-room PIR': Sending state OFF
So I flashed my xiaomi bedside lamp 2 with ESPHome, and it's working great and as expected. This is my yaml file for the device. So yeah, currently no api password. I'll do this later. After that, I started ESPHome with this docker-compose file:
I can flash the device over OTA and see the logfiles, so it's definitly connected with ESPHome:
After that, I installed
homebridge-esphome-ts
(v1.5.1) in homebridge. But all I get is this error in my log file:This is my config file:
So ESPHome is telling me, that my bedside lamp has the name
bedside-lamp-bedroom.local
. Port9001
is not working, same with6053
(default api port) and6052
(my docker container). The readme file is telling mewhich is the default api port for ESPHome. But like I said, I already tried this. Also tried completely without the port-section. Still the same error in my log file.
After adding the
debug
anddiscover
flag to my config (bothtrue
) the content of my log file is now like this:homebridge-esphome-ts
log file:What am I missing here to get the plugin to work?