simbaja / ha_gehome

GE Home Appliances (SmartHQ) for Home Assistant
MIT License
322 stars 75 forks source link

F&P Dual Dishwasher, ValueError in UserDryOptionSetting at end of cycle #198

Open fivesixzero opened 11 months ago

fivesixzero commented 11 months ago

Thanks for the help on #172! Had time today to get things set up and the integration works as expected but I figured I should report this anyway since unexpected values for enums could potentially cause problems elsewhere. :)

This looks like a similar unexpected value issue. The error logging happened toward the end of a cycle while the dishwasher was in the drying part of the cycle.

During the wash cycle it reported the "Setting Dry Option" as "Power Dry", which seems to be accurate. After the cycle finished and the error was triggered there wasn't any kind of catastrophic failure thanks to the error being caught effectively in erd_user_setting_converter.

In the SmartHQ iOS app the dishwasher reports itself as being "off" although I can hear the dishwasher's internal dryer fan running, so it might be some kind of post-cycle air circulation standby or something?

Here's the error info from the HA logs:

2023-09-24 10:53:23.308 ERROR (MainThread) [gehomesdk.erd.converters.dishwasher.erd_user_setting_converter] Could not construct user setting, using default.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gehomesdk/erd/converters/dishwasher/erd_user_setting_converter.py", line 32, in erd_decode
    dry_option = UserDryOptionSetting((i & 3072) >> 10),
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1128, in __new__
    raise ve_exc
ValueError: 3 is not a valid UserDryOptionSetting
2023-09-24 10:53:23.309 ERROR (MainThread) [gehomesdk.erd.converters.dishwasher.erd_user_setting_converter] Could not construct user setting, using default.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gehomesdk/erd/converters/dishwasher/erd_user_setting_converter.py", line 32, in erd_decode
    dry_option = UserDryOptionSetting((i & 3072) >> 10),
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1128, in __new__
    raise ve_exc
ValueError: 3 is not a valid UserDryOptionSetting

I'm running another cycle now to see if the same error pops up at the end and I'll update this issue if anything unexpected happens.

fivesixzero commented 11 months ago

Ran another cycle while running the gehome-appliance-data script and managed to capture what I think is the raw UserSetting value: 000C02

Here's the log data from that script run:

2023-09-24 13:54:54,586 ERROR    Could not construct user setting, using default.
Traceback (most recent call last):
  File "/home/chitlin/.local/lib/python3.8/site-packages/gehomesdk/erd/converters/dishwasher/erd_user_setting_converter.py", line 32, in erd_decode
    dry_option = UserDryOptionSetting((i & 3072) >> 10),
  File "/usr/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.8/enum.py", line 663, in __new__
    raise ve_exc
ValueError: 3 is not a valid UserDryOptionSetting
2023-09-24 13:54:54,591 DEBUG    Setting ErdCode.DISHWASHER_UPPER_USER_SETTING to ErdUserSetting(mute=<UserSetting.DISABLE: 0>, demo_mode=<UserSetting.DISABLE: 0>, lock_control=<UserSetting.DISABLE: 0>, sabbath=<UserSetting.DISABLE: 0>, cycle_mode=<UserCycleSetting.AUTO: 0>, presoak=<UserSetting.DISABLE: 0>, bottle_jet=<UserSetting.DISABLE: 0>, wash_temp=<UserWashTempSetting.NORMAL: 0>, rinse_aid=<UserSetting.DISABLE: 0>, dry_option=<UserDryOptionSetting.OFF: 0>, wash_zone=<UserWashZoneSetting.BOTH: 0>, delay_hours=0, raw_value='000C02')
2023-09-24 13:54:54,591 ERROR    Could not construct user setting, using default.
Traceback (most recent call last):
  File "/home/chitlin/.local/lib/python3.8/site-packages/gehomesdk/erd/converters/dishwasher/erd_user_setting_converter.py", line 32, in erd_decode
    dry_option = UserDryOptionSetting((i & 3072) >> 10),
  File "/usr/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.8/enum.py", line 663, in __new__
    raise ve_exc
ValueError: 3 is not a valid UserDryOptionSetting

Additionally, I noticed a few other quirks in the data reporting for this dishwasher.

First, despite running a "Santize" mode cycle, the WashTempSetting stayed at Normal throughout the run.

Second, the state after cycle completion and throughout standby seems to correlate with ErdCycleStateRaw.STATE_17, which translates to "N/A".

Third, some of the flags and data items seem a bit off, like the "Reminder Add Rinse Aid" item. This flag is true in HA for both drawers despite there not being any corresponding alert on the SmartHQ app and both dishwashers having their rinse aid topped off. Related to this, the "Setting Rinse Aid" indicates "Disabled" in HA despite it being enabled/configured on the dishwasher itself.

I'm guessing these quirks are related to a general lack of documentation for these Fisher & Paykel devices? I hope your communication with the devs at GE/Haier (mentioned in #184) are fruitful enough to get proper documentation to provide all of the proper UserSetting and state enum values. Thanks for taking the time to engage with them, and if you can get access to docs I'd be happy to help with F&P-related testing and would be happy to just contribute some PRs directly to save you some time.

simbaja commented 9 months ago

I haven't gotten official docs yet, but perhaps we can try to work through this? I'm guessing that it's definitely due to differences for F&P vs. GE appliances, we might have to have different mappings somehow. The problem is that they share the base level codes, so I'm not entirely sure how to handle.

For the above errors, what is the Dry setting set to? Perhaps there's another setting that I can just add in that doesn't interfere with the rest of the options.

yestrdave commented 8 months ago

I think this may be the same issue as #214

2023-12-13 08:53:27.290 ERROR (MainThread) [gehomesdk.erd.converters.dishwasher.erd_user_setting_converter] Could not construct user setting, using default. Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/gehomesdk/erd/converters/dishwasher/erd_user_setting_converter.py", line 28, in erd_decode cycle_mode = UserCycleSetting((i & 14) >> 1), #missing brackets added by Nick ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 712, in call return cls.new(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 1135, in new raise ve_exc ValueError: 6 is not a valid UserCycleSetting