[RELEASE]Minoston Power Switch

[RELEASE]Minoston Power Switch
Minoston Power Switch

1630567348(1)

Driver Capabilities

  • Power Meter
  • Energy Meter
  • Voltage Measurement
  • Current Meter
  • Refresh
  • Health Check
  • Configuration

Configurable Options

  • LED Indicator Mode("0":"On When On", "1":"Off When On", "2":"Always Off", "3":"Always On")
  • Auto Turn-Off Timer(0,Disabled; 1 - 65535 minutes)
  • Auto Turn-On Timer(0,Disabled; 1 - 65535 minutes)
  • Power Failure Recovery("0":"Remember last status", "1":"Turn Off", "2":"Turn On")
  • Power Report Value Change(0 - 5:0W - 5w, defualt:1)
  • Power Reporting Interval(1 - 65535:1 - 65535 minutes, defualt:1)
  • Current Report Value Change(1 - 10:0.1A - 1A, defualt:1)
  • Electricity Report Value Change(1 - 100:0.01KWH - 1KWH, defualt:1)

Features

  • Standardized device data: FirmwareVersion, ProtocolVersion,Configurable

Changelog

v1.0.0

  • Initial Release
5 Likes

Nice! I have to give it a try this weekend, but this means I can stop working on my own driver for it! Any chance you have played with their outdoor plug?

1 Like

Of course, when I started writing this driver, I already got the relevant equipment.

I used this driver and it worked like a charm. Until i realized the power reporting interval was off the charts in the logs. Is there a way to slow up the reporting interval? Any help would be much appreciated.

1 Like

Is there a way to set this so that it does not report changes until the power consumption is greater than a certain value?

There is currently no design plan for the function you said.

That should be able to be handled with the driver. A setting in preferences could be added which just ignores the power responses unless they are sufficiently different (assuming it cannot configure the device to report differently). Does not prevent the "traffic" of the device reporting every change but can at least reduce the events and logging.

Amazon had a lightning deal on the Minoston MP21ZP plug so I picked one up. After including it in my HE I found this driver and was thrilled. My HPM then linked the manually installed driver and updated to the latest. I think 1.0.4? Now I am getting alerts that the device is really active and causing a lot of events. While watching the current states, the Power and Power Low values were changing every second.

Can't include a video, so here is a link to a very short video of it.

Also, every time I save Preferences, I am getting an error for line 199

[dev:9](https://remoteaccess.aws.hubitat.com/logs#dev9)2021-10-31 01:15:28.537 pm [error](https://remoteaccess.aws.hubitat.com/device/edit/9)java.lang.NullPointerException: Cannot get property 'options' on null object on line 199 (method updated)
[dev:9](https://remoteaccess.aws.hubitat.com/logs#dev9)2021-10-31 01:15:23.398 pm [error](https://remoteaccess.aws.hubitat.com/device/edit/9)java.lang.NullPointerException: Cannot get property 'options' on null object on line 199 (method updated)

Is the Minoston Power Switch the correct driver for the MP21ZP mini power plug?
Is the error easily fixed?
Is there a way to not report the power changes so quickly? I really don't need to see the updates more frequently than every 5 minutes.

EDIT: Maybe the error on line 199 is related to the super fast updates?

Because I am busy with other affairs, I am sorry to reply you so long, I have updated this driver, you can download the latest driver.

1 Like

I think @beyondunreal79 will appreciate it! Thanks for your work, I totally understand how things can get busy (let alone towards the end of the year for most people).

Thanks for the driver, while it looks like working fine by default but I couldn't configure it as I'm getting error when save preference.

java.lang.NullPointerException: Cannot get property 'options' on null object on line 199 (method updated)

OK, I was not on the latest version, I thought I checked but top post linked to a specific old version instead of latest version. But I got a different error after updated to latest:

errorgroovy.lang.MissingMethodException: No signature of method: user_driver_sky_nie_Minoston_Power_Switch_779$_convertOptionSettingToInt_closure8.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[0:On When On [DEFAULT]]]
Possible solutions: any(), any(), each(groovy.lang.Closure), any(groovy.lang.Closure), each(groovy.lang.Closure), any(groovy.lang.Closure) on line 631 (method updated)

With the preferences failed to save, I'm getting massive amount of events and HE kept send me warning. After I switch to build-in driver (with less features), the event flood stopped but I miss the features provided by this driver.

I end up fixing the driver to make the device useful to me and pushed a PR: https://github.com/sky-nie/hubitat/pull/1 @susam0912 would you mind to take a look?

For anyone who is having the same problem, here is the driver code that works for me:
https://raw.githubusercontent.com/kennethxu/sky-nie-hubitat/main/minoston-power-switch.src/minoston-power-switch.groovy

Download the Hubitat app