Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Some properties of Air Purifiers are not parsed correctly #297

Open
kassabov opened this issue Oct 22, 2024 · 0 comments
Open

Some properties of Air Purifiers are not parsed correctly #297

kassabov opened this issue Oct 22, 2024 · 0 comments

Comments

@kassabov
Copy link

Govee Device SKU

H7123

Govee2MQTT Version

2024.07.13-82ddc6e9

Describe the issue

The air purifier is recognized and can be controlled by homeassistant however the level (gearmode) instead of being represented as ENUM with values Low, Medim, High is a numeric which accepts values 0-255. When set to 1, 2 or 3 everything works but any other value confuses the device.

My guess is that this field is one level deeper in the json and is not parsed correctly

Same applies to other purifies like H7120 H7122 H7124

Startup Diagnostics

nothing unusual -- it lists the API calls

Additional Logs

No response

Home Assistant Logs

No response

Anything else?

Here is the result of the API call which gets the device capabilities (I only hid the mac addresses)

{
"code": 200,
"message": "success",
"data": [
{
"sku": "H7141",
"device": "XX:XX:XX:XX:XX:XX:XX:XX",
"deviceName": "Smart Humidifier",
"type": "devices.types.humidifier",
"capabilities": [
{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"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": "Manual",
"value": 1
},
{
"name": "Custom",
"value": 2
},
{
"name": "Auto",
"value": 3
}
],
"required": true
},
{
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [
{
"name": "Manual",
"options": [
{
"value": 1
},
{
"value": 2
},
{
"value": 3
},
{
"value": 4
},
{
"value": 5
},
{
"value": 6
},
{
"value": 7
},
{
"value": 8
}
]
},
{
"defaultValue": 0,
"name": "Custom"
},
{
"name": "Auto",
"range": {
"min": 40,
"max": 70
}
}
],
"required": false
}
]
}
},
{
"type": "devices.capabilities.range",
"instance": "humidity",
"parameters": {
"unit": "unit.percent",
"dataType": "INTEGER",
"range": {
"min": 40,
"max": 70,
"precision": 1
}
}
},
{
"type": "devices.capabilities.event",
"instance": "lackWaterEvent",
"alarmType": 51,
"eventState": {
"options": [
{
"name": "lack",
"value": 1,
"message": "Lack of Water"
}
]
}
}
]
},
{
"sku": "H7120",
"device": "XX:XX:XX:XX:XX:XX:XX:XX",
"deviceName": "Air Purifier Martin",
"type": "devices.types.air_purifier",
"capabilities": [
{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"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": "gearMode",
"value": 1
},
{
"name": "Sleep",
"value": 5
}
],
"required": true
},
{
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [
{
"name": "gearMode",
"options": [
{
"name": "Low",
"value": 1
},
{
"name": "Medium",
"value": 2
},
{
"name": "High",
"value": 3
}
]
},
{
"defaultValue": 0,
"name": "Sleep"
}
],
"required": true
}
]
}
},
{
"type": "devices.capabilities.property",
"instance": "filterLifeTime"
},
{
"type": "devices.capabilities.toggle",
"instance": "nightlightToggle",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "on",
"value": 1
},
{
"name": "off",
"value": 0
}
]
}
},
{
"type": "devices.capabilities.range",
"instance": "brightness",
"parameters": {
"dataType": "INTEGER",
"range": {
"min": 1,
"max": 100,
"precision": 1
}
}
},
{
"type": "devices.capabilities.color_setting",
"instance": "colorRgb",
"parameters": {
"dataType": "INTEGER",
"range": {
"min": 0,
"max": 16777215,
"precision": 1
}
}
},
{
"type": "devices.capabilities.mode",
"instance": "nightlightScene",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "Forest",
"value": 1
},
{
"name": "Ocean",
"value": 2
},
{
"name": "Wetland",
"value": 3
},
{
"name": "Leisurely",
"value": 4
},
{
"name": "Sleep",
"value": 5
}
]
}
}
]
},
{
"sku": "H7123",
"device": "XX:XX:XX:XX:XX:XX:XX:XX",
"deviceName": "Air Purifier Dora",
"type": "devices.types.air_purifier",
"capabilities": [
{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"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": "gearMode",
"value": 1
},
{
"name": "Auto",
"value": 3
},
{
"name": "Sleep",
"value": 5
}
],
"required": true
},
{
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [
{
"name": "gearMode",
"options": [
{
"name": "Low",
"value": 1
},
{
"name": "Medium",
"value": 2
},
{
"name": "High",
"value": 3
}
]
},
{
"defaultValue": 0,
"name": "Auto"
},
{
"defaultValue": 0,
"name": "Sleep"
}
],
"required": true
}
]
}
},
{
"type": "devices.capabilities.property",
"instance": "filterLifeTime"
},
{
"type": "devices.capabilities.property",
"instance": "airQuality"
}
]
},
{
"sku": "H7124",
"device": "XX:XX:XX:XX:XX:XX:XX:XX",
"deviceName": "Air Purifier Michael",
"type": "devices.types.air_purifier",
"capabilities": [
{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"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": "gearMode",
"value": 1
},
{
"name": "Sleep",
"value": 5
},
{
"name": "Auto",
"value": 3
},
{
"name": "Turbo",
"value": 7
}
],
"required": true
},
{
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [
{
"name": "gearMode",
"options": [
{
"name": "Low",
"value": 1
},
{
"name": "Medium",
"value": 2
},
{
"name": "High",
"value": 3
}
]
},
{
"defaultValue": 0,
"name": "Sleep"
},
{
"defaultValue": 0,
"name": "Auto"
},
{
"defaultValue": 0,
"name": "Turbo"
}
],
"required": true
}
]
}
},
{
"type": "devices.capabilities.toggle",
"instance": "nightlightToggle",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "on",
"value": 1
},
{
"name": "off",
"value": 0
}
]
}
},
{
"type": "devices.capabilities.range",
"instance": "brightness",
"parameters": {
"dataType": "INTEGER",
"range": {
"min": 1,
"max": 100,
"precision": 1
}
}
},
{
"type": "devices.capabilities.color_setting",
"instance": "colorRgb",
"parameters": {
"dataType": "INTEGER",
"range": {
"min": 0,
"max": 16777215,
"precision": 1
}
}
},
{
"type": "devices.capabilities.mode",
"instance": "nightlightScene",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "Forest",
"value": 1
},
{
"name": "Ocean",
"value": 2
},
{
"name": "Wetland",
"value": 3
},
{
"name": "Leisurely",
"value": 4
},
{
"name": "Asleep",
"value": 5
}
]
}
},
{
"type": "devices.capabilities.property",
"instance": "filterLifeTime"
},
{
"type": "devices.capabilities.property",
"instance": "airQuality"
}
]
},
{
"sku": "H7122",
"device": "XX:XX:XX:XX:XX:XX:XX:XX",
"deviceName": "Air Purifier Living",
"type": "devices.types.air_purifier",
"capabilities": [
{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"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": "gearMode",
"value": 1
},
{
"name": "Custom",
"value": 2
},
{
"name": "Auto",
"value": 3
},
{
"name": "Sleep",
"value": 5
}
],
"required": true
},
{
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [
{
"name": "gearMode",
"options": [
{
"name": "Low",
"value": 1
},
{
"name": "Medium",
"value": 2
},
{
"name": "High",
"value": 3
}
]
},
{
"name": "Custom",
"options": [
{
"value": 1
},
{
"value": 2
},
{
"value": 3
},
{
"value": 4
},
{
"value": 5
},
{
"value": 6
},
{
"value": 7
},
{
"value": 8
},
{
"value": 9
},
{
"value": 10
},
{
"value": 11
},
{
"value": 12
},
{
"value": 13
}
]
},
{
"name": "Auto",
"value": 0
},
{
"name": "Sleep",
"value": 0
}
],
"required": true
}
]
}
},
{
"type": "devices.capabilities.property",
"instance": "filterLifeTime"
}
]
}
]
}

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

No branches or pull requests

1 participant