Skip to content

Add example section for APCUPSD #38813

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

Merged
merged 3 commits into from
Apr 30, 2025
Merged
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
24 changes: 24 additions & 0 deletions source/_integrations/apcupsd.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@ Some sensors are disabled by default, since they provide information that is onl
- UPS Transfer from Battery (XOFFBATT)
- UPS Transfer to Battery (XONBATT)

## Examples

### Send me a push notification when UPS load is high

{% raw %}

```yaml
alias: "APC UPS Load High Notification"
description: "Notify when APC UPS load is too high"
mode: single
triggers:
- trigger: numeric_state
entity_id:
- sensor.gogoups_load
above: 80
Comment on lines +154 to +158
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML trigger configuration.
The keys triggers: and inner trigger: syntax do not match Home Assistant’s official automation schema. Use a singular trigger key with platform rather than trigger:.

Suggested diff:

@@ -155,5 +155,5
-  triggers:
-  - trigger: numeric_state
-    entity_id:
-      - sensor.gogoups_load
-    above: 80
+trigger:
+  - platform: numeric_state
+    entity_id: sensor.apcupsd_loadpct
+    above: 80
📝 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
triggers:
- trigger: numeric_state
entity_id:
- sensor.gogoups_load
above: 80
trigger:
- platform: numeric_state
entity_id: sensor.apcupsd_loadpct
above: 80

conditions: []
actions:
- action: notify.notify
data:
message: "APC UPS load is high: {{ states('sensor.apc_ups_load') }}%"
```
Comment on lines +160 to +164
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct action syntax and entity naming.
The snippet uses actions: + action: instead of the expected singular action: key with a service: field. Also update the template to reference the corrected entity (sensor.apcupsd_loadpct).

Proposed diff:

@@ -161,6 +161,6
-  actions:
-  - action: notify.notify
-    data:
-      message: "APC UPS load is high: {{ states('sensor.apc_ups_load') }}%"
+action:
+  - service: notify.notify
+    data:
+      message: "APC UPS load is high: {{ states('sensor.apcupsd_loadpct') }}%"
📝 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
actions:
- action: notify.notify
data:
message: "APC UPS load is high: {{ states('sensor.apc_ups_load') }}%"
```
action:
- service: notify.notify
data:
message: "APC UPS load is high: {{ states('sensor.apcupsd_loadpct') }}%"


{% endraw %}

## Data updates

The integration {% term polling polls %} data from your APC UPS Daemon every 60 seconds by default.
Expand Down