From 3e6ad9006aa74829352dc2bbc54ec508766eb30a Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 9 Nov 2022 11:07:08 -0600 Subject: [PATCH] Fix eNexus total current for Smartpack S (#14606) * Fix eNexus divisor Thanks to @loopodoopo, it looks like Smartpack S returns 1/10 Amps instead of Amps. Set them separately fixes #14414 * I did not wait for data to fully update :D --- includes/definitions/discovery/enexus.yaml | 19 +++++++++++++++++++ tests/data/enexus_smartpacks.json | 8 ++++---- tests/data/enexus_smartpacks2.json | 8 ++++---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/includes/definitions/discovery/enexus.yaml b/includes/definitions/discovery/enexus.yaml index 8f6957035a..81078a7b17 100644 --- a/includes/definitions/discovery/enexus.yaml +++ b/includes/definitions/discovery/enexus.yaml @@ -316,6 +316,25 @@ modules: group: Output warn_limit: rectifiersCurrentMinorAlarmLevel high_limit: rectifiersCurrentMajorAlarmLevel + skip_values: + - + device: hardware + op: '=' + value: Smartpack S + - # Smartpack S returns 10ths of an amp + oid: rectifiersCurrent + value: rectifiersCurrentValue + num_oid: '.1.3.6.1.4.1.12148.10.5.2.5.{{ $index }}' + descr: System Output Current + index: 'current.{{ $index }}' + group: Output + divisor: 10 + warn_limit: rectifiersCurrentMinorAlarmLevel + high_limit: rectifiersCurrentMajorAlarmLevel + skip_values: + - device: hardware + op: '!=' + value: Smartpack S - oid: rectifierTable value: rectifierOutputCurrentValue diff --git a/tests/data/enexus_smartpacks.json b/tests/data/enexus_smartpacks.json index 0052500647..0743da42ff 100644 --- a/tests/data/enexus_smartpacks.json +++ b/tests/data/enexus_smartpacks.json @@ -82,11 +82,11 @@ "sensor_type": "enexus", "sensor_descr": "System Output Current", "group": "Output", - "sensor_divisor": 1, + "sensor_divisor": 10, "sensor_multiplier": 1, - "sensor_current": 4, - "sensor_limit": 5000, - "sensor_limit_warn": 4000, + "sensor_current": 0.4, + "sensor_limit": 500, + "sensor_limit_warn": 400, "sensor_limit_low": null, "sensor_limit_low_warn": null, "sensor_alert": 1, diff --git a/tests/data/enexus_smartpacks2.json b/tests/data/enexus_smartpacks2.json index 87adb4d65d..8e463f6098 100644 --- a/tests/data/enexus_smartpacks2.json +++ b/tests/data/enexus_smartpacks2.json @@ -82,11 +82,11 @@ "sensor_type": "enexus", "sensor_descr": "System Output Current", "group": "Output", - "sensor_divisor": 1, + "sensor_divisor": 10, "sensor_multiplier": 1, - "sensor_current": 57, - "sensor_limit": 5000, - "sensor_limit_warn": 4000, + "sensor_current": 5.7, + "sensor_limit": 500, + "sensor_limit_warn": 400, "sensor_limit_low": null, "sensor_limit_low_warn": null, "sensor_alert": 1,