kovapatrik / homebridge-midea-platform

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

Add support for water heater midea comfee D80-15ED3 #60

Closed BonRm closed 7 months ago

BonRm commented 10 months ago

Hello, Could be possible in the future to add support for water heater?

I currently have midea comfee D80-15ED3 and I would really like to be able to control it over homebridge.

I’m available if I could help in any way to add the support for this device category. thank you

kovapatrik commented 9 months ago

It is possible to add, and I will try to do this in the next weeks, but it will be kind of hard to do so as I don't have such a device. Do you know how to add a plugin to Homebridge using the command line? It will needed for the development. But if not, I can help you with that.

tgai commented 8 months ago

I also have a Midea water heater, model JSQ30-CE516, do you need me to do anything

It is possible to add, and I will try to do this in the next weeks, but it will be kind of hard to do so as I don't have such a device. Do you know how to add a plugin to Homebridge using the command line? It will needed for the development. But if not, I can help you with that.

I also have a Midea water heater, model JSQ30-CE516, do you need me to do anything

kovapatrik commented 8 months ago

I need to write the code for it to somewhat work in the first place, didn't have time to do this sadly. I will try to do this next week, and will ping you both for some testing.

BonRm commented 8 months ago

It is possible to add, and I will try to do this in the next weeks, but it will be kind of hard to do so as I don't have such a device. Do you know how to add a plugin to Homebridge using the command line? It will needed for the development. But if not, I can help you with that.

I missed your reply, just seen… Yes, I added in the past (years ago) some plugin using the terminal, so I can do it again for sure even if right now I don’t remember how 😅

Now I’m using hoobs but I guess I can install the same from the terminal.

anyway the function available for the heater are quite limited on the app with just basic function like on/off; choosing between the 5 working operating mode; choosing the temp; set the appointment with a maximum of 5 schedule. If you need screenshot of the features available in the app let me know.

kovapatrik commented 8 months ago

Screenshots would definitely help. What are the 5 modes?

I can tell you right now that the scheduling feature won't be available in Homebridge as a feature, but you can always create an automation for it.

BonRm commented 8 months ago

@kovapatrik Yes, will be good with the automation if could be possible to read the actual temp of the heater in order to define automation to turn on and off at a specific time and temperature.

Here are some screenshot.

when there is a schedule turned on the water heater is showing the stand-by mode so even if the heating temp is set at 62ºC like in the screenshot is not warming the water.

IMG_5702 IMG_5703 IMG_5704 IMG_5705 IMG_5706 IMG_5707 IMG_5708 IMG_5709

kovapatrik commented 8 months ago

If you do a discovery with my plugin, what do you get back?

kovapatrik commented 8 months ago

I don't want to rush you, but I can't start to make the implementation for the water heater without the info the device discovery prints out.

BonRm commented 8 months ago

Hi, thanks for writing again or I would've forget to reply... I just installed the plugin and this is what I get:

Schermata 2024-02-11 alle 20 33 19 Schermata 2024-02-11 alle 20 33 53
kovapatrik commented 8 months ago

Thank you!

kovapatrik commented 8 months ago

In the application, what is the minimum and maximum temperature you can set? And if I see correctly, you are only able to set whole temperatures, so no decimals, correct?

kovapatrik commented 8 months ago

Ah, you already answered the first question, I've just noticed:D the temperature step one remains then

BonRm commented 8 months ago

Yes, no decimals.

BonRm commented 8 months ago

I’ve also updated hoobs to 4.3.1 and homebridge updated to 1.7.0 so is not showing that error anymore

kovapatrik commented 8 months ago

Okay, I've created a branch called feat/e2-support. Can you install this branch of the plugin into your Homebridge instance? I can help you with this if you need it.

kovapatrik commented 8 months ago

Also, I'm a bit unsure about a lot of features so there will be a bunch of logs (like Attempt to set unsupported attribute..., we can talk about them later if you need one of those attributes).

There are 2 configurable switches which I added: variable heating, and whole tank heating. These must be 2 of the modes which you sent to me in the screenshot, it just not 100% clear which one which (the whole tank heating is probably the double tank heating, but I have no idea what variable heating means).

BonRm commented 8 months ago

Hi, Tonight I will install your the branch of the plug-in and let you know.

Thanks

kovapatrik commented 8 months ago

Let me know if you need any help!

BonRm commented 8 months ago

Do you think I will find on hoobs or I should install manually from terminal?

kovapatrik commented 8 months ago

As I didn't publish that branch as a package I don't think it's possible to install it from hoobs. You have to git clone the repo, switch to the branch with git switch feat/e2-support , built it with npm run build and type the command sudo npm link . which will link it to your active Homebridge instance.

kovapatrik commented 8 months ago

@BonRm did you had any chance to try it?

tgai commented 8 months ago

image There is an error message

@kovapatrik

tgai commented 8 months ago

image There is an error message

@kovapatrik

image

kovapatrik commented 8 months ago

Well, it looks like you've added a device to the config JSON manually. When a device's version is 3, the key and token fields must be filled. If you use the discovery method in the GUI, it should automatically add these values.

tgai commented 8 months ago

water heater

Sorry, I don't quite understand what you mean. Can you tell me specifically how to do it

@kovapatrik

kovapatrik commented 8 months ago

You should add you device to the plugin using the discovery function. I've checked on your screenshot again and just seen that you indeed used the discovery function. I've pushed a fix now, which should solve one problem in the future. Could you please pull it, rebuild the plugin and try again?

If you get an error, please also send the logs from the plugin, without those I can't really help you. These should be appear if you run your Homebridge instance in debug mode.

kovapatrik commented 8 months ago

Also just noticed you have a device model E3 (Gas Water Heater) and I wrote support for the model E2 (Electric Water Heater), so you won't be able to use this plugin right now. I will try to add support for E3 in the next days (or maybe today).

kovapatrik commented 8 months ago

And the final note: you've used Meiju as the application. I didn't have any chance to test if the implementation for Meiju is correct. Maybe that's the reason the key and token fields are empty in your case. If you can send me the logs, I could probably debug it.

tgai commented 8 months ago

And the final note: you've used Meiju as the application. I didn't have any change to test if the implementation for Meiju is correct. Maybe that's the reason the key and token fields are empty in your case. If you can send me the logs, I could probably debug it.

As you said, Meiju does not support it,and how do I send logs to you image

kovapatrik commented 8 months ago

If you could just copy and paste it here, I will thank you. In case of a discovery, search for the message Start device discovery..., this is the start of the discovery process, and Device discovery complete. is the end of it. If you paste it here please insert it as a code block by clicking this button:

image
tgai commented 8 months ago

``

If you could just copy and paste it here, I will thank you. In case of a discovery, search for the message Start device discovery..., this is the start of the discovery process, and Device discovery complete. is the end of it. If you paste it here please insert it as a code block by clicking this button: image

[2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Start device discovery... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 192.168.31.94, try 1... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 172.30.3.255, try 1... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 10.0.5.255, try 1... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 10.0.3.255, try 1... Sending discovery message to 10.0.7.255, try 1... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 192.168.31.255, try 1... Sending discovery message to 172.30.11.255, try 1... [2/20/2024, 9:28:31 PM] [Homebridge UI] [homebridge-midea-platform] Discovered device: {"ip":"192.168.31.94","port":6444,"id":211106236454436,"model":"51100018","sn":"0000E35115110001831021800692C0WD","name":"midea_e3_0692","type":227,"version":3} [2/20/2024, 9:28:33 PM] [Homebridge UI] [homebridge-midea-platform] Device discovery complete. [2/20/2024, 9:28:33 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 172.30.3.255, try 2... Sending discovery message to 10.0.5.255, try 2... [2/20/2024, 9:28:33 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 10.0.3.255, try 2... Sending discovery message to 10.0.7.255, try 2... Sending discovery message to 192.168.31.255, try 2... Sending discovery message to 172.30.11.255, try 2... [2/20/2024, 9:28:35 PM] [Homebridge UI] [homebridge-midea-platform] Device discovery complete. [2/20/2024, 9:28:35 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 172.30.3.255, try 3... Sending discovery message to 10.0.5.255, try 3... Sending discovery message to 10.0.3.255, try 3... [2/20/2024, 9:28:35 PM] [Homebridge UI] [homebridge-midea-platform] Sending discovery message to 10.0.7.255, try 3... Sending discovery message to 192.168.31.255, try 3... Sending discovery message to 172.30.11.255, try 3... [2/20/2024, 9:28:37 PM] [Homebridge UI] [homebridge-midea-platform] Device discovery complete. Sending discovery message to 172.30.3.255, try 4... Sending discovery message to 10.0.5.255, try 4... Sending discovery message to 10.0.3.255, try 4... Sending discovery message to 10.0.7.255, try 4... Sending discovery message to 192.168.31.255, try 4... Sending discovery message to 172.30.11.255, try 4... [2/20/2024, 9:28:39 PM] [Homebridge UI] [homebridge-midea-platform] Device discovery complete after 4 network broadcasts. Device discovery complete. [midea_e3_0692] Retrieve credentials. [2/20/2024, 9:28:39 PM] [Homebridge UI] [homebridge-midea-platform] [midea_e3_0692] Getting token and key with big-endian is not successful. Error: Error while sending request to https://mp-prod.smartmidea.net/mas/v5/app/proxy?alias=/v1/iot/secure/getToken: Error: Error while sending request to https://mp-prod.smartmidea.net/mas/v5/app/proxy?alias=/v1/iot/secure/getToken: {"msg":"调用业务系统异常(访问地址不存在) [no Route matched with those values]","code":40404} [2/20/2024, 9:28:39 PM] [Homebridge UI] [homebridge-midea-platform] [midea_e3_0692] Getting token and key with little-endian is not successful. Error: Error while sending request to https://mp-prod.smartmidea.net/mas/v5/app/proxy?alias=/v1/iot/secure/getToken: Error: Error while sending request to https://mp-prod.smartmidea.net/mas/v5/app/proxy?alias=/v1/iot/secure/getToken: {"msg":"调用业务系统异常(访问地址不存在) [no Route matched with those values]","code":40404} [2/20/2024, 9:28:39 PM] [Homebridge UI] [homebridge-midea-platform] [midea_e3_0692] Token: undefined, Key: undefined [2/20/2024, 9:28:39 PM] [Homebridge UI] [homebridge-midea-platform] All devices: [ { "ip": "192.168.31.94", "port": 6444, "id": 211106236454436, "model": "51100018", "sn": "0000E35115110001831021800692C0WD", "name": "midea_e3_0692", "type": 227, "version": 3, "displayName": "Unknown" } ]

kovapatrik commented 8 months ago

Yeah, like this. Thank you! If you could also preserve the new lines, it would be much easier for me, but it's fine like this. Maybe it's easier to just paste it into https://pastebin.com/ and share the link with me.

tgai commented 8 months ago

Yeah, like this. Thank you! If you could also preserve the new lines, it would be much easier for me, but it's fine like this. Maybe it's easier to just paste it into https://pastebin.com/ and share the link with me.

When I sent it, I broke the line, but I lost it after sending it, let me take a screenshot for you to take a look at

image

tgai commented 8 months ago

And the final note: you've used Meiju as the application. I didn't have any chance to test if the implementation for Meiju is correct. Maybe that's the reason the key and token fields are empty in your case. If you can send me the logs, I could probably debug it.

May I ask which app you have tested using? I will try using other apps

kovapatrik commented 8 months ago

Midea SmartHome (MSmartHome) and NetHome Plus are proved to work by other users. You could try those too, but it would be nice if Meiju works as well, so if you don't mind I would test this with you.

dkerr64 commented 8 months ago

Just a comment that logs can be downloaded to file, and then you can delete the unwanted lines before attaching here. image Download button is at top right of the Logs page.

tgai commented 8 months ago

Midea SmartHome (MSmartHome) and NetHome Plus are proved to work by other users. You could try those too, but it would be nice if Meiju works as well, so if you don't mind I would test this with you.

image I downloaded the app Midea SmartHome and set the password, but I found that although there was no error, there was still no key or token

kovapatrik commented 8 months ago

So your Midea device(s) must be registered in the app which you select in the discovery method. Also note that a device can be only registered in a single application (so in this case you should delete it from Meiju and add it to Midea SmartHome).

tgai commented 8 months ago

So your Midea device(s) must be registered in the app which you select in the discovery method. Also note that a device can be only registered in a single application (so in this case you should delete it from Meiju and add it to Midea SmartHome).

This is a really difficult app. I couldn't find a place to add apps in Midea SmartHome. I will assist you in adapting the Meiju app

kovapatrik commented 8 months ago

Could you please also send images from Meiju, how the water heater looks like there? Like what's the minimum and maximum temperature you can set, what feature does it have, etc... Or is it the same as @BonRm sent us above?

tgai commented 8 months ago

IMG_9381 IMG_9381 IMG_9381 IMG_9381 Can you understand Chinese? If not, I will switch to an English interface

kovapatrik commented 8 months ago

I can't, please switch it to english.

tgai commented 8 months ago

I can't, please switch it to english.

You may need to wait for a while, the app cannot directly translate to English, I need to manually translate it

kovapatrik commented 8 months ago

If the features are easily understandable you don't need to translate. Like if there are icons and number (for temperature), it's more than enough. Just a notice, previously you sent 4 images but all 4 are the same.

tgai commented 8 months ago

I sent the wrong picture, but it seems that besides temperature, everything else is not so easy to understand. I think translation is still necessary

tgai commented 8 months ago

IMG_9378 IMG_9379 IMG_9381 IMG_9380 I sent the wrong picture, but it seems that besides temperature, everything else is not so easy to understand. I think translation is still necessary

If the features are easily understandable you don't need to translate. Like if there are icons and number (for temperature), it's more than enough. Just a notice, previously you sent 4 images but all 4 are the same.

kovapatrik commented 8 months ago

I've used Google Translate's camera feature to translate, I think I've got everything for now, so don't worry about the translation.

tgai commented 8 months ago

I've used Google Translate's camera feature to translate, I think I've got everything for now, so don't worry about the translation.

ok

kovapatrik commented 8 months ago

I've pushed the support for E3, so in theory it should work if someone use it with SmartHome or NetHomePlus (for now only basic feature like turning it on/off and setting the temperature).

I don't have more time to develop for now though, and for Meiju support I think I will have to rewrite the whole cloud thing, so it will take some time. Hopefully I can make it tomorrow, or maybe tonight.

tgai commented 8 months ago

I've pushed the support for E3, so in theory it should work if someone use it with SmartHome or NetHomePlus (for now only basic feature like turning it on/off and setting the temperature).

I don't have more time to develop for now though, and for Meiju support I think I will have to rewrite the whole cloud thing, so it will take some time. Hopefully I can make it tomorrow, or maybe tonight.

Thank you very much, but I will have to wait for you to fix the compatibility issue with the Meiju app before testing. The Midea SmartHome app cannot be used in China