disforw / goveelife

Home Assistant Govee integration using the newest API for ALL Govee WiFi devices
2 stars 1 forks source link

Fans not recognised #12

Open corinnekaryiu opened 1 week ago

corinnekaryiu commented 1 week ago

Hi,

I've installed your integration via HACS, and have added my API Key, but no devices or entities are being created.

I have two Tower Fans (H7102), and here is my API response:

{
    "code": 200,
    "message": "success",
    "data": [{
        "sku": "H7102",
        "device": "REMOVED",
        "deviceName": "Bedroom Fan",
        "type": "devices.types.fan",
        "capabilities": [{
            "type": "devices.capabilities.on_off",
            "instance": "powerSwitch",
            "parameters": {
                "dataType": "ENUM",
                "options": [{
                    "name": "on",
                    "value": 1
                }, {
                    "name": "off",
                    "value": 0
                }]
            }
        }, {
            "type": "devices.capabilities.toggle",
            "instance": "oscillationToggle",
            "parameters": {
                "dataType": "ENUM",
                "options": [{
                    "name": "on",
                    "value": 1
                }, {
                    "name": "off",
                    "value": 0
                }]
            }
        }, {
            "type": "devices.capabilities.work_mode",
            "instance": "workMode",
            "parameters": {
                "dataType": "STRUCT",
                "fields": [{
                    "fieldName": "workMode",
                    "dataType": "ENUM",
                    "options": [{
                        "name": "Normal",
                        "value": 1
                    }, {
                        "name": "Custom",
                        "value": 2
                    }, {
                        "name": "Auto",
                        "value": 3
                    }, {
                        "name": "Sleep",
                        "value": 5
                    }, {
                        "name": "Nature",
                        "value": 6
                    }],
                    "required": true
                }, {
                    "fieldName": "modeValue",
                    "dataType": "ENUM",
                    "options": [{
                        "name": "Normal",
                        "options": [{
                            "value": 1
                        }, {
                            "value": 2
                        }, {
                            "value": 3
                        }, {
                            "value": 4
                        }, {
                            "value": 5
                        }, {
                            "value": 6
                        }, {
                            "value": 7
                        }, {
                            "value": 8
                        }]
                    }, {
                        "defaultValue": 0,
                        "name": "Custom"
                    }, {
                        "defaultValue": 0,
                        "name": "Auto"
                    }, {
                        "defaultValue": 0,
                        "name": "Sleep"
                    }, {
                        "defaultValue": 0,
                        "name": "Nature"
                    }],
                    "required": true
                }]
            }
        }]
    }, {
        "sku": "H7102",
        "device": "REMOVED",
        "deviceName": "Shed Fan",
        "type": "devices.types.fan",
        "capabilities": [{
            "type": "devices.capabilities.on_off",
            "instance": "powerSwitch",
            "parameters": {
                "dataType": "ENUM",
                "options": [{
                    "name": "on",
                    "value": 1
                }, {
                    "name": "off",
                    "value": 0
                }]
            }
        }, {
            "type": "devices.capabilities.toggle",
            "instance": "oscillationToggle",
            "parameters": {
                "dataType": "ENUM",
                "options": [{
                    "name": "on",
                    "value": 1
                }, {
                    "name": "off",
                    "value": 0
                }]
            }
        }, {
            "type": "devices.capabilities.work_mode",
            "instance": "workMode",
            "parameters": {
                "dataType": "STRUCT",
                "fields": [{
                    "fieldName": "workMode",
                    "dataType": "ENUM",
                    "options": [{
                        "name": "Normal",
                        "value": 1
                    }, {
                        "name": "Custom",
                        "value": 2
                    }, {
                        "name": "Auto",
                        "value": 3
                    }, {
                        "name": "Sleep",
                        "value": 5
                    }, {
                        "name": "Nature",
                        "value": 6
                    }],
                    "required": true
                }, {
                    "fieldName": "modeValue",
                    "dataType": "ENUM",
                    "options": [{
                        "name": "Normal",
                        "options": [{
                            "value": 1
                        }, {
                            "value": 2
                        }, {
                            "value": 3
                        }, {
                            "value": 4
                        }, {
                            "value": 5
                        }, {
                            "value": 6
                        }, {
                            "value": 7
                        }, {
                            "value": 8
                        }]
                    }, {
                        "defaultValue": 0,
                        "name": "Custom"
                    }, {
                        "defaultValue": 0,
                        "name": "Auto"
                    }, {
                        "defaultValue": 0,
                        "name": "Sleep"
                    }, {
                        "defaultValue": 0,
                        "name": "Nature"
                    }],
                    "required": true
                }]
            }
        }]
    }]
}

Here is the debug log:

2024-06-20 00:07:58.092 DEBUG (MainThread) [custom_components.goveelife.config_flow] goveelife: ConfigFlowHandler - async_get_options_flow
2024-06-20 00:07:58.093 DEBUG (MainThread) [custom_components.goveelife.config_flow] goveelife - OptionsFlowHandler: __init__: <ConfigEntry entry_id=84fdb8c7f95ca0974fcc6e01273feca8 version=1 domain=goveelife title=GoveeLife state=ConfigEntryState.LOADED unique_id=None>
2024-06-20 00:07:58.093 DEBUG (MainThread) [custom_components.goveelife.config_flow] goveelife - OptionsFlowHandler: async_step_init: None
2024-06-20 00:07:58.093 DEBUG (MainThread) [custom_components.goveelife.config_flow] goveelife - OptionsFlowHandler: async_step_config_resource: None
2024-06-20 00:07:58.093 DEBUG (MainThread) [custom_components.goveelife.configuration_schema] goveelife - async_get_OPTIONS_GOVEELIFE_SCHEMA
2024-06-20 00:08:01.189 DEBUG (MainThread) [custom_components.goveelife] Unloading config entry: 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:01.190 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_unload_entry: unload platform: climate
2024-06-20 00:08:01.191 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_unload_entry: unload platform: switch
2024-06-20 00:08:01.191 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_unload_entry: unload platform: light
2024-06-20 00:08:01.195 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_unload_entry: unload platform: fan
2024-06-20 00:08:01.214 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_unload_entry: Remove data store: goveelife.84fdb8c7f95ca0974fcc6e01273feca8 
2024-06-20 00:08:01.215 DEBUG (MainThread) [custom_components.goveelife] Setting up config entry: 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:01.215 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Creating data store: goveelife.84fdb8c7f95ca0974fcc6e01273feca8 
2024-06-20 00:08:01.216 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Receiving cloud devices..
2024-06-20 00:08:01.217 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GoveeAPI_GETRequest: perform api request
2024-06-20 00:08:01.218 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GooveAPI_CountRequests: 2024-06-20 -> 1
2024-06-20 00:08:02.373 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GoveeAPI_GETRequest: convert resulting json to object
2024-06-20 00:08:02.373 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Creating update coordinators per device..
2024-06-20 00:08:02.375 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GoveeAPI_POSTRequest: data = {"requestId": "c99fa25e-0827-43e4-85fb-732d6217ad4d","payload": {"sku": "H7102","device": "REMOVED"}}
2024-06-20 00:08:02.376 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GooveAPI_CountRequests: 2024-06-20 -> 2
2024-06-20 00:08:02.867 DEBUG (MainThread) [custom_components.goveelife.entities] 11d2d4adfc685c1e_GoveeAPIUpdate - async_GoveeAPI_GetDeviceState: __init__
2024-06-20 00:08:02.869 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GoveeAPI_POSTRequest: data = {"requestId": "582638af-6864-4d87-9578-481e540b9fc6","payload": {"sku": "H7102","device": "REMOVED"}}
2024-06-20 00:08:02.869 DEBUG (MainThread) [custom_components.goveelife.utils] 84fdb8c7f95ca0974fcc6e01273feca8 - async_GooveAPI_CountRequests: 2024-06-20 -> 3
2024-06-20 00:08:03.304 DEBUG (MainThread) [custom_components.goveelife.entities] 25e06074f423ee7e_GoveeAPIUpdate - async_GoveeAPI_GetDeviceState: __init__
2024-06-20 00:08:03.305 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Register option updates listener: options_update_listener 
2024-06-20 00:08:03.305 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Trigger setup for platform: climate 
2024-06-20 00:08:03.306 DEBUG (MainThread) [custom_components.goveelife.climate] Setting up climate platform entry: goveelife | 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:03.306 DEBUG (MainThread) [custom_components.goveelife.climate] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry climate: Getting cloud devices from data store
2024-06-20 00:08:03.306 INFO (MainThread) [custom_components.goveelife.climate] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: setup 0 climate entities
2024-06-20 00:08:03.307 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Trigger setup for platform: switch 
2024-06-20 00:08:03.307 DEBUG (MainThread) [custom_components.goveelife.switch] Setting up switch platform entry: goveelife | 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:03.307 DEBUG (MainThread) [custom_components.goveelife.switch] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry switch: Getting cloud devices from data store
2024-06-20 00:08:03.308 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Trigger setup for platform: light 
2024-06-20 00:08:03.309 DEBUG (MainThread) [custom_components.goveelife.light] Setting up light platform entry: goveelife | 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:03.309 DEBUG (MainThread) [custom_components.goveelife.light] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry light: Getting cloud devices from data store
2024-06-20 00:08:03.309 INFO (MainThread) [custom_components.goveelife.light] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: setup 0 light entities
2024-06-20 00:08:03.309 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Trigger setup for platform: fan 
2024-06-20 00:08:03.311 DEBUG (MainThread) [custom_components.goveelife.fan] Setting up fan platform entry: goveelife | 84fdb8c7f95ca0974fcc6e01273feca8
2024-06-20 00:08:03.311 DEBUG (MainThread) [custom_components.goveelife.fan] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry fan: Getting cloud devices from data store
2024-06-20 00:08:03.311 INFO (MainThread) [custom_components.goveelife.fan] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: setup 0 fan entities
2024-06-20 00:08:03.312 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: register services
2024-06-20 00:08:03.312 DEBUG (MainThread) [custom_components.goveelife.services] goveelife - async_registerService: set_poll_interval
2024-06-20 00:08:03.313 DEBUG (MainThread) [custom_components.goveelife.services] goveelife - async_registerServic: service already exists: set_poll_interval
2024-06-20 00:08:03.314 DEBUG (MainThread) [custom_components.goveelife] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: Completed
2024-06-20 00:08:03.317 INFO (MainThread) [custom_components.goveelife.switch] 84fdb8c7f95ca0974fcc6e01273feca8 - async_setup_entry: setup 0 switch entities

I really appreciate your work on this integration, and it would be great if I could somehow get it working. Perhaps there's something really obvious that I'm missing... (apologies if that's the case!)

Thanks.

disforw commented 1 week ago

There is definitely something wrong. Based on these results, you should see a fan entity and a oscillator switch for each device. Can you run a statue API call and send those results?

corinnekaryiu commented 1 week ago

There is definitely something wrong. Based on these results, you should see a fan entity and a oscillator switch for each device. Can you run a statue API call and send those results?

Thanks for the quick reply!

Sorry, I'm not sure what a statue API call is - this is all quite new to me. Do you mind letting me know what I need to do?

satoshidba commented 1 day ago

I have the same fan and also getting the same behaviour - response ok in the API and in the debug log but no entity in Home Assistant