Skip to content

Add support for power metering and switch updates#36

Open
deiger wants to merge 4 commits into
BrettSheleski:masterfrom
deiger:tasmota
Open

Add support for power metering and switch updates#36
deiger wants to merge 4 commits into
BrettSheleski:masterfrom
deiger:tasmota

Conversation

@deiger
Copy link
Copy Markdown

@deiger deiger commented Jan 30, 2020

Add tiles and capabilities similar to e.g. "Zigbee Metering Plug", for Power Meter and Energy Meter.
Also made it auto-refresh every minute - this is applicable also for non power metering switches, as at the moment a manual switch would go unnoticed.

Otherwise the status is updated only when it is changed by the app (not by the switch or by power metering update).
@BrettSheleski
Copy link
Copy Markdown
Owner

Thanks for the contribution, however I believe you put the energy monitoring stuff in the wrong device handler. The Tasmota-Power device handler is meant to be a child device for devices like the Sonoff Basic which had no energy monitoring capabilities. This is why the momentary capability (that I saw you removed) was also declared.

Instead a different device handler should be used/created (can't remember if there's the start of one or not already).

@BrettSheleski
Copy link
Copy Markdown
Owner

Please create a "Tasmota-Energy" device handler that handles the reporting of energy monitoring stuff. Then update the main Tasmota device handler to spawn this new child device handler for the correct module type(s).

This way if your device does not support energy monitoring then you will not have the every monitoring device spawned by SmartThings.

deiger and others added 2 commits January 31, 2020 21:57
Otherwise the status is updated only when it is changed by the app (not by the switch or by power metering update).
@deiger
Copy link
Copy Markdown
Author

deiger commented Jan 31, 2020

OK, moved to a new device handler. PTAL.
Note that some devices templates here use Generic (18), so they won't get the right child device now.

@BrettSheleski
Copy link
Copy Markdown
Owner

The Sonoff-POW should spawn both a Tasmota-Power and a Tasmota-Energy child device. The two handlers should do their things independently.

Please remove the Switch capability from the Tasmota-Energy (that's what the Tasmota-Power device handler is for).

@deiger
Copy link
Copy Markdown
Author

deiger commented Jan 31, 2020

I'm not sure I understand why. It's a single device, with a single functionality. The energy metering is coupled with the switch.
I for one would find it unusable if I had two separate devices for it.
This is how this is done e.g. for Zigbee switches like "Zigbee Metering Plug", as well as for Z-Wave modules like Qubino and Fibaro. For the latter, in case of a double relay you get a child device for each, but the power metering is added on the existing devices.
I can fully understand that an unrelated sensor that "rides" on a relay (like Sonoff TH10 or Qubino's temperature sensor) would get it's own device, but in this case the metering is for that specific device.

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.

2 participants