bm1549 / home-assistant-frigidaire

Custom component for the Frigidaire integration
MIT License
34 stars 11 forks source link

Dehumidifier (FGAC7044U1) No Longer Available after Update #49

Closed sirjmann92 closed 7 months ago

sirjmann92 commented 8 months ago

I have a Frigidaire FGAC7044U1 dehumidifier that is no longer detected after the recent update to correct the login issues/API changes. The dehumidifier is displayed in the Frigidaire app, connected to the same WiFi, and verified working properly.

My Frigidaire Portable AC is detected and working, but the dehumidifier is no longer available in HA.

Thank you for the quick update for the auth issue!

ha-elguano commented 8 months ago

I have the Frigidaire FGAC5044W1 and am facing the same thing.

I noticed in @rothn's revisions there is the following comment in humidifier.py:

_LOGGER.warning("Humidifier support temporarily disabled due to an API change and " "lack of test hardware") """ Setting the humidity on the humidifier will raise a FrigidaireException explaining the feature is not implemented because @rothn does not have one of their humidifiers to test on. For the same reason, it's also possible that the humidifier Destination is not correctly detected.

These issues should be somewhat easily solvable by someone who has a compatible
humidifier manually calling `get_appliance_details()` on a humidifier, inspecting the
output, then making and testing changes based on climate.py. This can be easily
achieved with the frigidaire API in a Jupyter notebook.

async_add_entities(
    [
        FrigidaireDehumidifier(client, appliance)
        for appliance in appliances
        if appliance.destination == frigidaire.Destination.DEHUMIDIFIER
    ],
    update_before_add=True,
)

"""

My layman's read of this is that the current fix doesn't account for dehumidifiers or humidifiers. But it seems there is a somewhat straightforward solution given the work needed to get it working on the ACs!

rothn commented 8 months ago

Yes! If you're willing to do some Python work, I can send a Jupyter notebook for you to run that will capture the information I need to fix this for you. I'll then help you test the changes before we get them merged into main.

Some context: Last week, Frigidaire turned down the API that this plugin used (ECP) in favor of a new one (OCP) in the U.S. Previously, the maintainer temporarily worked around the issue in June 2023 by switching regions from LATAM to US: https://github.com/bm1549/frigidaire/commit/3b8e3541f69eb1ad878d18dc5a4b070702ad8534.

Because the changes were significant, I had to make minor changes to a dependency of this repo to account for the different level and format of information exposed by the new API. Information from people such as yourself can help get this working on more devices-- I only had a window AC unit available for testing.

If you are on Matrix, I can be reached for chat at @nicholasroth:nicholasroth.net so we can coordinate more easily. Otherwise, please let me know here if you would be willing to help.

sarahemm commented 8 months ago

I'm facing the same issue with a slightly different dehumidifier model, I'm not on Matrix but happy to help any way I can!

rothn commented 8 months ago
  1. Open this Colab notebook: https://colab.research.google.com/drive/1T7C-u8sN5P_WW1dnS6rIv4mrP-Gp48xY#scrollTo=H8TLlFsI0gsx
  2. Modify the "username" and "password" field to contain your Frigidaire username (email) and password. image
  3. Run each Colab cell by clicking Runtime -> Run All. image You should see something like this: image
  4. Copy the output of the last cell into your clipboard and paste it into Github, removing any sensitive details image

Here's what mine looks like. Please post yours in the comments. Notice how I've replaced my appliance ID with "\<REDACTED>":

======= APPLIANCE 0  =======
==============================
###APPLIANCE CLASS STATE###
appliance_id: <REDACTED>
appliance_type: AC
destination: AC
nickname: Window AC
###APPLIANCE DETAILS###
{
    "cleanAirMode": "OFF",
    "sleepMode": "OFF",
    "applianceInfo": {
        "applianceType": "AC"
    },
    "temperatureRepresentation": "FAHRENHEIT",
    "applianceUiSwVersion": "v3",
    "uiLockMode": false,
    "targetTemperatureF": 72.0,
    "targetTemperatureC": 22.22222222222222,
    "applianceState": "OFF",
    "mode": "OFF",
    "alerts": [],
    "ambientTemperatureF": 50.0,
    "filterState": "CHANGE",
    "fanSpeedSetting": "AUTO",
    "networkInterface": {
        "swVersion": "v3.0.0_argo",
        "otaState": "IDLE",
        "linkQualityIndicator": "EXCELLENT",
        "niuSwUpdateCurrentDescription": "A21023902A-S00007029A",
        "swAncAndRevision": "S00007029A"
    },
    "verticalSwing": "OFF",
    "fanSpeedState": "LOW",
    "ambientTemperatureC": 10.0,
    "connectivityState": "connected"
}
###APPLIANCE CAPABILITIES###
{
    "alerts": {
        "access": "read",
        "type": "alert",
        "values": {
            "BUCKET_FULL": {},
            "BUS_HIGH_VOLTAGE": {},
            "COMMUNICATION_FAULT": {},
            "DC_MOTOR_FAULT": {},
            "DC_MOTOR_LOST_SPEED": {},
            "DRAIN_PAN_FULL": {},
            "INDOOR_DEFROST_THERMISTOR_FAULT": {},
            "PM25_SENSOR_FAULT": {},
            "TUBE_HIGH_TEMPERATURE": {},
            "UNKNOWN_STATE_ERROR": {}
        }
    },
    "ambientTemperatureC": {
        "access": "read",
        "type": "temperature"
    },
    "ambientTemperatureF": {
        "access": "read",
        "type": "temperature"
    },
    "applianceState": {
        "access": "read",
        "type": "string",
        "values": {
            "OFF": {},
            "RUNNING": {}
        }
    },
    "applianceUiSwVersion": {
        "access": "read",
        "type": "string"
    },
    "executeCommand": {
        "access": "write",
        "schedulable": true,
        "type": "string",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "fanSpeedSetting": {
        "access": "readwrite",
        "schedulable": true,
        "type": "string",
        "values": {
            "AUTO": {},
            "HIGH": {},
            "LOW": {},
            "MIDDLE": {}
        }
    },
    "fanSpeedState": {
        "access": "read",
        "type": "string",
        "values": {
            "HIGH": {},
            "LOW": {},
            "MIDDLE": {}
        }
    },
    "filterState": {
        "access": "read",
        "type": "string",
        "values": {
            "BUY": {},
            "CHANGE": {},
            "CLEAN": {},
            "GOOD": {}
        }
    },
    "mode": {
        "access": "readwrite",
        "schedulable": true,
        "triggers": [
            {
                "action": {
                    "fanSpeedSetting": {
                        "access": "readwrite",
                        "values": {
                            "HIGH": {},
                            "LOW": {},
                            "MIDDLE": {}
                        }
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "FANONLY",
                    "operator": "eq"
                }
            },
            {
                "action": {
                    "fanSpeedSetting": {
                        "access": "readwrite",
                        "values": {
                            "AUTO": {},
                            "HIGH": {},
                            "LOW": {},
                            "MIDDLE": {}
                        }
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "FANONLY",
                    "operator": "ne"
                }
            },
            {
                "action": {
                    "targetTemperatureC": {
                        "disabled": true,
                        "type": "temperature"
                    },
                    "targetTemperatureF": {
                        "disabled": true,
                        "type": "temperature"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "FANONLY",
                        "operator": "eq"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "5",
                        "operator": "eq"
                    },
                    "operator": "or"
                }
            },
            {
                "action": {
                    "targetTemperatureC": {
                        "disabled": false,
                        "type": "temperature"
                    },
                    "targetTemperatureF": {
                        "disabled": false,
                        "type": "temperature"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "FANONLY",
                        "operator": "ne"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "5",
                        "operator": "ne"
                    },
                    "operator": "and"
                }
            },
            {
                "action": {
                    "fanSpeedSetting": {
                        "disabled": true
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "6",
                    "operator": "eq"
                }
            },
            {
                "action": {
                    "fanSpeedSetting": {
                        "disabled": false
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "6",
                    "operator": "ne"
                }
            },
            {
                "action": {
                    "sleepMode": {
                        "access": "read"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "FANONLY",
                        "operator": "eq"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "5",
                        "operator": "eq"
                    },
                    "operator": "or"
                }
            },
            {
                "action": {
                    "sleepMode": {
                        "access": "readwrite"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "FANONLY",
                        "operator": "ne"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "5",
                        "operator": "ne"
                    },
                    "operator": "and"
                }
            }
        ],
        "type": "string",
        "values": {
            "COOL": {},
            "ECO": {},
            "FANONLY": {},
            "OFF": {
                "disabled": true
            }
        }
    },
    "networkInterface": {
        "command": {
            "access": "write",
            "type": "string",
            "values": {
                "APPLIANCE_AUTHORIZE": {},
                "START": {},
                "USER_AUTHORIZE": {},
                "USER_NOT_AUTHORIZE": {}
            }
        },
        "linkQualityIndicator": {
            "access": "read",
            "type": "string",
            "values": {
                "EXCELLENT": {},
                "GOOD": {},
                "POOR": {},
                "UNDEFINED": {},
                "VERY_GOOD": {},
                "VERY_POOR": {}
            }
        },
        "niuSwUpdateCurrentDescription": {
            "access": "read",
            "type": "string"
        },
        "otaState": {
            "access": "read",
            "type": "string",
            "values": {
                "DESCRIPTION_AVAILABLE": {},
                "DESCRIPTION_DOWNLOADING": {},
                "DESCRIPTION_READY": {},
                "FW_DOWNLOADING": {},
                "FW_DOWNLOAD_START": {},
                "FW_SIGNATURE_CHECK": {},
                "FW_UPDATE_IN_PROGRESS": {},
                "IDLE": {},
                "READY_TO_UPDATE": {},
                "UPDATE_ABORT": {},
                "UPDATE_CHECK": {},
                "UPDATE_ERROR": {},
                "UPDATE_OK": {},
                "WAITINGFORAUTHORIZATION": {}
            }
        },
        "startUpCommand": {
            "access": "write",
            "type": "string",
            "values": {
                "UNINSTALL": {}
            }
        },
        "swAncAndRevision": {
            "access": "read",
            "type": "string"
        },
        "swVersion": {
            "access": "read",
            "type": "string"
        }
    },
    "sleepMode": {
        "access": "readwrite",
        "type": "string",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "targetTemperatureC": {
        "access": "readwrite",
        "default": 15.56,
        "max": 32.22,
        "min": 15.56,
        "schedulable": true,
        "step": 1.0,
        "type": "temperature"
    },
    "targetTemperatureF": {
        "access": "readwrite",
        "default": 60.0,
        "max": 90.0,
        "min": 60.0,
        "schedulable": true,
        "step": 1.0,
        "type": "temperature"
    },
    "temperatureRepresentation": {
        "access": "readwrite",
        "type": "string",
        "values": {
            "CELSIUS": {},
            "FAHRENHEIT": {}
        }
    },
    "uiLockMode": {
        "access": "readwrite",
        "type": "boolean",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "verticalSwing": {
        "access": "readwrite",
        "type": "string",
        "values": {
            "OFF": {},
            "ON": {}
        }
    }
}
rothn commented 8 months ago

@sarahemm @ha-elguano @boctok @sirjmann92

Since I don't have a dehumidifier, I need your help completing the above steps to make dehumidifiers work with the new API. Thanks! The data from just one person should probably be enough, but more is better. Just be mindful of your privacy, and don't post anything you don't feel comfortable sharing.

ha-elguano commented 8 months ago

@rothn , thank you for the detailed instructions here, as well as your willingness to help! I'm happy to jump in to help capture data as well.

QQ - how does running the collab cells gather the data? Is it because we have dehumidifiers registered with Frigidaire Cloud, and this will pull the necessary data from the Cloud responses to the Collab calls?

In other words, there's no need for an actual networked connection to the dehumidifier hardware, correct?

ha-elguano commented 8 months ago

@rothn Here's mine from an FGAC5044W1 Dehumidifier:

======= APPLIANCE 0  =======
==============================
###APPLIANCE CLASS STATE###
appliance_id: <REDACTED>
appliance_type: DH
destination: DH
nickname: Dehumidifier
###APPLIANCE DETAILS###
{
    "targetHumidity": 40,
    "cleanAirMode": "OFF",
    "applianceInfo": {
        "applianceType": "DH"
    },
    "displayLight": "DISPLAY_LIGHT_1",
    "uiLockMode": false,
    "applianceState": "OFF",
    "FilterState": "GOOD",
    "mode": "OFF",
    "alerts": [],
    "filterState": "GOOD",
    "cleanFilterAlert": "KEY_ERROR",
    "fanSpeedSetting": "LOW",
    "networkInterface": {
        "otaState": "IDLE",
        "linkQualityIndicator": "EXCELLENT",
        "swVersion": "v1.9.1_srac",
        "swAncAndRevision": "S00006778A",
        "niuSwUpdateCurrentDescription": "A16323311A-S00006778A"
    },
    "sensorHumidity": 45,
    "verticalSwing": "OFF",
    "stopTime": -1,
    "startTime": -1,
    "waterBucketLevel": 0,
    "connectivityState": "connected"
}
###APPLIANCE CAPABILITIES###
{
    "alerts": {
        "access": "read",
        "type": "alert",
        "values": {
            "BUCKET_FULL": {},
            "BUS_HIGH_VOLTAGE": {},
            "COMMUNICATION_FAULT": {},
            "PM25_SENSOR_FAULT": {}
        }
    },
    "applianceState": {
        "access": "read",
        "type": "string",
        "values": {
            "OFF": {},
            "RUNNING": {}
        }
    },
    "cleanAirMode": {
        "access": "readwrite",
        "schedulable": true,
        "type": "string",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "displayLight": {
        "access": "readwrite",
        "schedulable": true,
        "type": "string",
        "values": {
            "DISPLAY_LIGHT_0": {},
            "DISPLAY_LIGHT_1": {}
        }
    },
    "executeCommand": {
        "access": "write",
        "schedulable": true,
        "type": "string",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "fanSpeedSetting": {
        "access": "readwrite",
        "schedulable": true,
        "type": "string",
        "values": {
            "HIGH": {},
            "LOW": {},
            "MIDDLE": {}
        }
    },
    "fanSpeedState": {
        "access": "read",
        "type": "string",
        "values": {
            "HIGH": {},
            "LOW": {},
            "MIDDLE": {}
        }
    },
    "filterState": {
        "access": "read",
        "type": "string",
        "values": {
            "BUY": {},
            "CHANGE": {},
            "CLEAN": {},
            "GOOD": {}
        }
    },
    "mode": {
        "access": "readwrite",
        "schedulable": true,
        "triggers": [
            {
                "action": {
                    "targetHumidity": {
                        "disabled": false
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "DRY",
                    "operator": "eq"
                }
            },
            {
                "action": {
                    "targetHumidity": {
                        "disabled": true
                    }
                },
                "condition": {
                    "operand_1": "value",
                    "operand_2": "DRY",
                    "operator": "ne"
                }
            },
            {
                "action": {
                    "fanSpeedSetting": {
                        "access": "read"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "AUTO",
                        "operator": "eq"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "QUIET",
                        "operator": "eq"
                    },
                    "operator": "or"
                }
            },
            {
                "action": {
                    "fanSpeedSetting": {
                        "access": "readwrite"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "DRY",
                        "operator": "eq"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "CONTINUOUS",
                        "operator": "eq"
                    },
                    "operator": "or"
                }
            },
            {
                "action": {
                    "displayLight": {
                        "access": "read"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "CONTINUOUS",
                        "operator": "eq"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "QUIET",
                        "operator": "eq"
                    },
                    "operator": "or"
                }
            },
            {
                "action": {
                    "displayLight": {
                        "access": "readwrite"
                    }
                },
                "condition": {
                    "operand_1": {
                        "operand_1": "value",
                        "operand_2": "CONTINUOUS",
                        "operator": "ne"
                    },
                    "operand_2": {
                        "operand_1": "value",
                        "operand_2": "QUIET",
                        "operator": "ne"
                    },
                    "operator": "and"
                }
            }
        ],
        "type": "string",
        "values": {
            "AUTO": {},
            "CONTINUOUS": {},
            "DRY": {},
            "OFF": {
                "disabled": true
            },
            "QUIET": {}
        }
    },
    "networkInterface": {
        "command": {
            "access": "write",
            "type": "string",
            "values": {
                "APPLIANCE_AUTHORIZE": {},
                "START": {},
                "USER_AUTHORIZE": {},
                "USER_NOT_AUTHORIZE": {}
            }
        },
        "linkQualityIndicator": {
            "access": "read",
            "type": "string",
            "values": {
                "EXCELLENT": {},
                "GOOD": {},
                "POOR": {},
                "UNDEFINED": {},
                "VERY_GOOD": {},
                "VERY_POOR": {}
            }
        },
        "niuSwUpdateCurrentDescription": {
            "access": "read",
            "type": "string"
        },
        "otaState": {
            "access": "read",
            "type": "string",
            "values": {
                "DESCRIPTION_AVAILABLE": {},
                "DESCRIPTION_DOWNLOADING": {},
                "DESCRIPTION_READY": {},
                "FW_DOWNLOADING": {},
                "FW_DOWNLOAD_START": {},
                "FW_SIGNATURE_CHECK": {},
                "FW_UPDATE_IN_PROGRESS": {},
                "IDLE": {},
                "READY_TO_UPDATE": {},
                "UPDATE_ABORT": {},
                "UPDATE_CHECK": {},
                "UPDATE_ERROR": {},
                "UPDATE_OK": {},
                "WAITINGFORAUTHORIZATION": {}
            }
        },
        "startUpCommand": {
            "access": "write",
            "type": "string",
            "values": {
                "UNINSTALL": {}
            }
        },
        "swAncAndRevision": {
            "access": "read",
            "type": "string"
        },
        "swVersion": {
            "access": "read",
            "type": "string"
        }
    },
    "sensorHumidity": {
        "access": "read",
        "type": "number"
    },
    "startTime": {
        "access": "readwrite",
        "default": 0,
        "max": 86400,
        "min": 0,
        "step": 1800,
        "type": "number",
        "values": {
            "INVALID_OR_NOT_SET_TIME": {}
        }
    },
    "stopTime": {
        "access": "readwrite",
        "default": 0,
        "max": 86400,
        "min": 0,
        "step": 1800,
        "type": "number",
        "values": {
            "-1": {},
            "0": {},
            "10800": {},
            "12600": {},
            "14400": {},
            "16200": {},
            "1800": {},
            "18000": {},
            "19800": {},
            "21600": {},
            "23400": {},
            "25200": {},
            "27000": {},
            "28800": {},
            "30600": {},
            "32400": {},
            "34200": {},
            "3600": {},
            "36000": {},
            "39600": {},
            "43200": {},
            "46800": {},
            "50400": {},
            "5400": {},
            "54000": {},
            "57600": {},
            "61200": {},
            "64800": {},
            "68400": {},
            "7200": {},
            "72000": {},
            "75600": {},
            "79200": {},
            "82800": {},
            "86400": {},
            "9000": {}
        }
    },
    "targetHumidity": {
        "access": "readwrite",
        "max": 85,
        "min": 35,
        "step": 5,
        "type": "number",
        "values": {
            "35": {},
            "40": {},
            "45": {},
            "50": {},
            "55": {},
            "60": {},
            "65": {},
            "70": {},
            "75": {},
            "80": {},
            "85": {}
        }
    },
    "uiLockMode": {
        "access": "readwrite",
        "type": "boolean",
        "values": {
            "OFF": {},
            "ON": {}
        }
    },
    "waterBucketLevel": {
        "access": "read",
        "type": "number"
    }
}
rothn commented 8 months ago

Changes are ready to test. The testing repo has a self-contained frigidaire module, since adding back humidifier support requires changes both to this plugin and the API implementation (separate repo).

I've tested these commands, and everything seems to work for my window AC. To test, run the following:

git clone -b fix-dehumidifiers-testing https://github.com/rothn/home-assistant-frigidaire
cd home-assistant-frigidaire
git submodule init
git submodule update

Next, copy the contents of the custom_components directory to your HomeAssistant custom_components, as described in the repository README.

If it works, great-- please say so! If not, please post logs here.

rothn commented 8 months ago

Tagging @sarahemm @ha-elguano @boctok @sirjmann92 for testing :-)

ha-elguano commented 8 months ago

@rothn I figured it out the cloning. Followed the instructions, re-added the integration in HA, and so far, it works!

So far, everything seems to work great!

My hat is off to you, @rothn!!!

sirjmann92 commented 8 months ago

@rothn - thanks for the quick update, once again!

With your updates, my dehumidifier (FGAC7044U1) is showing up again. I clicked around and changed states and it seems to function without error or issue. All states are available, reported status is correct, and I'm able to make changes successfully. Obviously I don't have any real test-cases to follow and more thorough usage is needed to really say that it's 100% working but it seems to be working fine from the brief testing I did.

If anything pops up, I'll open a separate issue.

I really appreciate your effort!

sarahemm commented 8 months ago

Can confirm this seems to fix mine (model FGAC5044W1) as well! Let me know if providing the Colab notebook output is still useful and I can take care of it later today, or if you have enough info already. Thanks so much for your work on this, I really appreciate it. I've had ours switching modes from Dry to Quiet overnight automatically via HA since we got it and it'll be nice to have that functionality back.

(tested: on/off, mode switching, changing humidity target, reading target and current humidity)

rothn commented 8 months ago

It's good to hear that this appears to work. I've created https://github.com/bm1549/frigidaire/pull/24 to add dehumidifier support back to the API package. Once that is merged and releases, I'll remove the API subpackage from the testing branch and submit a PR to this repository that will hopefully be suitable to merge.

justinmyersm commented 8 months ago

It's good to hear that this appears to work. I've created bm1549/frigidaire#24 to add dehumidifier support back to the API package. Once that is merged and releases, I'll remove the API subpackage from the testing branch and submit a PR to this repository that will hopefully be suitable to merge.

Will this also fix the issue with Window AC units?

rothn commented 8 months ago

@justinmyersm Window ACs should already work after updating to the latest version of the plugin.

rothn commented 8 months ago

I've cherry-picked the fix into a new branch/MR: https://github.com/bm1549/home-assistant-frigidaire/pull/50/files

It's ready to merge as soon as @bm1549 cuts a new release for PYPI and I test everything again to make sure there are no packaging surprises. In the meantime, folks should be able to directly use the testing branch.

justinmyersm commented 7 months ago

@justinmyersm Window ACs should already work after updating to the latest version of the plugin.

I am just now getting time to update, and I am not able to get it to work. Initially I just copied the contents of the updated files and rebooted HA. That didn't work, so I deleted the folder, rebooted, redownloaded, rebooted, and I am getting an error when trying to log in. I only have 1 window AC unit and I logged out and back into my Frigidaire app just to make sure I was using the right login. What am I doing wrong?

image

This error originated from a custom integration.

Logger: custom_components.frigidaire.config_flow
Source: custom_components/frigidaire/config_flow.py:66
Integration: frigidaire
First occurred: 1:42:13 PM (3 occurrences)
Last logged: 1:44:57 PM

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/frigidaire/config_flow.py", line 66, in async_step_user
    await validate_input(self.hass, user_input)
  File "/config/custom_components/frigidaire/config_flow.py", line 38, in validate_input
    appliances = await hass.async_add_executor_job(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/frigidaire/config_flow.py", line 31, in setup
    return client.get_appliances()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 367, in get_appliances
    return get_appliances_inner()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 364, in get_appliances_inner
    return list(map(generate_appliance, appliances))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 353, in generate_appliance
    return Appliance(raw_appliance)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 82, in __init__
    self.appliance_type: str = args['properties']['reported']['applianceInfo']['applianceType']
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'applianceInfo'
rothn commented 7 months ago

@justinmyersm Would you mind following the instructions above with the Colab and filing a new bug against https://github.com/bm1549/frigidaire with the output? This looks suspiciously like an API-related issue. If you get the same error, you can run locally with a Jupyter notebook and HTTPS packet capture or clone the API package and print the output of each HTTP command to a log. If you don't feel comfortable doing either of those, feel free to reach out at @nicholasroth:nicholasroth.net on Matrix and we can coordinate setting up a test account or temporarily changing your password so I can reproduce and debug the issue.

rothn commented 7 months ago

For anyone still using the testing branch while we wait for changes to go upstream, the new testing branch is called "in-tree-frigidaire-for-testing" and can be pulled like:

git clone -b in-tree-frigidaire-for-testing https://github.com/rothn/home-assistant-frigidaire
cd home-assistant-frigidaire
git submodule init
git submodule update

Remember to copy the contents of the custom_components directory to your HomeAssistant custom_components, as described in the repository README. Sorry for the delay getting this to work upstream! We will have to wait for the "frigidaire" module to release before this will be available through HACS and the main branch.

rothn commented 7 months ago

Yet another update: A release has been cut and https://github.com/bm1549/home-assistant-frigidaire/pull/50 was merged. You all should be able to run the main branch now or use HACS-- whatever the original installation method was.

rothn commented 7 months ago

@sirjmann92 Ready to close the issue?

jhemak commented 7 months ago

Fixed it for me - thank you!! But, did we lose the compressor_running and fan_running attributes?

rothn commented 7 months ago

The new API does not expose compressor information based on the data in my appliance or the others I have seen here. Fan information is still exposed through fan modes, though the OFF state now comes from the appliance mode rather than the fan itself.

jhemak commented 7 months ago

Ah, that's too bad! I don't see anything now to show if the unit is actually running. The state of the entity shows if it's powered on or off, and the attributes seem to reflect the specified settings rather than current operation.

rothn commented 7 months ago

Yes, I don't remember anything that would indicate this in the output. If you would like to try, consider checking out applianceState in more details. That may have it. You could also cycle through different states and see what changes in the output to see what's available. But kind of OT for this issue.

sirjmann92 commented 7 months ago

@rothn yep! All good! Thanks again for the help and support!

marty22877 commented 5 months ago

@justinmyersm Window ACs should already work after updating to the latest version of the plugin.

I am just now getting time to update, and I am not able to get it to work. Initially I just copied the contents of the updated files and rebooted HA. That didn't work, so I deleted the folder, rebooted, redownloaded, rebooted, and I am getting an error when trying to log in. I only have 1 window AC unit and I logged out and back into my Frigidaire app just to make sure I was using the right login. What am I doing wrong?

image

This error originated from a custom integration.

Logger: custom_components.frigidaire.config_flow
Source: custom_components/frigidaire/config_flow.py:66
Integration: frigidaire
First occurred: 1:42:13 PM (3 occurrences)
Last logged: 1:44:57 PM

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/frigidaire/config_flow.py", line 66, in async_step_user
    await validate_input(self.hass, user_input)
  File "/config/custom_components/frigidaire/config_flow.py", line 38, in validate_input
    appliances = await hass.async_add_executor_job(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/frigidaire/config_flow.py", line 31, in setup
    return client.get_appliances()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 367, in get_appliances
    return get_appliances_inner()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 364, in get_appliances_inner
    return list(map(generate_appliance, appliances))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 353, in generate_appliance
    return Appliance(raw_appliance)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/frigidaire/__init__.py", line 82, in __init__
    self.appliance_type: str = args['properties']['reported']['applianceInfo']['applianceType']
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'applianceInfo'

@justinmyersm did you ever get a fix to this?