Add Support for Fujitsu wireless Air Conditioning control app - FGLair

It doesn’t look like your code on github has the current_temperature code(?)

@meichthys not in master branch, you will need to select the custom-temperature branch. It is up to the owner of the addin to decide to put this code in master.
Direct link to branch:

Gotcha, Thanks. Works like a charm.
image

@philwilldo Would you like to work together on making this an official integration? I’ve gone through the process once with the ‘Nextcloud’ integration, and i think this would be a nice contribution as a core integration. If you think this would be something worth doing, pm me on Discord @meichthys

1 Like

Hi @thecrane, I only just got around to testing your code change, and yes it works for me as well.

Still no luck here… reinstalled pyfujitseu in /config/deps/lib/python3.7/site-packages and altered all files contributed by @tomdb_BE but still get the error ‘Platform error climate.fujitsu_general_heatpump - No module named ‘pyfujitseu’’ when checking the config through ‘validate configuration’.

Put it in python3.8 folder.

Oh boy… I renamed that folder to python3.8. Now no errors anymore, but still an “unavailable” AC unit…

In the logs I get:

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 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.8/asyncio/tasks.py”, line 483, in wait_for
return fut.result()
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/fujitsu_general_heatpump/climate.py”, line 90, in setup_platform
add_entities(FujitsuClimate(fglairapi, dsn, region) for dsn in devices)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 234, in _schedule_add_entities
list(new_entities),
File “/config/custom_components/fujitsu_general_heatpump/climate.py”, line 90, in
add_entities(FujitsuClimate(fglairapi, dsn, region) for dsn in devices)
File “/config/custom_components/fujitsu_general_heatpump/climate.py”, line 110, in init
self._current_temperature = self.current_temperature
File “/config/custom_components/fujitsu_general_heatpump/climate.py”, line 146, in current_temperature
return round((curtemp[‘value’] / 100 - 32) * 5/9, 1)
TypeError: ‘NoneType’ object is not subscriptable

Looks like the pyfujiseu API is not correctly installed. The API is not included in the integration.
If I find some time, I should try to include it (if this is ok for the author, who will be credited of course)

More dirty solution would be to just run

pip install pyfujitseu

The pyfujitseu folder (with 3 files inside) containing the API, should be in your site packages (path my vary depending on OS):
/usr/lib/python3.8/site-packages/pyfujitseu/init.py
/usr/lib/python3.8/site-packages/pyfujitseu/api.py
/usr/ib/python3.8/site-packages/pyfujitseu/splitAC.py

All files are in place in: /config/deps/lib/python3.8/site-packages/pyfujitseu

init.py is called init.py.
Should I rename that one too?

Edit: nevermind, the __ makes “init” in bold, just like in your comment :wink:

after I copy all 3 files to /config/deps/lib/python3.8/site-packages/pyfujitseu. the currently temperature show funny amount 68C should be around 20C

@Leon_Li I think you will find the temperature is showing Fahrenheit instead of Celsius in your config do you have region set to US? 68F = 20C…

Hi everyone.
I kinda went through the posts, but I am not a developer and I am slightly confused. :grinning:
I am using Home Assistant 0.116.1 and I am wondering, which is the latest and greatest set if instructions to get this thing working?
Thanks in advance!

You’re absolutely fine. Go ahead and include!

Hi,

It does’t matter what I do, home assistant is still unable to find the python module:
Platform error climate.fujitsu_general_heatpump - No module named ‘pyfujitseu’

The pyfujitseu folder is present everywhere now:

python2.7/dist-packages/pyfujitseu
python2.7/site-packages/pyfujitseu

I created folders named python3.7 and python3.8 and copied the dist-packages and site-packages into those too. It is still not working.
There are 6 files inside the pyfujitseu, three .py and three .pyc files (init, api, splitAC)

Please help. :frowning:
Thanks.

What type of HA install do you have?

I am using Home Assistant 0.116.0 running on a Rasberry 4.0. I have Python 2.7.16.
Does this answer your question?
Thanks in advance.

Is that the Home Assistant OS (HASS.IO) on the Pi, or are you running on top of another Linux OS? If you are running on another Linux distro Python 2.7 will not work. Pyhton 3.8 or higher is needed.

I installed the Rasberry PI linux. So I need to upgrade python then?
Is there any chance I break anything?
Thanks

Sorry for the lack of reply. I imagine if you are only running HA on the machine you shouldn’t break anything else.