kovapatrik / homebridge-midea-platform

Homebridge plugin for Midea devices
https://www.npmjs.com/package/homebridge-midea-platform
Apache License 2.0
22 stars 2 forks source link

Add Contact Sensor for Full Bucket #75

Closed simplytoast1 closed 2 months ago

simplytoast1 commented 3 months ago

Is your feature request related to a problem? Please describe:

No. Just a quality of life improvement.

Describe the solution you'd like:

Enable a contact sensor if the bucket on a dehumidifier is full.

Describe alternatives you've considered:

None

Additional context:

None

dkerr64 commented 3 months ago

The plugin is already returning TANK_LEVEL information to Homebridge. The HomeKit spec supports WaterLevel but I am not aware of a separate tank full characteristic.

Midea does have a TANK_FULL attribute which I currently ignore... as I assumed that if this was set, then TANK_LEVEL would be 100%. If there are cases when TANK_FULL could be set, when level is less than 100% then the only way to report this to HomeKit would be to override what Midea is reporting as TANK_LEVEL and set the HomeKit water level to 100%.

simplytoast1 commented 3 months ago

Interesting.... I don't see water level in HK so I might be missing something. Because I can create an automation if rather level is 100% but I'm not seeing that exposed.

dkerr64 commented 3 months ago

On my Apple Home app... open the dehumidifier, select settings gear icon, and immediately under the name it reports "Water Level 0%" in my case it will always be zero because I have hosepipe directly to a drain. I do not know how you access that for an automation, but it is exposed to Apple Home app.

simplytoast1 commented 3 months ago

Weird... it doesn't not for me

image

dkerr64 commented 3 months ago

My (macOS version) screenshot below. What do you see if you click on the two accessories?

image

simplytoast1 commented 3 months ago

The temperature sensor and the dehumidifier - and in that sub accessory there is no water level.

simplytoast1 commented 3 months ago

Interestingly enough, on MacOS I see it. Let's chalk it up to an iOS issue. The only issue is I am unable to do an automation off of it.

dkerr64 commented 3 months ago

my iOS version looks just like the macOS one above with water level and fan speed. Is your iOS version 17.4 or older? These things can change with iOS version.

simplytoast1 commented 3 months ago

I had to reboot the iPhone to see the water level. So now it shows properly. Still unable to do an automation off water level but that may be a HK restriction hence the request to add a sensor if water level = 100% to close a contact sensor

kovapatrik commented 3 months ago

a leak detection sensor could be better for this - although it does the same as a contact sensor, I feel it's more in the context of the dehumidifier

dkerr64 commented 3 months ago

Ah, ok, so that is an idea... add a contact or leak sensor device. That might be doable.

simplytoast1 commented 3 months ago

I would warn about a leak sensor as it will set off alarms on a HomePod (and other devices) as a high priority. I would give an option. I just want to do an automation if the bucket is full. Some may want an alarm.

kovapatrik commented 3 months ago

ah I didn't know about that functionality

kovapatrik commented 3 months ago

midea dehumidifiers have a property called TANK_FULL, should I use this property, or use the water level and the user could set the level percentage when they want to trigger the sensor?

simplytoast1 commented 3 months ago

If you have TANK_FULL I would use that

dkerr64 commented 3 months ago

I have a feeling that TANK_LEVEL is probably not that accurate so if there is a TANK_FULL attribute reported that is probably best. Mine is connected to a drain so I never see any values, but would be worth testing and monitoring what is returned.

kovapatrik commented 3 months ago

this is now released with v1.0.2. Thanks to @simplytoast1 for the tests!

simplytoast1 commented 2 months ago

Seems the contact sensor still isn't closing despite the bin being full. Weird that it worked in my test environment but not production.


[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for POWER changed from 'undefined' to 'true'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for CHILD_LOCK changed from 'undefined' to 'false'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for MODE changed from '99' to '1'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for FAN_SPEED changed from '999' to '80'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for SWING changed from 'undefined' to 'false'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for TARGET_HUMIDITY changed from '999' to '40'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for TANK_LEVEL changed from '999' to '100'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for WATER_LEVEL_SET changed from '999' to '0'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for CURRENT_HUMIDITY changed from '999' to '68'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for CURRENT_TEMPERATURE changed from '999' to '22'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for FILTER_INDICATOR changed from 'false' to 'true'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for PUMP_SWITCH_FLAG changed from 'false' to 'true'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Value for TANK_FULL changed from 'undefined' to 'true'
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute POWER to: true
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute CHILD_LOCK to: false
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute MODE to: 1
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute FAN_SPEED to: 80
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute SWING to: false
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute TARGET_HUMIDITY to: 40
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute TANK_LEVEL to: 100
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute WATER_LEVEL_SET to: 0
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute CURRENT_HUMIDITY to: 68
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute CURRENT_TEMPERATURE to: 22
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute FILTER_INDICATOR to: true
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Attempt to set unsupported attribute FILTER_INDICATOR to true
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute PUMP_SWITCH_FLAG to: true
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Attempt to set unsupported attribute PUMP_SWITCH_FLAG to true
[4/17/2024, 8:46:45 AM] [homebridge-midea-platform] [Garage Dehumidifier] Set attribute TANK_FULL to: true```
kovapatrik commented 2 months ago

Hmm, so the problem is that the sensor isn't triggered when the tank is actually full? Can you please restart your child bridge or Homebridge itself and look for any suspicious logs like Error: Cannot add a Service with the same UUID?

simplytoast1 commented 2 months ago

There was on a prior version but this child bridge starts up error free. I can remove the Dehumidifier and re-add to make everything clean if you would like.

kovapatrik commented 2 months ago

Yes, please do that! Also, don't forget to remove the cached accessory.

simplytoast1 commented 2 months ago

After removing and clearing the coaches accessories the sensor is still not changing state although being reported in the logs of water level being full

kovapatrik commented 2 months ago

I've changed the logic for TANK_FULL in 1.0.4. Could you please test it? If it still not works, could you please turn on debug mode again, open the Home app and then send me the logs? When you open the Home app, all property will get logged so we can see what the accessory thinks the TANK_FULL value is.

kovapatrik commented 2 months ago

Should be solved in v1.0.5. Again, thanks for the tests @simplytoast1!