SOLVED : Error after HA 2022.3 in Wiz integration cannot import name 'PIR_SOURCE'

After the update of HA with the 2022.3 release, I’ve got some weird errors in the home-assistant.log file:

2022-03-10 15:18:15 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration wiz: cannot import name 'PIR_SOURCE' from 'pywizlight.bulb' (/usr/local/lib/python3.9/site-packages/pywizlight/bulb.py)
2022-03-10 15:18:15 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration wiz: cannot import name 'PIR_SOURCE' from 'pywizlight.bulb' (/usr/local/lib/python3.9/site-packages/pywizlight/bulb.py)
2022-03-10 15:18:15 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 743, in async_create_flow
    integration.get_platform("config_flow")
  File "/usr/src/homeassistant/homeassistant/loader.py", line 572, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 589, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/wiz/__init__.py", line 8, in <module>
    from pywizlight.bulb import PIR_SOURCE
ImportError: cannot import name 'PIR_SOURCE' from 'pywizlight.bulb' (/usr/local/lib/python3.9/site-packages/pywizlight/bulb.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 221, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 750, in async_create_flow
    raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler
2022-03-10 15:18:16 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 743, in async_create_flow
    integration.get_platform("config_flow")
  File "/usr/src/homeassistant/homeassistant/loader.py", line 572, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 589, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/wiz/__init__.py", line 8, in <module>
    from pywizlight.bulb import PIR_SOURCE
ImportError: cannot import name 'PIR_SOURCE' from 'pywizlight.bulb' (/usr/local/lib/python3.9/site-packages/pywizlight/bulb.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 221, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 750, in async_create_flow
    raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler

It seems related to the Wiz integration which is installed in my configuration.
Wiz lights seems to work normally either.

Any help or clues will be appreciated.

Ok the Wiz integration is now natively integrated in HA. You just have to suppress your /config/custom_components/wiz_light directory and remove the Wiz light integration.

After that, you lost all your Wiz entities and just to recreate with the same id. Check your automation and scenes. In my case, all were in place.

In my case this solve the issue.

To be clear, you were trying to add a device to the core integration while it was already part of the custom integration installed through HACS?
Or, did the errors just appear after updating without doing anything with the core integration?