Secrets:
EU
"FGLair-eu-gpFbVBRoiJ8E3QWJ-QRULLL3j3U"
US
"CJIOSP-Vb8MQL_lFiYQ7DKjN0eCFXznKZE"
CH
"FGLairField-cn-zezg7Y60YpAvy3HPwxvWLnd4Oh4"
App Ids:
EU
"FGLair-eu-id"
US
"CJIOSP-id"
CH
"FGLairField-cn-id"
Urls change too:
would be
API_BASE_URL = "https://ads-eu.aylanetworks.com/apiv1/"
API_GET_ACCESS_TOKEN_URL = "https://user-field.aylanetworks.com/users/sign_in.json"
would be
API_GET_ACCESS_TOKEN_URL = "https://user-field-eu.aylanetworks.com/users/sign_in.json"
I don’t have access to another region one so can’t help more than the above but hopefully that helps someone.
The server info worked once I found that I had to edit the correct api.py file. This: c:\Users\OleAndor\AppData\Roaming.homeassistant\deps\Python36\site-packages\pyfujitsu Not this: c:\Windows\SysWOW64\homeassistant\Lib\site-packages\pyfujitsu\
I also had to tweak the climate.py in:
c:\Users\OleAndor\appdata\Roaming.homeassistant\custom_components\fujitsu_general_heatpump'
Since I got a lot of errors. For now I just commented out some code.
Typical error:
Traceback (most recent call last):
File “C:\Users\OleAndor\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\helpers\service.py”, line 291, in handle_service_platform_call
await func(entity, data)
File "C:\Users\OleAndor\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\climate_init.py", line 556, in async_service_aux_heat
await entity.async_turn_aux_heat_on()
File “C:\Users\OleAndor\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\climate_init_.py”, line 482, in async_turn_aux_heat_on
return self.hass.async_add_job(self.turn_aux_heat_on)
File “C:\Users\OleAndor\AppData\Roaming.homeassistant\custom_components\fujitsu_general_heatpump\climate.py”, line 177, in turn_aux_heat_on
self._fujitsu_device.powerfull_mode_on()
File “C:\Users\OleAndor\AppData\Roaming.homeassistant\deps\Python36\site-packages\pyfujitsu\splitAC.py”, line 69, in powerfull_mode_on
self.powerful_mode = 1
File “C:\Users\OleAndor\AppData\Roaming.homeassistant\deps\Python36\site-packages\pyfujitsu\splitAC.py”, line 233, in powerful_mode
self._api._set_device_property(self.powerful_mode[‘key’],properties)
TypeError: ‘NoneType’ object is not subscriptable
Awesome! Good to hear - I almost didn’t share those details as wasn’t sure it would help anyone so glad to know it did.
I’m getting the same issues you describe (US unit) and did something similar so I assume it’s an issue introduced recently with HA as no one else appears to have reported it.
On a semi-related tangent, has anyone had any success with hard wiring their Fujitsu ducted air into Home Assistant? We have the wall controller for our one, and the installer said we can’t have both that and the wifi controller as the unit can’t handle both. So, I’m looking at the other options - IR being a fallback, but they seem to have a connector kit (UTD-ECS5A) that I thought I might be able to connect to a Raspberry Pi or something…
I’m so glad you did! And also, you helped me understand how you got to the info. I’ve never decompiled an APK before, but maybe I’ll give it a try.
I’ll let you know if I can fix the nonetype errors.
I also have a similar case for which I want to connect my Electrolux washing machine. The washing machine is connected to an electrolux app. I want to be able to get a notification when the washer is done. Maybe I can decompile the electrolux app to get similar info. I’ve done some packet sniffing, so I know there are some json files flying around. However some of the packets are SSL encrypted, so I guess that means that I have to log in somehow.
Hmm… didnt work the second time (after sd card crash)
This made it work now:
Edit the tolken.txt in the api file to the a full path and give the all users read/write access to the path according to the link below:
e class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/29331872/ioerror-errno-13-permission-denied">
stackoverflow.com
Could do with some pointers to run Mmodarre’s excellent code, to be able to at least for the time being switch on and off my (New Zealand based) Fujitsu WiFi heat pump initially without HASS!
FGLair is currently working with the pump, no problems.
I tried running this Python code (apologies re spacing):
import logging import pyfujitsu.api as fgapi from pyfujitsu import splitAC
fglairapi = fgapi.Api(“email”,“pass”) if not fglairapi._authenticate(): _LOGGER.error(“Unable to authenticate with Fujistsu General”) devices = fglairapi.get_devices_dsn() for dsn in devices: print(dsn) mydsn = dsn myhp = splitAC.splitAC(mydsn,fglairapi) print (myhp.device_name[0][‘property’][‘key’]) myhp.turnOn()
To get this to run I have to change line 46 (or so) in splitAC.py from: datapoints = self._get_device_property_history(self.operation_mode[‘key’])
(which tries to get a key from a list rather than a dictionary) to: datapoints = self._get_device_property_history(self.operation_mode[5][‘property’][‘key’])
Then the code appears to run ok, no errors, prints everything ok (key etc), but doesn’t turn the heat pump on.
Looks like nothing is being executed to actually apply the properties over the air.
What else do I need to do to turn it on? Any ideas?
I‘m using a modified version of this wonderful plugin for some time now.
I nearly finished updates for changes in 0.96, fixes for swing modes and update for localization. For the last point countries with URLs, Secrets and App-Ids as posted by @kyonz appreciated.
Looking forward it seeing this update. Would you guys want some Beta testers for the updated version? I am assuming it will only work on 0.96 and above?