Skip to content

Feature/wemo power energy#873

Closed
cjswedes wants to merge 2 commits intomainfrom
feature/wemo-power-energy
Closed

Feature/wemo power energy#873
cjswedes wants to merge 2 commits intomainfrom
feature/wemo-power-energy

Conversation

@cjswedes
Copy link
Copy Markdown
Contributor

Im not convinced in the energy meter reporting of this device at all, in fact it may be worthwhile to only report powerMeter capabilities for the device since it is very inconsistent in its values for energy reports (total energy fluctuates a lot including negative values, and it seems very high)

This implementation is based off the way device report payloads are interpreted here and here

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 26, 2023

Channel deleted.

@github-actions
Copy link
Copy Markdown

Test Results

     52 files     333 suites   0s ⏱️
1 576 tests 1 576 ✔️ 0 💤 0
2 699 runs  2 699 ✔️ 0 💤 0

Results for commit eb03888.

@github-actions
Copy link
Copy Markdown

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against eb03888

@cjswedes
Copy link
Copy Markdown
Contributor Author

Due to the weird energy reports I have gotten from the device I see a few options to move this PR forward:

  1. Remove energyMeter cap from the insight devices
  2. Leave it in there as it is now, but implement a profile switch based on a preference value, so that users can opt into the energy reporting, which is somewhat suspect
  3. Implement energy reporting in software. The energy_today_Wh field that is reported seems to be accurate and could be used to keep a running total for the device and periodically emit that total. This would also allow for resetting of the energyMeter since we control the total rather than the device
  4. Implement the powerConsumptionReport capability instead. This sort of seems like option 3 but the capability is setup for it. Although, I am not sure how accurate all the fields are that would be needed from the device, and if the device is actually resetting the energy totals daily.

@cjswedes cjswedes requested review from ctowns, dljsjr and greens July 27, 2023 21:25

if result.current_power_mW ~= nil and result.energy_today_Wh ~= nil and
device:supports_capability_by_id("powerMeter") and device:supports_capability_by_id("energyMeter") then
device:emit_event(capabilities.powerMeter.power(result.current_power_mW / 1000)) --ST uses watts by default
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought you felt safe always emitting the power events?

@greens
Copy link
Copy Markdown
Contributor

greens commented Jul 27, 2023

Since I suggested it, I'm most partial to option 2.

@lelandblue
Copy link
Copy Markdown
Contributor

@cjswedes Should we close this PR?

@cjswedes
Copy link
Copy Markdown
Contributor Author

I would prefer to leave it available for any developer out there to pick up, since there was non-trivial engineering time put into figuring out the message format for energy from these devices. If it needs to be closed, I will move it to a personal repo to avoid losing the work.

@hcarter-775
Copy link
Copy Markdown
Contributor

@cjswedes could we close this PR?

@cjswedes
Copy link
Copy Markdown
Contributor Author

cjswedes commented May 7, 2026

😢

@cjswedes cjswedes closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants