dirigera_platform icon indicating copy to clipboard operation
dirigera_platform copied to clipboard

v2.3 Failed to setup

Open Edluund opened this issue 1 year ago • 5 comments

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/__init__.py", line 117, in async_setup_entry await platform.make_devices(hass,hass_data[CONF_IP_ADDRESS], hass_data[CONF_TOKEN]) File "/config/custom_components/dirigera_platform/ikea_gateway.py", line 97, in make_devices motion_sensors = await hass.async_add_executor_job(hub.get_motion_sensors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 256, in get_motion_sensors return [dict_to_motion_sensor(sensor, self) for sensor in sensors] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/devices/motion_sensor.py", line 34, in dict_to_motion_sensor return MotionSensor(dirigeraClient=dirigera_client, **data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__ pydantic.error_wrappers.ValidationError: 1 validation error for MotionSensor attributes -> isOn field required (type=value_error.missing)

Edluund avatar Oct 19 '24 21:10 Edluund

It seems the motion sensor you have doesnt have isOn field. What kind of motion sensors do you have in your installation

sanjoyg avatar Oct 20 '24 05:10 sanjoyg

Its the old motion sensor: Firmware: 24.4.5 Model: TRADFRI motion sensor Product-ID: E1745

Edluund avatar Oct 20 '24 12:10 Edluund

That is why its failing as it doesnt have isOn property. Would u want it to be ignored... i can put in a fix

sanjoyg avatar Oct 20 '24 13:10 sanjoyg

As long as I'm still able to get data from the motion sensor a fix is fine

Edluund avatar Oct 20 '24 22:10 Edluund

This took time, was away. What is the point in the fix cause the motion sensor isnt going to report the status. Would you provide the dump json so that I can see what is the alternate attribute to derive the state

sanjoyg avatar Mar 08 '25 05:03 sanjoyg