Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

F-Y20JH V2.81異常 #113

Closed
andy860218 opened this issue Jul 18, 2024 · 3 comments · Fixed by #114
Closed

F-Y20JH V2.81異常 #113

andy860218 opened this issue Jul 18, 2024 · 3 comments · Fixed by #114

Comments

@andy860218
Copy link

F-Y20JH除濕機以下問題請再協助 謝謝
1.無法像冷氣使用溫控器面板
2.找不到開關機選項
3.pm2.5 異味 sensor無法接收
B

@osk2
Copy link
Owner

osk2 commented Jul 24, 2024

v2.8.2 修正了一些除濕機的問題,試試看還有沒有問題

@andy860218
Copy link
Author

您好,溫控器面板已正常
目前問題
1.pm2.5 、異味 sensor無法接收
2.常常發生statue執行失敗,需重置HA才可以(如圖,左下角訊息)
NG

@JyunWei-Su
Copy link
Contributor

JyunWei-Su commented Jul 29, 2024

  1. pm2.5 消失應該是因為 sensor.py 中,PanasonicDehumidifierPM25Sensor 在 2.8.1 版加了判斷條件
        if device_type == DEVICE_TYPE_DEHUMIDIFIER:
            sensors.append(
                PanasonicHumiditySensor(
                    coordinator,
                    index,
                    client,
                    device,
                )
            )

            if "0x53" in command_types:
                sensors.append(
                    PanasonicDehumidifierPM25Sensor(
                        coordinator,
                        index,
                        client,
                        device,
                    )
                )
  • 我個人覺得這個判斷條件應該需要做修正 將條件由command_types 改為 status.keys(),因為這裡的command_types好像只有可控制的list,純sensor data (如PM2.5)不會在裡面,command_types詳細如下:
展開程式碼 { "State": "success", "StateMsg": "", "MVersion": "20240702222228", "GroupList": [ { "GroupID": 1, "GroupName": "一鍵關機", "GroupIcon": 1, "LinkGroupList": [], "GwList": [ { "GWID": "************", "DeviceID": "1", "CommandList": [ { "CommandType": "0x00", "Value": "0" } ] } ] } ], "AreaList": [ { "AreaID": "0", "AreaName": "", "AreaNo": "0", "AreaIcon": "1" } ], "GwList": [ { "GWID": "************", "ModelID": "CZ-T006", "AreaID": "0", "SeqNo": "0", "Auth": "********************************************", "NickName": "除濕機", "City": "新北市", "Area": "***", "LatLng": "24.*******,120.*******", "DeviceType": "4", "ModelType": "JHW", "Model": "F-Y20JH", "Function": { "SetSchedule": "1" }, "Attribute": { "Year": "0" }, "Devices": [ { "DeviceID": 1, "Name": "", "IsAvailable": 1 } ] } ], "CommandList": [ { "ModelType": "JHW", "JSON": [ { "DeviceType": 4, "DeviceName": "除濕機", "ModelType": "JHW", "ProtocalType": "SAANET", "ProtocalVersion": "4", "Timestamp": "202108170829", "list": [ { "CommandType": "0x00", "CommandName": "電源", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "停止", 0 ], [ "運轉", 1 ] ] }, { "CommandType": "0x01", "CommandName": "功能選擇", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "連續除濕", 0 ], [ "自動除濕", 1 ], [ "防霉抑菌", 2 ], [ "衣物乾燥", 4 ], [ "保持乾燥", 5 ], [ "濕度設定", 6 ], [ "空氣清淨", 7 ] ] }, { "CommandType": "0x04", "CommandName": "濕度設定", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "40%", 0 ], [ "45%", 1 ], [ "50%", 2 ], [ "55%", 3 ], [ "60%", 4 ], [ "65%", 5 ], [ "70%", 6 ] ] }, { "CommandType": "0x0E", "CommandName": "風量", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "自動", 0 ], [ "靜音", 1 ], [ "標準", 2 ], [ "急速", 3 ] ] }, { "CommandType": "0x09", "CommandName": "風向", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "固定", 0 ], [ "下方向", 1 ], [ "上方向", 2 ], [ "廣角", 3 ], [ "下吹", 4 ] ] }, { "CommandType": "0x18", "CommandName": "操作提示音", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "開啟", 0 ], [ "關閉", 1 ] ] }, { "CommandType": "0x02", "CommandName": "時間到關", "ParameterType": "range", "ParameterUnit": "小時", "Parameters": [ [ "Min", 0 ], [ "Max", 12 ] ] }, { "CommandType": "0x55", "CommandName": "時間到開", "ParameterType": "range", "ParameterUnit": "小時", "Parameters": [ [ "Min", 0 ], [ "Max", 12 ] ] }, { "CommandType": "0x0D", "CommandName": "nanoeX(脫臭)", "ParameterType": "enum", "ParameterUnit": "", "Parameters": [ [ "關閉", 0 ], [ "開啟", 1 ] ] } ] } ] } ] }
  • 如果改為使用status.keys() 如下:
    for index, device in enumerate(devices):
        device_type = int(device.get("DeviceType"))
        current_device_commands = [
            command
            for command in commands
            if command["ModelType"] == device.get("ModelType")
        ][0]["JSON"][0]["list"]
        command_types = list(
            map(lambda c: c["CommandType"].lower(), current_device_commands)
        )
        
        status = coordinator.data[index]["status"]
        _LOGGER.debug(f"my_debug imdex:{index} infos: {status}")

        sensors.append(
            PanasonicEnergySensor(
                coordinator,
                index,
                client,
                device,
            )
        )

        if device_type == DEVICE_TYPE_DEHUMIDIFIER:
            sensors.append(
                PanasonicHumiditySensor(
                    coordinator,
                    index,
                    client,
                    device,
                )
            )
            if "0x53" in status.keys():
                sensors.append(
                    PanasonicDehumidifierPM25Sensor(
                        coordinator,
                        index,
                        client,
                        device,
                    )
                )
  • 以我自己的F-Y20JH為例,status.keys()如下:
{'0x18': '1', '0x50': '1024', '0x53': '3', '0x55': '0', '0x00': '1', '0x01': '6', '0x02': '0', '0x07': '69', '0x09': '0', '0x0D': '1', '0x0A': '0', '0x04': '3', '0x0E': '2'}
  • 我覺得其他裝置(冷氣機...)也可以改為用status.keys()判斷,不過因為要改的code比較多,這兩周抽空把全部改一改再發PR,但因為我本身沒有panasonic冷氣機,需要有人幫忙驗證
  1. 異味sensor、PM1.0 sensor目前好像官方api沒有回傳(參考const.py內目前支援的功能)
    DEVICE_TYPE_DEHUMIDIFIER: [
        "0x00",  # Dehumidifier power status
        "0x01",  # Dehumidifier operation mode
        "0x02",  # Dehumidifier off timer
        "0x07",  # Dehumidifier humidity sensor
        "0x09",  # Dehumidifier fan direction
        "0x0D",  # Dehumidifier nanoe
        "0x50",
        "0x18",  # Dehumidifier buzzer
        "0x53",  # Dehumidifier PM2.5
        "0x55",  # Dehumidifier on timer
        "0x0A",  # Dehumidifier tank status
        "0x04",  # Dehumidifier target humidity
        "0x0E",  # Dehumidifier fan mode
    ],

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants