Skip to content

Conversation

@nrbrt
Copy link

@nrbrt nrbrt commented Jan 13, 2026

Summary

IKEA MYGGSPRAY motion sensors (E2494) report as deviceType: "occupancySensor" instead of "motionSensor". They also lack the is_on attribute that regular motion sensors have.

This causes the sensors to not be detected by the integration.

Changes

  • Override get_motion_sensors() in HubX to include both motionSensor and occupancySensor device types
  • Override get_motion_sensor_by_id() to accept both device types
  • Add MotionSensorX class with optional is_on attribute for MYGGSPRAY compatibility

Testing

Tested with IKEA MYGGSPRAY E2494 sensors on Home Assistant 2026.1.1 with dirigera library 1.2.5.

Sensors are now correctly detected and report motion state via is_detected attribute.

IKEA MYGGSPRAY motion sensors (E2494) report as deviceType
'occupancySensor' instead of 'motionSensor'. They also lack the
'is_on' attribute that regular motion sensors have.

This PR fixes both issues by:
- Including 'occupancySensor' in motion sensor queries
- Creating MotionSensorX with optional is_on attribute
- Overriding get_motion_sensors() and get_motion_sensor_by_id()

Tested with IKEA MYGGSPRAY E2494 sensors on Home Assistant 2026.1.1.
MYGGSPRAY motion sensors send events as occupancySensor device type.
Without this, the hub_event_listener ignores real-time state changes
from these sensors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant