Add Support for Fujitsu wireless Air Conditioning control app - FGLair

Hi Taylor,

The device seems to be based on .5 degree Celcius increments, what I’ve done is set up automations that use set_temperature commands like ‘70.7’ which work out to nice round Celcius values like 21.5. You could also change code in climate.py to convert F to C, but that’s more work.

I also see this, setting to "auto’ will turn it on. I’ve also found that setting to ‘fan’ and restarting HA (venv) will often make the various hvac modes work again.

Hi there.
I have similar problem.
Can set every AC to COOL, FAN, AUTO but not in HEAT!

Heat is sometimes possible with 1 unit. That 1 unit where it works, is changing every day, always another unit that works in heating with this integration :’(.

Thanks! This helped me. Now heating is possible with all AC units.

hello,

I upgraded to 2022.2 and my setup for the airco’s stopped working.
when i try to restart HA i get the following message:

Platform error climate.fujitsu_general_heatpump - cannot import name ‘ClimateDevice’ from ‘homeassistant.components.climate’ (/usr/src/homeassistant/homeassistant/components/climate/init.py)

i have no idea where to start looking;)

I’m also running 2022.2 and no problems here Im running de code from https://github.com/xerxes87/pyfujitsu_for_homeassistant. You can also try this addon its a different approach though mqtt but same functionality and it updated recently https://github.com/deiger/AirCon

2 Likes

This GitHub - deiger/AirCon: Scripts for controlling Air Conditioners, e.g. with HiSense modules. method is a better solution at this point. It is a a solution that supports many different AC/heat pump units, is well maintained, and should have broader support and reliability. There are still a few little quirks but overall it is quite reliable.

One thing to note: if you Ha instance has more than one network interface, you may need to change the setting int Configuration > General > Network to make things work consistently.

Haven’t found anyone with such issue. Looks like I’m having problems with logging into API.

I did everything as written here: Add Support for Fujitsu wireless Air Conditioning control app - FGLair - #103 by oleandor
My paths:
/home/pi/homeassistant/deps/lib/python3.9/site-packages/pyfujitseu

  • _ _init _ _.py
  • api.py
  • splitAC.py

/home/pi/homeassistant/custom_components/fujitsu_general_heatpump

  • _ _init _ _.py
  • climate.py
  • manifest.json

configuration.yaml
image

Running HomeAssistant in docker version 20.10.14, with HA 2022.4.4

ERROR

Logger: homeassistant.components.climate
Source: deps/lib/python3.9/site-packages/pyfujitseu/api.py:168
Integration: Climate (documentation, issues)
First occurred: 20:40:33 (1 occurrences)
Last logged: 20:40:33

Error while setting up fujitsu_general_heatpump platform for climate
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f83136f40>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='user-field.aylanetworks.com', port=443): Max retries exceeded with url: /users/sign_in.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f83136f40>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/fujitsu_general_heatpump/climate.py", line 83, in setup_platform
    if not fglairapi._authenticate():
  File "/config/deps/lib/python3.9/site-packages/pyfujitseu/api.py", line 108, in _authenticate
    response = self._call_api("POST",
  File "/config/deps/lib/python3.9/site-packages/pyfujitseu/api.py", line 168, in _call_api
    response = requests.request(method, url, data=kwargs.get("json"),headers=kwargs.get("headers"))
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='user-field.aylanetworks.com', port=443): Max retries exceeded with url: /users/sign_in.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f83136f40>: Failed to establish a new connection: [Errno -3] Try again'))

Having similar errors to roxyamaha. Been working on this for days, broke my HA once and had to reinstall and restore, tried multiple tips from this thread…

Logger: homeassistant.components.climate
Source: deps/lib/python3.9/site-packages/pyfujitseu/api.py:164
Integration: Climate (documentation, issues)
First occurred: 5:22:15 PM (1 occurrences)
Last logged: 5:22:15 PM

Error while setting up fujitsu_general_heatpump platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/fujitsu_general_heatpump/climate.py", line 83, in setup_platform
    if not fglairapi._authenticate():
  File "/config/deps/lib/python3.9/site-packages/pyfujitseu/api.py", line 105, in _authenticate
    response = self._call_api("POST",
  File "/config/deps/lib/python3.9/site-packages/pyfujitseu/api.py", line 164, in _call_api
    response.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://user-field.aylanetworks.com/users/sign_in.json

Same

I did everything as written here: Add Support for Fujitsu wireless Air Conditioning control app - FGLair - #103 by oleandor

Similar

My paths:
\192.168.0.33\config\deps\lib\python3.9\site-packages\pyfujitseu

_ _init _ _.py
api.py
splitAC.py

configuration.yaml

climate:
  - platform: fujitsu_general_heatpump
    username: '[email protected]'
    password: 'xxxxxxxxx'
System Health

version: core-2022.4.7
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.9
os_name: Linux
os_version: 5.10.103-v8
arch: aarch64
timezone: Australia/Melbourne


GitHub API: ok
GitHub Content: ok
GitHub Web: ok
GitHub API Calls Remaining: 4739
Installed Version: 1.24.5
Stage: running
Available Repositories: 1099
Downloaded Repositories: 13


logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok


host_os: Home Assistant OS 7.6
update_channel: stable
supervisor_version: supervisor-2022.04.0
docker_version: 20.10.9
disk_total: 28.6 GB
disk_used: 2.9 GB
healthy: true
supported: true
board: rpi4-64
supervisor_api: ok
version_api: ok
installed_addons: Samba share (9.6.1), Terminal & SSH (9.4.0), File editor (5.3.3), Ring-MQTT with Video Streaming (4.9.1), Mosquitto broker (6.0.2)


dashboards: 3
resources: 5
views: 3
mode: storage

Tim, have you tried this yet?

It has more development. The old integration hasn’t been updated in almost two years.

Thanks, yes, tried that a couple of times. I get

E0503 22:48:36.339  discovery.py:43] Failed to login to Hisense server:
Status 401: 'Unauthorized'

I think it’s because I’m in Aus and the app codes are wrong, tried using a US based app code and I had some control but the controls were all over the place, most of it didn’t work. can’t recreate that, must be thinking of something else. I’ve tried that many combinations to get this working I’m falling over myself.

It looks a better integration, if it works in Australia I’d use it for sure. I haven’t gone through all the available codes yet, perhaps one of them will work for me.

I just got it (deiger) to load using fglair-us as the app code, I can start/stop it, set it to auto, heat, cool, but the temp is set at -4 deg C, can’t change it. So still not useable.

Interesting. Can actually change the temp it just doesn’t like the default card slider. Set it to -4 deg C in Home Assistant, FGLair on my phone displays 25 deg C. It’s definitley heating.

-4 deg C is 25 deg F so it’s just a display issue.

1 Like

Maybe you could report it on the deiger repo. I also noticed that it was displaying in C even though my locale was F, but i think i got that sorted.

Good idea. I’ve done that, hopefully it gets some attention.

Meanwhile I wouldn’t mind having a play with the code myself, but I can’t find where the .py files are kept in Home Assistant. For instance one of the files is aircon.py but if I open a terminal on my HA install and run

find ./ -iname "aircon.py"

nothing is returned.

Any suggestions on where to find the scripts for this add in?

Just to update this for anyone else arriving here, the deiger add in is working perfectly for me now. I uninstalled it and deleted the json config file, restarted HA, reinstalled and configured - displaying set temperature in degrees C now, basic control of the A/C is all working.

Ensure mqtt broker is installed correctly. I’m using Mosquitto.

Install deiger add in as per instructions.

I’m in Aus but using fglair-us as the app code.

Edit /config/hisense/config_ac000w000768786.json

and change "temp_type": "F" to "temp_type": "C"

The ac000w000768786 part is the unit id generated by my ac unit, others will probably be different.

1 Like

Will this add-on work if I’m not using MQTT at all? I’ve just installed it and I’m attempting to configure/start, but I have no MQTT authentication, and no idea what the port would be.

EDIT: I’ve started my MQTT broker–it’s been installed for months, but I’ve never had a need to run it–and see the available ports. However, with a valid HA user and password, I’m unable to get the HiSense add-on to start with any of the ports:

Failed to save add-on configuration, Missing option 'app' in root in HiSense Air Conditioners (c34eddb3_hisense_ac). Got {'log_level': 'INFO', 'mqtt_host': 'core-mosquitto', 'mqtt_user': 'xxxxxxxxx', 'mqtt_pass': 'xxxxxx', 'port': 8884}

I’ve removed and re-installed the add-on from the repository, and I don’t get a HiSense folder added to \config.

You can set user name and password in the config tab of the MQTT addon read the documentation of the addon its very easy to set. just add

  • username: user
    password: pwd

This doesn’t seem to be my problem. I have MQTT running, from what I can tell. The issue is that I get this error on starting up the deiger add-on:

“Failed to save add-on configuration, Missing option ‘app’ in root in HiSense Air Conditioners (c34eddb3_hisense_ac). Got {‘log_level’: ‘INFO’, ‘mqtt_host’: ‘core-mosquitto’, ‘mqtt_user’: ‘xxxxxxxxx’, ‘mqtt_pass’: ‘xxxxxxxxxxx’, ‘port’: xxxx}”

Yes probably because you didnt set a user name and password for the mqtt addon the mqtt addon will run/work without but aircon only works if user and password are set. See the configuration tab of the mqtt addon and there add an username password of your own choosing then add that user and password to the configuration of the dreiger aircon addon

1 Like