-
Notifications
You must be signed in to change notification settings - Fork 524
WWSTCERT-10225/10228/10231/10234 add driver to frient EMI devices #2730
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
base: main
Are you sure you want to change the base?
Changes from all commits
bfabc01
115fa8e
6b442b4
9b2dc97
3c48090
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: frient-power-energy-battery-consumption-report | ||
| components: | ||
| - id: main | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: energyMeter | ||
| version: 1 | ||
| - id: powerConsumptionReport | ||
| version: 1 | ||
| - id: battery | ||
| version: 1 | ||
| - id: firmwareUpdate | ||
| version: 1 | ||
| - id: refresh | ||
| version: 1 | ||
| categories: | ||
| - name: CurbPowerMeter | ||
| preferences: | ||
| - title: "Pulse Configuration" | ||
| name: pulseConfiguration | ||
| description: "Number of pulses the meter outputs per unit" | ||
| required: false | ||
| preferenceType: integer | ||
| definition: | ||
| minimum: 50 | ||
| maximum: 10000 | ||
| default: 1000 | ||
|
Comment on lines
+20
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pulse Configuration is the number of pulses the meter outputs per unit. It may be different depending on the meter, so we need an option to adjust it, so that the device reads measurements properly from a wide range of meters. |
||
| - title: "Initial Energy Consumption" | ||
| name: currentSummation | ||
| description: "Offset (scaled value) for current summation delivered" | ||
| required: false | ||
| preferenceType: number | ||
| definition: | ||
| minimum: 0 | ||
| maximum: 268435455 | ||
| default: 0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: frient-power-energy-consumption-report | ||
| components: | ||
| - id: main | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: energyMeter | ||
| version: 1 | ||
| - id: powerConsumptionReport | ||
| version: 1 | ||
| - id: firmwareUpdate | ||
| version: 1 | ||
| - id: refresh | ||
| version: 1 | ||
| categories: | ||
| - name: CurbPowerMeter | ||
| preferences: | ||
| - title: "Pulse Configuration" | ||
| name: pulseConfiguration | ||
| description: "Number of pulses the meter outputs per unit" | ||
| required: false | ||
| preferenceType: integer | ||
| definition: | ||
| minimum: 50 | ||
| maximum: 10000 | ||
| default: 1000 | ||
| - title: "Initial Energy Consumption" | ||
| name: currentSummation | ||
| description: "Offset (scaled value) for current summation delivered" | ||
| required: false | ||
| preferenceType: number | ||
| definition: | ||
| minimum: 0 | ||
| maximum: 268435455 | ||
| default: 0 |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these profiles should have different names, I think. The first two are going to be frient-specific because of the preferences, and the third has a misleading name since it uses components.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: frient-power-energy-current-voltage | ||
| components: | ||
| - id: main | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: energyMeter | ||
| version: 1 | ||
| - id: powerConsumptionReport | ||
| version: 1 | ||
| - id: firmwareUpdate | ||
| version: 1 | ||
| - id: refresh | ||
| version: 1 | ||
| categories: | ||
| - name: CurbPowerMeter | ||
| - id: production | ||
| label: Production | ||
| capabilities: | ||
| - id: energyMeter | ||
| version: 1 | ||
| - id: phaseA | ||
| label: "Phase A" | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: voltageMeasurement | ||
| version: 1 | ||
| - id: currentMeasurement | ||
| version: 1 | ||
| - id: phaseB | ||
| label: "Phase B" | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: voltageMeasurement | ||
| version: 1 | ||
| - id: currentMeasurement | ||
| version: 1 | ||
| - id: phaseC | ||
| label: "Phase C" | ||
| capabilities: | ||
| - id: powerMeter | ||
| version: 1 | ||
| - id: voltageMeasurement | ||
| version: 1 | ||
| - id: currentMeasurement | ||
| version: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| -- Copyright 2026 SmartThings, Inc. | ||
| -- Licensed under the Apache License, Version 2.0 | ||
|
|
||
| local is_frient_power_meter = function(opts, driver, device, zb_rx) | ||
| local FINGERPRINTS = require("frient.EMIZB-151.fingerprints") | ||
| for _, fingerprint in ipairs(FINGERPRINTS) do | ||
| if device:get_model() == fingerprint.model then | ||
| return true, require("frient.EMIZB-151") | ||
| end | ||
| end | ||
|
|
||
| return false | ||
| end | ||
|
|
||
| return is_frient_power_meter |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- Copyright 2026 SmartThings, Inc. | ||
| -- Licensed under the Apache License, Version 2.0 | ||
|
|
||
| local ZIGBEE_POWER_METER_FINGERPRINTS = { | ||
| { model = "EMIZB-151"} | ||
| } | ||
|
|
||
| return ZIGBEE_POWER_METER_FINGERPRINTS |
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.
Are these no longer necessary?
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.
Right. Even if new versions of the device report a different mfr string, we have to keep the old fingerprint around.