home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.65k stars 30.41k forks source link

Color when turning on light is always overridden by light_profiles.csv #69499

Closed trancefam closed 2 years ago

trancefam commented 2 years ago

The problem

Hi, I have about 30 wiz bulbs. I recently switched from the custom component to the core version of Wiz. I am having a new issue where when I turn any of the bulbs from off to on, the value I have set in light_profiles.csv overrides the desired value. For example, when I activate a scene that is supposed to turn on the bulbs red, they turn on white (the default in light_profiles.csv). If I activate the scene a second time (when the bulbs are already on), it works.

I have noticed if I delete light_profiles.csv, it works as expected.

What version of Home Assistant Core has the issue?

core-2022.3.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

wiz

Link to integration documentation on our website

https://www.home-assistant.io/integrations/wiz/

Diagnostics information

Example of a model of bulb I have and the firmware:

ESP01_SHRGB1C_31

1.24.0

Example YAML snippet

My light_profiles.csv:

id,x,y,brightness
relax,0.5119,0.4147,144
concentrate,0.5119,0.4147,219
energize,0.368,0.3686,203
reading,0.4448,0.4066,240
group.all_lights.default,0.323, 0.329,255

According to the light_profiles.csv docs: "If no data is sent, and a default profile exists, the default profile will be applied."

However, the below yml will first turn on the light white. Calling it a second time will set it to the correct color.

service: light.turn_on
data:
  color_name: blue
target:
  entity_id: light.left_table

Anything in the logs that might be useful for us?

No messages in the log

Additional information

All of my bulbs are blocked at the firewall. They cannot reach the internet. This means the firmware of the bulbs aren't up to date. To test if this was a firmware issue, I unblocked one bulb and it updated from 1.24.0 to 1.26.0, then restarted Home Assistant. I experienced the same result -- the light_profiles.csv overrode the desired value on the initial bulb turn on.

I captured the wiz diagnostics for both pre update (1.24.0) and post update (1.26.0):

1.24.0 Diagnostics

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.3.8",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "5.10.28-Unraid",
    "run_as_root": true
  },
  "custom_components": {
    REDACTED**
  },
  "integration_manifest": {
    "domain": "wiz",
    "name": "WiZ",
    "config_flow": true,
    "dhcp": [
      REDACTED**
    ],
    "dependencies": [
      "network"
    ],
    "quality_scale": "platinum",
    "documentation": "https://www.home-assistant.io/integrations/wiz",
    "requirements": [
      "pywizlight==0.5.13"
    ],
    "iot_class": "local_push",
    "codeowners": [
      "@sbidy"
    ],
    "is_built_in": true
  },
  "data": {
    "entry": {
      "title": "Left Table",
      "data": {
        "host": "REDACTED**"
      }
    },
    "data": {
      "state": {
        "mac": "REDACTED**",
        "rssi": -49,
        "src": "",
        "state": false,
        "sceneId": 0,
        "temp": 4000,
        "dimming": 100
      },
      "white_range": null,
      "extended_white_range": [
        2200.0,
        2700.0,
        6500.0,
        6500.0
      ],
      "bulb_type": {
        "features": {
          "color": true,
          "color_tmp": true,
          "effect": true,
          "brightness": true,
          "dual_head": false
        },
        "name": "ESP03_SHRGB1C_01",
        "kelvin_range": {
          "max": 6500,
          "min": 2200
        },
        "bulb_type": "RGB",
        "fw_version": "1.24.0",
        "white_channels": 1,
        "white_to_color_ratio": 60
      },
      "last_push": -120.0,
      "push_running": true,
      "version": "0.5.13",
      "history": {
        "receive": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "homeId": "**REDACTED**",
              "roomId": "**REDACTED**",
              "rgn": "eu",
              "moduleName": "ESP03_SHRGB1C_01",
              "fwVersion": "1.24.0",
              "groupId": 9,
              "ping": 0
            }
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "env": "pro",
            "result": {
              "ps": 2,
              "pwmFreq": 1000,
              "pwmRange": [
                0,
                100
              ],
              "wcr": 60,
              "nowc": 1,
              "cctRange": [
                2200,
                2700,
                6500,
                6500
              ],
              "renderFactor": [
                200,
                255,
                150,
                255,
                0,
                0,
                40,
                0,
                0,
                0
              ],
              "hasAdjMinDim": 0,
              "hasTapSensor": 0,
              "pm": 0,
              "fanSpeed": 0,
              "wizc1": {
                "mode": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                ]
              },
              "wizc2": {
                "mode": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                ]
              }
            }
          },
          "getPilot": {
            "method": "getPilot",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "rssi": -49,
              "src": "",
              "state": false,
              "sceneId": 0,
              "temp": 4000,
              "dimming": 100
            }
          },
          "registration": {
            "method": "registration",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "success": true
            }
          },
          "setPilot": {
            "method": "setPilot",
            "env": "pro",
            "result": {
              "success": true
            }
          }
        },
        "send": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "params": {}
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "params": {}
          },
          "getPilot": {
            "method": "getPilot",
            "params": {}
          },
          "registration": {
            "params": {
              "phoneIp": "REDACTED**",
              "register": true,
              "phoneMac": "REDACTED**"
            },
            "method": "registration"
          },
          "setPilot": {
            "method": "setPilot",
            "params": {
              "state": false
            }
          }
        },
        "push": {},
        "last_error": null
      },
      "push_manager": {
        "running": true,
        "fail_reason": null
      }
    }
  }
}

1.26.0 Diagnostics

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.3.8",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "5.10.28-Unraid",
    "run_as_root": true
  },
  "custom_components": {
    REDACTED**
  },
  "integration_manifest": {
    "domain": "wiz",
    "name": "WiZ",
    "config_flow": true,
    "dhcp": [
      REDACTED**
    ],
    "dependencies": [
      "network"
    ],
    "quality_scale": "platinum",
    "documentation": "https://www.home-assistant.io/integrations/wiz",
    "requirements": [
      "pywizlight==0.5.13"
    ],
    "iot_class": "local_push",
    "codeowners": [
      "@sbidy"
    ],
    "is_built_in": true
  },
  "data": {
    "entry": {
      "title": "Left Table",
      "data": {
        "host": "REDACTED**"
      }
    },
    "data": {
      "state": {
        "mac": "REDACTED**",
        "rssi": -51,
        "src": "udp",
        "state": false,
        "sceneId": 0,
        "r": 1,
        "g": 0,
        "b": 0,
        "c": 0,
        "w": 255,
        "dimming": 100
      },
      "white_range": null,
      "extended_white_range": [
        2200.0,
        2700.0,
        6500.0,
        6500.0
      ],
      "bulb_type": {
        "features": {
          "color": true,
          "color_tmp": true,
          "effect": true,
          "brightness": true,
          "dual_head": false
        },
        "name": "ESP03_SHRGB1C_01",
        "kelvin_range": {
          "max": 6500,
          "min": 2200
        },
        "bulb_type": "RGB",
        "fw_version": "1.26.0",
        "white_channels": 1,
        "white_to_color_ratio": 60
      },
      "last_push": 174039.544114474,
      "push_running": true,
      "version": "0.5.13",
      "history": {
        "receive": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "homeId": "**REDACTED**",
              "roomId": "**REDACTED**",
              "rgn": "eu",
              "moduleName": "ESP03_SHRGB1C_01",
              "fwVersion": "1.26.0",
              "groupId": 9,
              "ping": 0
            }
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "env": "pro",
            "result": {
              "ps": 2,
              "pwmFreq": 1000,
              "pwmRange": [
                0,
                100
              ],
              "wcr": 60,
              "nowc": 1,
              "cctRange": [
                2200,
                2700,
                6500,
                6500
              ],
              "renderFactor": [
                200,
                255,
                150,
                255,
                0,
                0,
                40,
                0,
                0,
                0
              ],
              "wizc1": {
                "mode": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                ]
              },
              "wizc2": {
                "mode": [
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                ]
              }
            }
          },
          "getPilot": {
            "method": "getPilot",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "rssi": -51,
              "src": "",
              "state": false,
              "sceneId": 0,
              "r": 255,
              "g": 63,
              "b": 0,
              "c": 0,
              "w": 0,
              "dimming": 100
            }
          },
          "registration": {
            "method": "registration",
            "env": "pro",
            "result": {
              "mac": "REDACTED**",
              "success": true
            }
          },
          "setPilot": {
            "method": "setPilot",
            "env": "pro",
            "result": {
              "success": true
            }
          }
        },
        "send": {
          "getSystemConfig": {
            "method": "getSystemConfig",
            "params": {}
          },
          "getModelConfig": {
            "method": "getModelConfig",
            "params": {}
          },
          "getPilot": {
            "method": "getPilot",
            "params": {}
          },
          "registration": {
            "params": {
              "phoneIp": "REDACTED**",
              "register": true,
              "phoneMac": "REDACTED**"
            },
            "method": "registration"
          },
          "setPilot": {
            "method": "setPilot",
            "params": {
              "state": false
            }
          }
        },
        "push": {
          "syncPilot": {
            "method": "syncPilot",
            "env": "pro",
            "params": {
              "mac": "REDACTED**",
              "rssi": -51,
              "src": "hb",
              "mqttCd": 0,
              "ts": 1649350607,
              "state": false,
              "sceneId": 0,
              "r": 1,
              "g": 0,
              "b": 0,
              "c": 0,
              "w": 255,
              "dimming": 100
            }
          }
        },
        "last_error": null
      },
      "push_manager": {
        "running": true,
        "fail_reason": null
      }
    }
  }
}
probot-home-assistant[bot] commented 2 years ago

light documentation light source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

wiz documentation wiz source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (light) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

probot-home-assistant[bot] commented 2 years ago

Hey there @sbidy, mind taking a look at this issue as it has been labeled with an integration (wiz) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

balloob commented 2 years ago

I looked into this. This is not an issue with Wiz but with light profiles.

emontnemery commented 2 years ago

Related: https://github.com/home-assistant/core/pull/49376