I found out how to add color support for Philips Hue and LEDVANCE lights in Netatmo API integration

Hi, and thank you for all the work you’re doing on the netatmo integration. I have been using it a lot with tons of celiane switches and weather modules.

Netatmo API supports zigbee color led lights from Philips Hue and LEDVANCE

I have bought compatible lights (philips Hue and LEDVANCE zigbee) that I added to my Celiane Zigbee gateway. They appear as basic light switches, but we are missing the ability to set the colors of those LED.

Netatmo doesn’t help much with their API documentation, but I have played a little with it and I have found out that the API allows the control of many color parameters on the compatible Z3L type devices. Here’s what I have managed to do with the API, and I can share those learnings below.

Using the legrand api to set the color

On the legrand api, the homestatus method tell us which devices are color compatible (types “Z3L”) and the min and max temperature values available.

Here’s an example of the data returned on my Philips Hue Light by the netatmo api :

{
                    "brightness": 50,
                    "color_mode": "temperature",
                    "color_temperature": 219,
                    "color_temperature:min": 153,
                    "color_temperature:max": 500,
                    "hue": 220,
                    "id": "xxx",
                    "on": true,
                    "reachable": true,
                    "saturation": 10,
                    "type": "Z3L",
                    "variant": "Z3L:generic_extended_color_light",
                    // ... and some other data
                },

We can clearly see that the API knows about the color capabilities of such lights.

For those device, we have additional body parameters to use in the setstate method of the netatmo api:

{
  "home": {
    "id": "xxx",
    "modules": [
      {
        "id": "xxx",

        // You can turn on or off the light
        "on": true, // true or false to turn on or off the light
        "brightness": 100, // 0 to 100%

        // For a product type=Z3L (Zigbee 3rd party light) it appears we have other fields we can use to control the color of the bulbs

        // You can either set the color using the color mode
        "saturation": 100, // percent saturation in color between the center and outer of the hue wheel
        "hue": 240, // angle on the hue wheel 0-360°, red=0, green=120, blue=240

        // Or you can use color_temperature white mode
        // "color_temperature": 500, // between the boundaries returned by get homestatus : "color_temperature:min": 153, "color_temperature:max": 500

        "bridge": "xxx..."
      }
    ]
  }
}

I tried playing with the API and this works flawlessly.

Why do we need to add this feature

I would really need the Home Assistant integration to give me control on the colors of the lights, as I would be able to synchronize multiple bulbs.
(Even in the Home+ control app, you have to click on each bulb to set it’s color on the wheel, resulting in a cumbersome and not synchronized way to set multiple bulbs on a color at once, and you have different hue values since the wheel is not precise).

Possible issues ?

I don’t see a lot of things that can go wrong here, except that those lights are always added as switches in the Home assistant entities. Maybe switches don’t support color modes and color wheels.

It would maybe also help to enable this integration to import light modules as light and not switches, according to the types of the device reported in the API :
Netatmo Connect | Legrand API Documentation

I’ll hope you’ll find a way to add this feature support on the Netatmo API, it would really help me a ton.

Have a great day !

Screenshots

Here’s how my philips hue light looks in the Legrand Home+ control app, which shows that Netatmo uses the API to set colors o’ those lights, it is not yet supportes in the home assistant integration :

So what are you asking to be changed. To me this looks like a ‘share your project’ thing not a Feature Request.

Suggested Reading:
More about Feature Requests.

I found out that the netatmo api supports color change on lights, but the netatmo integration based on this api doesn’t support it yet.

I suggest adding the support for color lightbulbs in the netatmo integration.

I tried to help as much as I could by giving example of body parameters useful in an API request, but I can’t make modifications to the netatmo integration, I don’t have good enough coding knowledge.

Hi @cgtobi, it seems you are the main contributor to the Netatmo integration.

I hope that my post can be helpful to you in order to add colored-light support to the integration.

  1. Is it a feature you may plan on adding ?
  2. What is the (short) reason behind importing all the outlets/lights as switches in hass ?

Thanks