Skip to content

Add scene platform to Qbus integration #38836

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
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions source/_integrations/qbus.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ description: Instructions on how to integrate your Qbus installation with Home A
ha_category:
- Climate
- Light
- Scene
- Switch
ha_platforms:
- climate
- light
- scene
- switch
ha_iot_class: Local Push
ha_codeowners:
Expand Down Expand Up @@ -40,13 +42,12 @@ There is currently support for the following **Qbus** products within Home Assis

- **CTD01E to CTD03E (CTD 3.0)**: main controllers (yellow).
- **CTD10 to CTDMax (CTD 3.5)**: main controllers (black).
- **Toggle**: toggle outputs on controllers.
- **Dimmer**: dimmer outputs on controllers.

## Available entities

- **Climate**: manages thermostats by setting temperature and choosing presets.
- **Light**: controls dimmer lights, allowing both on/off functionality and brightness adjustment.
- **Scene**: activates predefined scenes.
- **Switch**: toggles on/off outputs.

## Removing the integration
Expand All @@ -59,6 +60,71 @@ This integration follows standard integration removal. No extra steps are requir

All data from **Qbus** entities are pushed to Home Assistant over MQTT.

## Examples

### Automation to activate Qbus scene

This automation will activate the **Watching TV** Qbus scene when turning on your TV.

Replace `media_player.my_tv` with your TV entity and `scene.ctd_000001_watching_tv` with your Qbus scene entity.

{% raw %}

```yaml
alias: Activate TV scene when turning on TV
description: ""
mode: single
triggers:
- entity_id:
- media_player.my_tv
from: "off"
to: "on"
trigger: state
conditions: []
actions:
- target:
entity_id: scene.ctd_000001_watching_tv
metadata: {}
alias: Activate TV scene
action: scene.turn_on
data: {}
```

{% endraw %}
Comment on lines +63 to +93
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update first automation example to use correct HA automation schema
The example should use singular trigger: with platform: state and to: fields, and the action: list should use service: rather than action:.
Here’s a diff for the first example:

@@ triggers:
- triggers:
-   - entity_id:
-       - media_player.my_tv
-     from: "off"
-     to: "on"
-     trigger: state
+ trigger:
+   - platform: state
+     entity_id: media_player.my_tv
+     to: 'on'

@@ conditions: []
- conditions: []
+ condition: []

@@ actions:
- actions:
-   - target:
-       entity_id: scene.ctd_000001_watching_tv
-     metadata: {}
-     alias: Activate TV scene
-     action: scene.turn_on
-     data: {}
+ action:
+   - service: scene.turn_on
+     target:
+       entity_id: scene.ctd_000001_watching_tv
+     data: {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Examples
### Automation to activate Qbus scene
This automation will activate the **Watching TV** Qbus scene when turning on your TV.
Replace `media_player.my_tv` with your TV entity and `scene.ctd_000001_watching_tv` with your Qbus scene entity.
{% raw %}
```yaml
alias: Activate TV scene when turning on TV
description: ""
mode: single
triggers:
- entity_id:
- media_player.my_tv
from: "off"
to: "on"
trigger: state
conditions: []
actions:
- target:
entity_id: scene.ctd_000001_watching_tv
metadata: {}
alias: Activate TV scene
action: scene.turn_on
data: {}
```
{% endraw %}
alias: Activate TV scene when turning on TV
description: ""
mode: single
trigger:
- platform: state
entity_id: media_player.my_tv
to: 'on'
condition: []
action:
- service: scene.turn_on
target:
entity_id: scene.ctd_000001_watching_tv
data: {}


### Extend Qbus scene

You can extend a Qbus scene by adding other entities in an automation.
In this example, a LED strip is turned on when the **Watching TV** Qbus scene is activated.

Replace `scene.ctd_000001_watching_tv` with your Qbus scene entity and `light.tv_strip` with your light entity.

{% raw %}

```yaml
alias: Extend "Watching TV" Qbus scene
description: ""
triggers:
- trigger: state
entity_id:
- scene.ctd_000001_watching_tv
conditions: []
actions:
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 255
- 187
- 0
brightness_pct: 40
target:
entity_id: light.tv_strip
mode: single
```

{% endraw %}

Comment on lines +95 to +127
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update second automation example to use correct HA automation schema
Similarly, refactor the second example to use singular trigger: and the action: list with service:. For example:

@@ triggers:
- triggers:
-   - trigger: state
-     entity_id:
-       - scene.ctd_000001_watching_tv
+ trigger:
+   - platform: state
+     entity_id: scene.ctd_000001_watching_tv

@@ actions:
- actions:
-   - action: light.turn_on
-     metadata: {}
-     data:
-       rgb_color:
-         - 255
-         - 187
-         - 0
-       brightness_pct: 40
-     target:
-       entity_id: light.tv_strip
+ action:
+   - service: light.turn_on
+     target:
+       entity_id: light.tv_strip
+     data:
+       rgb_color: [255, 187, 0]
+       brightness_pct: 40
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Extend Qbus scene
You can extend a Qbus scene by adding other entities in an automation.
In this example, a LED strip is turned on when the **Watching TV** Qbus scene is activated.
Replace `scene.ctd_000001_watching_tv` with your Qbus scene entity and `light.tv_strip` with your light entity.
{% raw %}
```yaml
alias: Extend "Watching TV" Qbus scene
description: ""
triggers:
- trigger: state
entity_id:
- scene.ctd_000001_watching_tv
conditions: []
actions:
- action: light.turn_on
metadata: {}
data:
rgb_color:
- 255
- 187
- 0
brightness_pct: 40
target:
entity_id: light.tv_strip
mode: single
```
{% endraw %}

## Known limitations

The integration does not provide a way to update the firmware on the devices. This can only be done with the configuration software System Manager.
Expand Down