Add Support for Fujitsu wireless Air Conditioning control app - FGLair

Out of interest, has anyone had any problems with this recently?

It’s been working flawlessly for me, and then just recently things have stopped working - specifically, with turning on the ‘heat’ function. (I have a ducted Fujitsu split AC that can do both heat and cooling). The weird thing is that I can put it on cool, or dry, and can change the temperature and fan speed, but if I try and put it on heat, it doesn’t work?!

It seemed to be when I upgraded to 0.111, but I don’t know if that is what caused it? Or if it was the update to their app or at their server?

Why only the heat? Any ideas anyone?

Just got my AC units installed, works perfectly with this integration, thanks to all contributors.
For those looking to get the current_temperature:
display_temperature does indeed look like the current temperature in Fahrenheit.

To get it mapped, I modified only climate.py as you can get all properties, including display_temperature from the SplitAC object:

    @property
    def current_temperature(self):
    	cur_temp = self._fujitsu_device._get_prop_from_json('display_temperature', self._fujitsu_device._properties)
    	return round((cur_temp['value'] / 100 - 32) * 5/9, 1)
2 Likes

Hi all, I have tried to get this working multiple times but fail miserably. Before Success!

The raspberry pi 4, 2GB is currently running homeassistant 111.4 on HassOS 4.10 (32bit)

I have followed the instructions from Ole Andor Hansen on the 1/12/19.
These instructions have a small error! The folder should

I used samba to create the folders and copy the files from a windows 10 machine.
I don’t know if my issue is because of this and the permissions are not correct.(?)

If i add the following to the configuration.yaml and reboot then all my other (previously working) climate entities stop working, and the fujitsu doesn’t work either.

climate:
  - platform: fujitsu_general_heatpump
    username: ********@live.com.au
    password: *******
    region: 'us'
    tokenpath: /config/token.txt

If i comment those rungs out of the configuration.yaml then the other climates work and check configuration takes about 1-2 seconds to run.

If i uncomment this and “check configuration” then the check configuration hangs.

Summary of my questions:

  1. Was using samba incorrect cos it may have messed with permissions?
    How do I fix this - or how else do you put those files on?
  2. Should the user name have the full email address?
  3. If I am in Australia and in the FGLair app selected location Australia, do I use region ‘us’?

ls -l on fujitsu_general_heatpump shows all 3 files with -rwxr–r-- permissions
ls -l on pyfujitsu shows all 3 files with - rwxr–r-- permissions

Please let me know if you need me to post any logs or anything.

[Other climate devices that are working include ESPhome connected Mitsubishi ACs and Daikin ACs.]

Edit:
Success!

To answer my own questions.

  1. Permissions were fine.
  2. Yes, User name is the full email address
  3. Yes, even if your region is Australia in the app - use region ‘us’ in the configuration.yaml

What I changed to get it to work:
Right click save link as in git hub doesnt save the file. I am a github noob and couldn’t see how to download the files so i ended up creating the files and copy and pasting the code into them.

I think there is an error in Ole Andor Hansens post on the 1/12/19 which is causing the errors some of the others are getting. The path should be \config\deps\lib\python3.7\site-packages\pyfujitseu (pyfujits’E’u)

Been testing a few days with the additions I posted below, and I can confirm the display_temperature is in Fahrenheit. The temperature closely matches the reading of a temperature sensor of a PIR in the same room.
Apparently there is a C/F setting the technician can set on the unit itself (if the model has a display) so it would make sense the API sends back the same value globally as the unit will convert it depending on the setting.

1 Like

Check your path: \config\deps\lib\python3.7\site-packages\pyfujitseu
(pyfujits’E’u)
I was getting the same error when I had \pyfujitsu

Hey guys,

I did some updates to my code to be conform with ClimateEntity (instead the now deprecated ClimateDevice).
Additionally, I tried to step forward to a more „one click installation“. Therefore, I related my python package pyfujitseu.

You will find the code here: https://github.com/xerxes87/pyfujitsu_for_homeassistant

Unfortunately, the package does not install during Home Assistant requirement resolution. I could not fix this issue right now, maybe somebody can help.

For now, you can install the package by just running

pip install pyfujitseu

Using docker you can use the following Dockerfile (make sure to adapt Home Assistant image to your needs, I’m using RPi4.)


FROM homeassistant/raspberrypi4-homeassistant:stable

RUN pip install --upgrade pip && pip install pyfujitseu

Please share your experiences and let me know if the new solution works for you!

2 Likes

Fixed it. For some reason that I can’t quite figure out, there is a comparison in the plugin that won’t change to ‘heat’ if it thinks it is already on ‘heat’…and for some reason, it always thinks it is on ‘heat’?! So I removed that comparison, and now it works.

It works! thank you

This looks awesome!!!

Any idea when the vent (louvers) positioning is going to be supported by Hassio? I’m using the code from this plugin in a simple AppDaemon that listens to events, enabling me to send the positioning to my AC, but, having it directly supported by Hassio would be awesome!

I was able to install pyfujitseu into the docker image, but it is worth noting that when I upgraded Home Assistant I had to then reinstall pyfujitseu again.

Hi, I am having the same issue. Are you able to post more detail on the change you made?

Perfect it works :slight_smile:

Yeah, this is really annoying.
The only workaround I found is creating the mentioned Dockerfile so that no further manual steps are needed during updates.

Sure. It was in the climate.py file:

     def set_hvac_mode(self, hvac_mode):
        """Set HVAC mode."""
        _LOGGER.debug("FujitsuClimate set_hvac_mode called. self._hvac_mode: %s ; hvac_mode: %s", self._hvac_mode, hvac_mode)
        if(hvac_mode == HVAC_MODE_OFF):
            self._fujitsu_device.turnOff()
        # elif(self._hvac_mode != hvac_mode): # this is the line that I commented out, because the _hvac_mode was always registering as 'heat'; replaced with 'else' below
        else:
            _LOGGER.debug("FujitsuClimate set_hvac_mode elif path called. ")
            self._fujitsu_device.changeOperationMode(hvac_mode)

@philwilldo do you think you could incorporate the ambient into your code - I tested what @tomdb_BE suggested it works perfectly and now I have a lovely ambient temperature shown.

image

Hi @qwackers,
This works only for ACs which support this property. Since mine does not, I can’t accept pull requests which do not make a case distinction.

Copy that @philwilldo - wondering if there is a way to extract the model from the API? Thanks for answering I have a couple of mods in my code 0.5deg temperature and ambient which I can manage - that’s my limit of coding skills :slight_smile:

@tomdb_BE Would you mind submitting a pull request for this to https://github.com/Mmodarre/pyfujitsu_for_homeassistant/?
Mmodarre isn’t very active, but he said he would be willing to check periodically to accept pull requests.

@meichthys Mmodarre’s code hasn’t been updated for a while and due to the new format of custom components, the file structure is different. So I have created a pull request based on a fork of: https://github.com/xerxes87/pyfujitsu_for_homeassistant

I have also added a check on region (based on the config file) in order to ensure US-based users get the current temperature still in Fahrenheit.

While waiting on approval, the updated code can be pulling directly as follows:

git clone https://github.com/tomdb-BE/pyfujitsu_for_homeassistant --single-branch --branch current-temp-support

(I’m not a dev and still finding my way in github. Feedback on mistakes/missed best practices is appreciated :slight_smile: )

2 Likes

@tomdb_BE Thanks! Good idea to submit the pull request to @philwilldo (xerxes87)'s repo. @philwilldo, would you be willing to accept pull requests and keep pyfujitsu and pyfujitsu_for_homeassistant going?