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

Add full support for H60A1 #39

Open
Drez-code opened this issue Jul 3, 2024 · 7 comments
Open

Add full support for H60A1 #39

Drez-code opened this issue Jul 3, 2024 · 7 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Drez-code
Copy link

The integration only allows to turn on/off the H60A1. It doesn't allow for brightness control nor color and temperature selection.

LOGS:

Logger: homeassistant.components.govee_light_local.coordinator
Source: runner.py:190
integration: Govee lights local (documentation, issues)
First occurred: 6:00:05 PM (1 occurrences)
Last logged: 6:00:05 PM

Device H60A1 is not supported. Only power control is available. Please open an issue at 'https://github.com/Galorhallen/govee-local-api/issues'

@drizzlekablammo
Copy link

I can control brightness and colour in Home Assistant, however has these issues:

  • Temperature range is too great, light turns off when selecting a temperature/colour which is out of range.
  • After a while the brightness seems to default to reporting 3% brightness even though it is much higher.
  • If power to the light is off, the device doesn't report as 'unavailable' (not sure if this is expected behaviour).
  • There are two sets of separately addressable lights, the center and an outer ring. Not a big deal but would be nice if these appeared as two separate entities.

Thanks for the intergration!

@Galorhallen
Copy link
Owner

Hi @Drez-code,
the device has been added in version 1.5.1.

@drizzlekablammo,

  • The allowed temperature range is not reported from the specific device. The min and max values are taken from the API documentation and it looks like they should be the same for all devices.
  • Not sure about this.
  • I think that marking a device as unavailable is up to home assistant, but I'll investigate this.
  • Unfortunately, the local API only allow to controls the whole device. There is nothing I can do unless the API are improved on Govee side.

@drizzlekablammo
Copy link

It does work, but can the above issues be resolved or does it just give basic functionality?
Thanks

@Galorhallen
Copy link
Owner

@drizzlekablammo as I said:

Temperature range is too great, light turns off when selecting a temperature/colour which is out of range.

The temperature range is hardcoded as per documentation and, as far as i know they are the same for all devices. (I've never experienced the issue you mention on my devices, but I'll check)

After a while the brightness seems to default to reporting 3% brightness even though it is much higher.
If power to the light is off, the device doesn't report as 'unavailable' (not sure if this is expected behaviour).

I'll investigate these

There are two sets of separately addressable lights, the center and an outer ring. Not a big deal but would be nice if these appeared as two separate entities.

Unfortunately, the local API only allow to controls the whole device. There is nothing I can do unless the API are improved on Govee side.

@imascarenhas
Copy link

Hi, I've been having the same issues as @drizzlekablammo.

I have found that the default temperatures in this project do differ from the ones the public API returns if you query https://openapi.api.govee.com/router/api/v1/user/devices

Below is the response from my H60A1 if case you'd like to see how it diverges from the documented defaults.

{
  "code": 200,
  "message": "success",
  "data": [
    {
      "sku": "H60A1",
      "device": "XX:XX:XX:XX:XX:XX:XX:XX",
      "deviceName": "xxxxxxxxxxxxxxxxxx",
      "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.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": 13
                },
                "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": 13
                },
                "dataType": "Array",
                "elementRange": {
                  "min": 0,
                  "max": 12
                },
                "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": 2200,
              "max": 6500,
              "precision": 1
            }
          }
        },
        {
          "type": "devices.capabilities.dynamic_scene",
          "instance": "lightScene",
          "parameters": {
            "dataType": "ENUM",
            "options": []
          }
        },
        {
          "type": "devices.capabilities.dynamic_scene",
          "instance": "diyScene",
          "parameters": {
            "dataType": "ENUM",
            "options": []
          }
        },
        {
          "type": "devices.capabilities.dynamic_scene",
          "instance": "snapshot",
          "parameters": {
            "dataType": "ENUM",
            "options": []
          }
        }
      ]
    }
  ]
}

@Galorhallen
Copy link
Owner

Hi @imascarenhas,
thanks for the info.
Probably different devices can have different ranges then, since I've never had the problem described above.

I'll check the ranges of mine with the cloud api just to be sure and the I'll work on some way to make the ranges parametric w.r.t the devices and with some reasonable defaults (the documented values probably).

@Galorhallen Galorhallen added bug Something isn't working enhancement New feature or request labels Aug 21, 2024
@luismasg
Copy link

hi !
Im also interested in this. the h60a1 has segments, can we just flip it on and have it work?

something like

- "H60A1": BASIC_CAPABILITIES,
+ "H60A1": create_with_capabilities(True, True, True, 13 , True)

Also, we could benefit from the ability to override its color temperature range, since it's 2200K–6500K. In Home Assistant, the slider allows me to go as low as 2000K or as high as 7000K, causing the lamp to simply turn off at those extremes. It would be great to restrict the range to the supported 2200K–6500K to prevent this issue.

@Galorhallen , any suggestions on where I can begin to write a pr for this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants