-
Notifications
You must be signed in to change notification settings - Fork 35
Add remotePressEvent support for lightController remotes (STYRBAR, RODRET) #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nrbrt
wants to merge
12
commits into
sanjoyg:main
Choose a base branch
from
nrbrt:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
Cherry-picked from sanjoyg#163 by noahwilliamsson
Cherry-picked from sanjoyg#174 by lordylike Fixes sanjoyg#171
Cherry-picked from sanjoyg#182 by stirante
Cherry-picked from sanjoyg#161 by JuhaMR
STYRBAR has 4 buttons but was treated as 1-button controller. This enables button1_*, button2_*, button3_*, button4_* triggers.
Adds English translations for button3_* and button4_* triggers to support 4-button controllers like STYRBAR.
STYRBAR, RODRET and similar lightController-type remotes send remotePressEvent messages via WebSocket instead of sceneUpdated. Previously these were discarded as "non state message". This commit adds a new handler (parse_remote_press_event) that: - Parses remotePressEvent messages from lightController devices - Converts clickPattern to trigger types (single_click, long_press, etc) - Handles multi-button controllers using the _N suffix - Debounces duplicate events within 1 second (IKEA bug workaround) - Fires dirigera_platform_event for Home Assistant automations Enables use of STYRBAR 4-button and RODRET 2-button remotes in Home Assistant automations without requiring scene configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This was referenced Jan 25, 2026
The min_color_temp_kelvin, max_color_temp_kelvin, and color_temp_kelvin properties were returning raw mired values from Dirigera instead of converting them to Kelvin as Home Assistant expects. Also fixed async_turn_on to use direct API patch for setting color temperature, bypassing the dirigera library's broken validation that rejects valid Kelvin values. Fixes sanjoyg#181 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed OptionsFlowHandler to inherit from OptionsFlowWithConfigEntry instead of OptionsFlow with explicit self.config_entry assignment. This fixes the deprecation warning: "Detected that custom integration 'dirigera_platform' sets option flow config_entry explicitly, which is deprecated" Fixes sanjoyg#170 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The IKEA ALPSTUGA air quality monitor reports CO2 levels via the currentCO2 attribute, but the dirigera library doesn't have this field in its EnvironmentSensorAttributes pydantic model yet. This commit: - Creates patched EnvironmentSensorAttributesX with current_c_o2 field - Creates EnvironmentSensorX class using the patched attributes - Adds get_environment_sensors/get_environment_sensor_by_id to HubX - Updates add_environment_sensors to create CO2 entities - Adds None default to getattr calls for safer attribute checking Fixes sanjoyg#178 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for
remotePressEventmessages from lightController-type remotes like STYRBAR and RODRET.Previously, these controllers were not usable in Home Assistant automations because:
deviceType: "lightController"(notshortcutController)canSend: ["isOn", "lightLevel"](no press events)remotePressEventWebSocket messages which were discarded as "non state message"Changes
Added
parse_remote_press_event()function inhub_event_listener.pythat:remotePressEventmessages from lightController devicesclickPatternto trigger types (single_click,long_press,double_click)_Nsuffix (e.g.,button2_single_click)dirigera_platform_eventfor Home Assistant automationsTested with
Event format
{"type":"remotePressEvent","data":{"id":"xxx_1","clickPattern":"singlePress"}}Fires as:
{'type': 'button1_single_click', 'device_id': '...', 'entity_id': 'sensor.remote_name'}🤖 Generated with Claude Code