-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Add scene support to WMS WebControl pro #126081
Conversation
b76c336
to
1359fc9
Compare
self._attr_device_info = DeviceInfo( | ||
identifiers={(DOMAIN, scene_id_str)}, | ||
manufacturer=MANUFACTURER, | ||
model="Scene", | ||
name=scene.name, | ||
serial_number=scene_id_str, | ||
suggested_area=scene.room.name, | ||
via_device=(DOMAIN, config_entry_id), | ||
configuration_url=f"http://{scene.host}/control", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is every scene its own device?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't need to be. Scenes are not a device in the real world, so we could skip this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I am interested in how they work since they are linked to a room
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenes in WMS are basically the same thing as in HA: "A scene entity is an entity that can reproduce a wanted state for a group of entities. A scene entity can activate the scene towards a group of devices but remains stateless ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check. Yea I remember that Hue also has scenes, but they are coupled to the group they affect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so should I remove or keep the device info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked: The following integrations also provide DeviceInfo for Scene implementations:
- fibaro
- hue
- litejet
- lutron_caseta
- tuya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some more research and found out the following:
Fibaro links the scenes to the hub device:
core/homeassistant/components/fibaro/scene.py
Lines 51 to 54 in 8950e81
# All scenes are shown on hub device | |
self._attr_device_info = DeviceInfo( | |
identifiers={(DOMAIN, controller.hub_serial)} | |
) |
Hue actually links the scenes to the room/zone device:
core/homeassistant/components/hue/scene.py
Lines 103 to 107 in 8950e81
# we create a virtual service/device for Hue zones/rooms | |
# so we have a parent for grouped lights and scenes | |
self._attr_device_info = DeviceInfo( | |
identifiers={(DOMAIN, self.group.id)}, | |
) |
Litejet links the scenes to the hub (mcp?) device:
core/homeassistant/components/litejet/scene.py
Lines 51 to 56 in 8950e81
self._attr_device_info = DeviceInfo( | |
identifiers={(DOMAIN, f"{entry_id}_mcp")}, | |
name="LiteJet", | |
manufacturer="Centralite", | |
model=system.model_name, | |
) |
Lutron Caseta links the scenes to the hub (bridge) device:
core/homeassistant/components/lutron_caseta/scene.py
Lines 41 to 43 in 8950e81
self._attr_device_info = DeviceInfo( | |
identifiers={(CASETA_DOMAIN, data.bridge_device["serial"])}, | |
) |
Only Tuya links the scene to its own (scene_id) device:
self._attr_unique_id = f"tys{scene.scene_id}" |
core/homeassistant/components/tuya/scene.py
Lines 44 to 50 in 8950e81
return DeviceInfo( | |
identifiers={(DOMAIN, f"{self.unique_id}")}, | |
manufacturer="tuya", | |
name=self.scene.name, | |
model="Tuya Scene", | |
entry_type=DeviceEntryType.SERVICE, | |
) |
So, we have Hue linking to rooms, 3 others linking to their hub and just Tuya creating per scene devices.
Based on these findings, any suggestion on how to move forward?
82c2bad
to
8c351fc
Compare
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Joost Lekkerkerker <[email protected]>
Thanks a lot! 👍 |
Proposed change
Add scene support to WMS WebControl pro
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: