homebridge-smartthings icon indicating copy to clipboard operation
homebridge-smartthings copied to clipboard

[Feature Request] Basic "sensor-like" support for home appliances

Open dikodahan opened this issue 5 years ago • 7 comments

As you clearly stated, this updated plugin does not support home appliances as Homekit does not natively supports that. Cannot complaiun about that :)

As a feature request, I would ask to get a basic sensor like behavior for just ON/OFF of the home appliance. This, in turn, can at least provide a basic capability of knowing when an appliance is done, like the washer and/or dryer have completed their cycle.

From the Homebridge logs I added below your plugin clearly receives the events from the appliances so I assume a receiving Virtual Homekit ON/OFF Sensor could be tied to these events. If you need more event info I am happy to provide them and obviously test a potential implementation.

Example events from Homebridge log for starting the dryer:

[2/28/2020, 10:53:04 am] [SmartThings-v2] INFO: [Device Event]: (Dryer) [DRYERJOBSTATE] is drying
[2/28/2020, 10:53:04 am] [SmartThings-v2] INFO: [Device Event]: (Dryer) [TIMESTRING] is 00:48:00 Remaining
[2/28/2020, 10:53:04 am] [SmartThings-v2] INFO: [Device Event]: (Dryer) [COMPLETIONTIME] is 2020-02-28T16:41:03.947Z
[2/28/2020, 10:53:04 am] [SmartThings-v2] INFO: [Device Event]: (Dryer) [MACHINESTATE] is run

In the logs I can clearly see that it polls the appliance every minute (sample of polling events):

[2/28/2020, 12:17:02 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [COMPLETIONTIME] is 2020-02-28T17:36:02.206Z
[2/28/2020, 12:17:02 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [TIMESTRING] is 00:19:00 Remaining`

These are the completion events of the job:

[2/28/2020, 1:21:49 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [COMPLETIONTIME] is 2020-02-28T18:21:49.311Z
[2/28/2020, 1:21:49 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [DRYERJOBSTATE] is finished
[2/28/2020, 1:22:19 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [DRYERJOBSTATE] is none
[2/28/2020, 1:22:20 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [COMPLETIONTIME] is 2020-02-28T19:37:19.918Z
[2/28/2020, 1:22:20 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [TIMESTRING] is 01:15:00 Remaining
[2/28/2020, 1:22:20 pm] [SmartThings-v2] INFO: [Device Event]: (Dryer) [MACHINESTATE] is stop

Perhaps using the [MACHINESTATE] run/stop events is a simple and generic enough mechanism for an ON/OFF state?

This would be an awesome addition to an already awesome plugin! Appreciate the consideration!!!

dikodahan avatar Feb 28 '20 16:02 dikodahan

This came up before, I asked for similar, just a switch to show if the washing machine was on or off. The problem is the different appliances have MANY capabilities (they don’t even share a common one for state!) so it’s not easy to map/condense them down to just on and off in a generic way.

The best option that should be generic enough to all Samsung washer/dryers would be to link the HomeKit switch to the remote control state (on the basis that at the end of a cycle it always disabled remote control automatically and most users enable it when starting a cycle so they can monitor progress).

Feb 28 16:24:17 jose-stick homebridge[28372]: [2/28/2020, 4:24:17 PM] [SmartThings] Change Event: (Washing machine) [REMOTECONTROLENABLED] is true Feb 28 16:24:30 jose-stick homebridge[28372]: [2/28/2020, 4:24:30 PM] [SmartThings] Change Event: (Washing machine) [REMOTECONTROLENABLED] is false

Much as I really want this, I would fully understand @tonesto7 reluctance to support it.

jdebardi avatar Feb 28 '20 16:02 jdebardi

I say that, machineState might be the same across all Samsung devices My washer has it as does your dryer and shows either “run” or “stop”

jdebardi avatar Feb 28 '20 16:02 jdebardi

The other way around it (which is what I have done), is to create a virtual switch, then a SmartThings (New app) automation turn it on/off based on the washer/dryer state. The virtual switch can then be displayed in Homebridge.

jdebardi avatar Feb 28 '20 16:02 jdebardi

The other way around it (which is what I have done), is to create a virtual switch, then a SmartThings (New app) automation turn it on/off based on the washer/dryer state. The virtual switch can then be displayed in Homebridge.

Can you please share a reference to the configuration?

dikodahan avatar Feb 28 '20 18:02 dikodahan

I have an idea on how to add support for these but take the effort off me to support. I’m thinking about building a Config file structure that allows you guys to define custom capabilities and attributes for switches and maybe contact sensors to start.

I just need some time to think it through then implement

tonesto7 avatar Feb 29 '20 17:02 tonesto7

Hey @tonesto7 Any potential updates on this capability as a switch?

dikodahan avatar Oct 10 '20 15:10 dikodahan

This would be a really nice feature...

So far I have issued homebridge-cmdswitch2 to call a script (the state script), that use a personal token to access the smartthing api, and get the machine state for my washer... it works like a charm... but would be nice to have it as plugin...

ttopholm avatar Feb 01 '21 10:02 ttopholm