stason325 / node-red-contrib-miio-localdevices

Nodes for controlling MIIO devices via node-mihome lib. List of devices and commands to be extended.
GNU General Public License v3.0
18 stars 7 forks source link

Is SmartMi Fan 3 Supported #4

Closed drschnalli closed 2 years ago

drschnalli commented 2 years ago

Hey Stanislav can you Tell me if the SmartMi Fan 3 is supported? I dont know if i can PM in Github.

stason325 commented 2 years ago

Hey Stanislav can you Tell me if the SmartMi Fan 3 is supported? I dont know if i can PM in Github.

Hello again. Fans 1, 2, 2s are definitely supported. As for Fan 3 (zhimi.fan.za5 if i'm not mistaken ... this one, yes? https://home.mi.com/webapp/content/baike/product/index.html?model=zhimi.fan.za5#/) I'm almost sure that it works the same way but it's needed to be tested.

Please, try the template for SmartMi Standing Fan 1,2 and 2s (zhimi.fan.za4). In case something goes wrong we'll write special template for your model.

stason325 commented 2 years ago

Hey Stanislav can you Tell me if the SmartMi Fan 3 is supported? I dont know if i can PM in Github.

Hey there. How was your testing? Did zhimi.fan.za4 template worked? Or we need to create new template specially for za5?

drschnalli commented 2 years ago

Hey Stanislav, i'm waiting for shipment! Yes i think its the model you wrote to me. I will let you know when its here and ready to test.

stason325 commented 2 years ago

Hey Stanislav, i'm waiting for shipment! Yes i think its the model you wrote to me. I will let you know when its here and ready to test.

Ok. I just made quick research and as result i will need to add separate template for your model, because za1 - za4 are miio devices, but za5 is miot. I will add it in new version 0.5.7 later this week.

Update: nodes are updated to version 0.5.7, separate support for your zhimi.fan.za5 was added - enjoy testing as soon as your new fan is shipped :)

drschnalli commented 2 years ago

Hey Stanislav, i just updated! I added the GetData Node and added the fan and deployed the flow.

In the debug Window i can see -> ""Error: Model zhimi.fan.za5 is not supported"" can i help you adding this device or is this just a strange error?

By the way, is it supported that i have my Fan and the Air Purifier in one flow?

stason325 commented 2 years ago

Hey Stanislav, i just updated! I added the GetData Node and added the fan and deployed the flow.

In the debug Window i can see -> ""Error: Model zhimi.fan.za5 is not supported"" can i help you adding this device or is this just a strange error?

By the way, is it supported that i have my Fan and the Air Purifier in one flow?

Hello, you need to copy/paste defFile for zhimi.fan.za5 according to the instructions in the readme manual, then don't forget to reboot NR after that. This error appears when plugin do not see the defFile in the target folder.

It is OK to have different devices in the flow. It is important that Mi_ids for them are different.

drschnalli commented 2 years ago

I cannot find the instructions (sorry for being dumb) i dont know where to put the file :(

stason325 commented 2 years ago

That’s ok.

Please read from here: https://github.com/stason325/node-red-contrib-miio-localdevices#send-node https://github.com/stason325/node-red-contrib-miio-localdevices#send-node

What you need is: Some devices are not basically included into Node-mihome library but supported through node-red-contrib-miio-localdevices (please see collumn "Import File" in DEVICES.md https://github.com/stason325/node-red-contrib-miio-localdevices/blob/master/DEVICES.md). If you have such a device you need to copy-paste additionally the definition-file for your device. Do it this way: find file you need in "defFiles" folder here: ~/.node-red/node_modules/node-red-contrib-miio-localdevices/defFiles copy definition-file you need and paste it to your node-mihome folder: ~/.node-red/node_modules/node-mihome/lib/devices or ~/.node-red/node_modules/node-red-contrib-miio-localdevices/node_modules/node-mihome/lib/devices (choose the one that exists) reboot Nodered. Regards, Stas

8 июня 2022 г., в 17:25, drschnalli @.***> написал(а):

I cannot find the instructions (sorry for being dumb)

— Reply to this email directly, view it on GitHub https://github.com/stason325/node-red-contrib-miio-localdevices/issues/4#issuecomment-1149990909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS3YKI2KHEZEQIETD642PHDVOCUNVANCNFSM5X5TKKIQ. You are receiving this because you commented.

drschnalli commented 2 years ago

Its working! I found the directory where i had to put the file in! Very happy =) the fan is also reporting its rotatings per minute thats awesome :D

stason325 commented 2 years ago

Its working! I found the directory where i had to put the file in! Very happy =) the fan is also reporting its rotatings per minute thats awesome :D

I'm that everything is working properly =).

drschnalli commented 2 years ago

Hey Stanislav, today it stopped working :( i also restarted node-red and tried cloud auth. But today i cannot control my Fan anymore :( it shoes "Mihome Exception. IP: 192.168.178.xx -> busy. I dont know if i can restart the fan (because it got a battery).

stason325 commented 2 years ago

Hey Stanislav, today it stopped working :( i also restarted node-red and tried cloud auth. But today i cannot control my Fan anymore :( it shoes "Mihome Exception. IP: 192.168.178.xx -> busy. I dont know if i can restart the fan (because it got a battery).

Hello. What could I say here... the device is busy. =) What does it mean: you sent the command, the device responded (so there is no connection issue at all and cloud auth doesn't change anything here), but it cannot execute the command because it is busy with executing something else. It could be possibly over pushed with another commands and it is now out if the memory to accept new requests.

How to cure that: 1) you definitely need to reboot your fan to clear the memory (please, see the manual of your fan - I'm sure there are some instructions there how to do it) 2) you need to restruct your flow in NR a bit to prevent this happens in future (if this has happened because of your NR flow). I would propose some hints like in example attached to my plugin: a) using filter node (https://flows.nodered.org/node/node-red-node-rbe) after your mqtt-in nodes and before green Send-nodes - that would exclude frequent sending of the same messages from mqtt-in to send-nodes b) storing the data to context - that would prevent looping your flow

schaze commented 2 years ago

Hi,

I have the same issue. More or less after 1 day (sometimes less) I received ¨busy" messages. Unfortunately rebooting the fan is not that easy as it has a battery attached. I had to unscrew the base and disconnect the standing bar to get it to power cycle. Afterwards I noticed that the fan responded very sluggishly, even when using the remote or the android app. This looked like it was flooded with messages. After a minute or so the fan reported busy again. So I actually restarted NodeRED. Afterwards the fan instantly responded again via all channels (remote, android app and via nodered). My flows are very basic (just an input from mqtt to miio-localdevices send node) and I am pretty sure there is no MQTT spamming going on, also I connected all nodes to debug nodes and could not see any unusual logs.

My suspicion is that miio-localdevices is getting a loop somewhere and starts flooding the fan which overloads it. I have now disabled polling for now, since this seems to be the only looping part in your code I can see.

Can I enable any debugging for the nodes to maybe check when it happens again?

Best regards, schaze

stason325 commented 2 years ago

My flows are very basic (just an input from mqtt to miio-localdevices send node) and I am pretty sure there is no MQTT spamming going on, also I connected all nodes to debug nodes and could not see any unusual logs.

Hello there.

I think that problem could be here. Mqtt nodes send its state on a periodic basis... every 15 or 30 seconds => every 15-30 seconds your flow execute command to the fan => you overpush your fan with requests => fan do not have enough time to execute them => and send back "busy" state.

What I propose: to prevent looping your flow, as I wrote in readme, use filter (rbe) node between Mqtt and miio-localdevices send node. Rbe-node will limit duplicate messages from mqtt and let go through only those with updated status.

As for my nodes there are no looping inside and auto-polling works pretty stable with interval from 5 secs.

Regards

drschnalli commented 2 years ago

I will give it a try, i added some filters to my flow!

Seems to work with filters! But what i found out that my fan does not report the right battery/ac state. Does not matter if i plug it into the socket or not. Ac state is still on false :( befor my device was hanging with busy (had to reset with holding the 2 buttons) it worked. :(

schaze commented 2 years ago

had to reset with holding the 2 buttons

If you do not want to go through the whole setup and token extraction everytime your can also just unscrew the standing plate and pull the fan out for a few seconds. This will cut power and shut it down. Afterwards put it together and it will work again. At least for me that is faster then downgrading the MiHome app all the time and copying out the token etc...