ginkage / MHI-AC-Ctrl-ESPHome

ESPHome integration for MHI-AC-Ctrl project
MIT License
112 stars 39 forks source link

New Device discovered in HA but no Entities #6

Closed I-Lynx closed 3 years ago

I-Lynx commented 3 years ago

Hi,

I've managed to successfully upload the D1 mini. Home Assistant discovers a new device but there are no entities to control the AC. I must be doing something wrong but I don't know what. Do I need to add something in my configuration.yaml as well??

INFO Connecting to 10.0.14.46:6053 (10.0.14.46) INFO Successfully connected to 10.0.14.46 [21:53:29][I][app:105]: ESPHome version 1.19.4 compiled on Jun 28 2021, 21:52:31

[21:53:29][C][wifi:344]: SSID: '***'[redacted] [21:53:29][C][wifi:345]: IP Address: 10.0.14.46 [21:53:29][C][wifi:347]: BSSID: 68:FF:7B:6F:6E:80[redacted]

[21:53:29][C][wifi:352]: Signal strength: -62 dB ▂▄▆█ [21:53:29][C][wifi:356]: Channel: 1 [21:53:29][C][wifi:357]: Subnet: 255.255.255.0 [21:53:29][C][wifi:358]: Gateway: 10.0.14.254

[21:53:29][C][logger:190]: Level: DEBUG [21:53:29][C][logger:191]: Log Baud Rate: 0 [21:53:29][C][logger:192]: Hardware UART: UART0 [21:53:29][C][mhi_ac_ctrl:043]: MHI-AC-Ctrl Climate 'MHI-AC-Ctrl' [21:53:29][C][mhi_ac_ctrl:044]: Min. Temperature: 16.0°C [21:53:29][C][mhi_ac_ctrl:045]: Max. Temperature: 36.0°C [21:53:29][C][mhi_ac_ctrl:046]: Supports HEAT: YES [21:53:29][C][mhi_ac_ctrl:047]: Supports COOL: YES [21:53:29][C][ota:029]: Over-The-Air Updates: [21:53:29][C][ota:030]: Address: 10.0.14.46:8266 [21:53:29][C][api:095]: API Server: [21:53:29][C][api:096]: Address: 10.0.14.46:6053 [21:53:36][D][api.connection:630]: Client 'Home Assistant 2021.6.6 (10.0.14.6)' connected successfully!

ginkage commented 3 years ago

Does anything show up in "Configuration -> Integrations"? You may need to click "Add Integration" and choose "ESPHome" if nothing is shown there.

I-Lynx commented 3 years ago
Schermafbeelding 2021-06-28 om 22 00 38

Just a device with no entities

ginkage commented 3 years ago

Hm, looks like you're right. I'll need to check if something has changed in ESPHome itself, they could've broken something...

I-Lynx commented 3 years ago

I found a error in the HA logs. Maybe it has something to do with it:

Logger: homeassistant Source: components/esphome/init.py:214 First occurred: 22:17:03 (1 occurrences) Last logged: 22:17:03

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/esphome/init.py", line 214, in on_login entity_infos, services = await cli.list_entities_services() File "/usr/local/lib/python3.8/site-packages/aioesphomeapi/client.py", line 137, in list_entities_services entities.append(cls(**kwargs)) File "", line 9, in init self.supported_modes = __attr_converter_supported_modes(supported_modes) File "/usr/local/lib/python3.8/site-packages/aioesphomeapi/model.py", line 245, in _convert_climate_modes return [ClimateMode(val) for val in value] File "/usr/local/lib/python3.8/site-packages/aioesphomeapi/model.py", line 245, in return [ClimateMode(val) for val in value] File "/usr/local/lib/python3.8/enum.py", line 339, in call return cls.new(cls, value) File "/usr/local/lib/python3.8/enum.py", line 662, in new raise ve_exc ValueError: 6 is not a valid ClimateMode

ginkage commented 3 years ago

Interesting, it's definitely a valid mode: https://github.com/esphome/esphome/blob/dev/esphome/components/climate/climate_mode.h#L23 Gotta dig deeper.

ginkage commented 3 years ago

1 was changed to 6 here: https://github.com/esphome/esphome/commit/ebadaa966016dd9cfbc7fbd3046883ade9be0214#diff-3cc17e2d884f227c82605ff7dae5e504ab117f46f087e32030690e5c5ce350cf this is probably the breaking change...

ginkage commented 3 years ago

...and the answer is probably: https://github.com/esphome/esphome/pull/1933 "the value for AUTO 6 was sent via protobuf but HA doesnt understand it yet" Brilliant...

ginkage commented 3 years ago

OK, I've pushed a new commit, could you check if that works, please?

I-Lynx commented 3 years ago

It Works!!!

I have a entity and I can controll my AC. Can't turn it off yet but I don't know if that is a known issue or not. Will dive in to that when I'm home from work.

ginkage commented 3 years ago

Oops. :) That's what happens when you try to develop without a device to test on. I've added "off" to the list of supported modes, which might fix it.

I-Lynx commented 3 years ago

Haha. No problem.

Works like a charm. You are the best!

Thanx

ginkage commented 3 years ago

Cool, thank you for testing!