disforw / goveelife

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

API Response for H6052, H7126, H7150, and H7151 #20

Open liamtw22 opened 1 month ago

liamtw22 commented 1 month ago

{"code":200,"message":"success","data":[

{ "sku":"H6052", "type":"devices.types.light", "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":"gradientToggle", "parameters":{"dataType":"ENUM","options":[{"name":"on","value":1},{"name":"off","value":0}]}}, { "type":"devices.capabilities.range", "instance":"brightness", "parameters":{"unit":"unit.percent","dataType":"INTEGER","range":{"min":1,"max":100,"precision":1}}}, { "type":"devices.capabilities.segment_color_setting", "instance":"segmentedBrightness", "parameters":{"dataType":"STRUCT","fields":[{"fieldName":"segment","size":{"min":1,"max":15},"dataType":"Array","elementRange":{"min":0,"max":14},"elementType":"INTEGER","required":true},{"fieldName":"brightness","dataType":"INTEGER","range":{"min":0,"max":100,"precision":1},"required":true}]}}, { "type":"devices.capabilities.segment_color_setting", "instance":"segmentedColorRgb", "parameters":{"dataType":"STRUCT","fields":[{"fieldName":"segment","size":{"min":1,"max":15},"dataType":"Array","elementRange":{"min":0,"max":14},"elementType":"INTEGER","required":true},{"fieldName":"rgb","dataType":"INTEGER","range":{"min":0,"max":16777215,"precision":1},"required":true}]}},{"type":"devices.capabilities.color_setting","instance":"colorRgb","parameters":{"dataType":"INTEGER","range":{"min":0,"max":16777215,"precision":1}}}, { "type":"devices.capabilities.color_setting", "instance":"colorTemperatureK", "parameters":{"dataType":"INTEGER","range":{"min":2000,"max":9000,"precision":1}}}, { "type":"devices.capabilities.dynamic_scene", "instance":"lightScene", "parameters":{"dataType":"ENUM","options":[]}}, { "type":"devices.capabilities.music_setting", "instance":"musicMode", "parameters":{"dataType":"STRUCT","fields":[{"fieldName":"musicMode","dataType":"ENUM","options":[{"name":"Spectrum","value":1},{"name":"Vibrate","value":2},{"name":"Energic","value":3},{"name":"Rhythm","value":4}],"required":true},{"unit":"unit.percent","fieldName":"sensitivity","dataType":"INTEGER","range":{"min":0,"max":100,"precision":1},"required":true},{"fieldName":"autoColor","dataType":"ENUM","options":[{"name":"on","value":1},{"name":"off","value":0}],"required":false},{"fieldName":"rgb","dataType":"INTEGER","range":{"min":0,"max":16777215,"precision":1},"required":false}]}}, { "type":"devices.capabilities.dynamic_scene", "instance":"diyScene", "parameters":{"dataType":"ENUM","options":[]}}, { "type":"devices.capabilities.dynamic_scene", "instance":"snapshot", "parameters":{"dataType":"ENUM","options":[]}}]},

{"sku":"H7126", "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}],"required":true},{"fieldName":"modeValue","dataType":"ENUM","options":[{"name":"gearMode","options":[{"name":"Sleep","value":1},{"name":"Low","value":2},{"name":"High","value":3}]},{"defaultValue":0,"name":"Custom"},{"defaultValue":0,"name":"Auto"}],"required":true}]}}, { "type":"devices.capabilities.property", "instance":"filterLifeTime"}, { "type":"devices.capabilities.property", "instance":"airQuality"}]},

{"sku":"H7150", "type":"devices.types.dehumidifier", "capabilities": [{ "type":"devices.capabilities.on_off", "instance":"powerSwitch", "parameters":{"dataType":"ENUM","options":[{"name":"on","value":1},{"name":"off","value":0}]}}, { "type":"devices.capabilities.range", "instance":"humidity", "parameters":{"unit":"unit.percent","dataType":"INTEGER","range":{"min":30,"max":80,"precision":1}}}, { "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":"Dryer","value":8}],"required":true},{"fieldName":"modeValue","dataType":"ENUM","options":[{"name":"gearMode","options":[{"name":"Low","value":1},{"name":"High","value":3}]},{"name":"Auto","range":{"min":30,"max":80}},{"name":"Dryer","value":0}],"required":true}]}}, { "type":"devices.capabilities.event", "instance":"waterFullEvent", "alarmType":58, "eventState":{"options":[{"name":"waterFull","value":1,"message":"Water bucket is full or has been pulled out"}]}}]},

{"sku":"H7126", "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}],"required":true},{"fieldName":"modeValue","dataType":"ENUM","options":[{"name":"gearMode","options":[{"name":"Sleep","value":1},{"name":"Low","value":2},{"name":"High","value":3}]},{"defaultValue":0,"name":"Custom"},{"defaultValue":0,"name":"Auto"}],"required":true}]}}, { "type":"devices.capabilities.property", "instance":"filterLifeTime"}, { "type":"devices.capabilities.property", "instance":"airQuality"}]},

{"sku":"H7151", "type":"devices.types.dehumidifier", "capabilities": [{ "type":"devices.capabilities.on_off", "instance":"powerSwitch", "parameters":{"dataType":"ENUM","options":[{"name":"on","value":1},{"name":"off","value":0}]}}, { "type":"devices.capabilities.range","instance":"humidity","parameters":{"unit":"unit.percent","dataType":"INTEGER","range":{"min":30,"max":80,"precision":1}}}, { "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":"Dryer","value":8}],"required":true},{"fieldName":"modeValue","dataType":"ENUM","options":[{"name":"gearMode","options":[{"name":"Low","value":1},{"name":"Medium","value":2},{"name":"High","value":3}]},{"name":"Auto","range":{"min":80,"max":80}},{"defaultValue":0,"name":"Dryer"}],"required":true}]}}, { "type":"devices.capabilities.event", "instance":"waterFullEvent", "alarmType":58, "eventState":{"options":[{"name":"waterFull","value":1,"message":"Water bucket is full or has been pulled out"}]}}]}]}

disforw commented 1 month ago

Are any of your devices working right out of the gate? What are you missing and looking for?

liamtw22 commented 1 month ago

I appreciate your response and all your work on this integration! In terms of device functionality, for the air purifiers (H7126). the three modes (Sleep, Low, and High) are all working properly, but the entities are not returning the filter life or the air quality readings. For the light (H6052), light color and brightness are working properly, but there are no scene or segment controls. And neither of the dehumidifiers are working (same issue as documented here). Once again, I so appreciate the work, and please let me know if any other logs would be beneficial!

disforw commented 1 month ago

Can you get an API status call for the air purifier. On mine, it shows filterlife as a property (as above) but it doesn’t update or show status in the status call, so it’s not implemented into the API. Let’s see if your is different…

liamtw22 commented 1 month ago

Here's the API status call:

{ "sku": "H7126", "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 } ], "required": true }, { "fieldName": "modeValue", "dataType": "ENUM", "options": [ { "name": "gearMode", "options": [ { "name": "Sleep", "value": 1 }, { "name": "Low", "value": 2 }, { "name": "High", "value": 3 } ] }, { "defaultValue": 0, "name": "Custom" }, { "defaultValue": 0, "name": "Auto" } ], "required": true } ] } }, { "type": "devices.capabilities.property", "instance": "filterLifeTime" }, { "type": "devices.capabilities.property", "instance": "airQuality" } ] },

disforw commented 1 month ago

Right. So just like mine, if you check out the bottom of your response, it shows you the property but there's no value. This seems to be not included in the API. Hopefully it's just not yet implemented.

liamtw22 commented 1 month ago

Thanks for the response! Not totally sure if this is pulling in legitimate data points, but it does appear Govee2MQTT is returning air quality and filter life values. Hopefully this is helpful! image image