Bre77 / myair

Home Assistant Climate Integration for MyAir, a ducted air conditioning controller that runs on a wall mounted Android tablet.
10 stars 3 forks source link

Compatibility for MyAir 1 Controllers #13

Closed Venom84 closed 4 years ago

Venom84 commented 4 years ago

It would be great if you were able to integrate the MyAir 1 controller into this integration. I have the MyAir 1 wall mounted Android 10 tablet/screen. I tried the current integration but although i enter the correct IP for the system it wont connect. If you were open to the idea i would be happy to assist you wherever i can and provide the required info since i have the MyAir 1 system.

Bre77 commented 4 years ago

If you go top http://IPADDRESS:2025 do you get any JSON back? If so I need a copy of that.

Venom84 commented 4 years ago

Hey Bre77, Thanks for the quick response. If i have given the wrong data i apologise, I've only recently started with Home Assistant.

If i type in http://192.168.1.152:2025 i get the following error in the HA log...

2020-09-22 11:44:07 ERROR (MainThread) [custom_components.myair.config_flow] Unable to connect to MyAir: Cannot connect to host 192.168.1.152:2025 ssl:default [Connect call failed ('192.168.1.152', 2025)]

If i only type in the IP address then i get the following... Something to note is that if i just enter in the IP in the browser then i do connect to the controller but the only information it gives me is its IP, Gateway and Subnet mask.

2020-09-22 11:44:34 ERROR (MainThread) [aiohttp.server] Error handling request

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start resp = await task File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 169, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 204, in _async_handle_step result: Dict = await getattr(flow, method)(user_input) File "/config/custom_components/myair/config_flow.py", line 32, in async_step_user data = await resp.json(content_type=None) File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1040, in json return loads(stripped.decode(encoding)) File "/usr/local/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 2020-09-22 11:44:34 ERROR (MainThread) [aiohttp.server] Error handling request

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start resp = await task File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 169, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 204, in _async_handle_step result: Dict = await getattr(flow, method)(user_input) File "/config/custom_components/myair/config_flow.py", line 32, in async_step_user data = await resp.json(content_type=None) File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1040, in json return loads(stripped.decode(encoding)) File "/usr/local/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Hope this makes sense. If i need to do something else or get a file please let me know. Thanks again for looking at this one.

HDC67 commented 4 years ago

Just put http://192.168.1.152:2025 into a web browser like Chrome. Click the link from here if you're on the LAN with it now.

Also try http://192.168.1.152:2025/getSystemData

Venom84 commented 4 years ago

Ahh right, should have know it was something easy. If i try the above 2 links it just doesn't connect to anything and says "This site cant be reached". If i only use the IP, without the port i get the following...

getSystemData 0 0
HDC67 commented 4 years ago

Have a look at: https://forums.overclockers.com.au/threads/help-getting-started-with-ac-project.1182337/ https://forums.indigodomo.com/viewtopic.php?f=107&t=15691

See if you can get anything useful from it. Maybe you need to login like the first link?

Looks like the older ones might be quite different in operation. The MyAir 5 uses JSON rather than XML.

Venom84 commented 4 years ago

Ahh right. Ok cool thanks ill have a look at the links and see what i can do/find. Thanks for your help guys, ill let you know how i go.

Venom84 commented 4 years ago

So i had some success with this links!!

typing in... http://192.168.1.152/login?password=password

Got me authenticated and then typing in... http://192.168.1.152/getSystemData

Got me the following data... image

Thanks for your help guys. since its not a JSON file ill close this "Issue" Ill have to figure out another way to integrate it with HA... or upgrade my MyAir1 to a MyAir5.

Bre77 commented 4 years ago

Thanks @ShonkyCH, and yeah @Devon1984 I don't think I am going to support the XML versions. That said you could totally copy my integration as a template and replace all the get and set functions with ones that relate to the XML version.