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
17 stars 7 forks source link

empty payload #19

Closed TheNON75 closed 1 year ago

TheNON75 commented 1 year ago

Hello,

i have a zhimi.humidifier.ca4

the payload is empty. Please, inform me what additional information is needed.

(I saw there was an issue in this regards but the whole conversation is in cyrillic letters which i do not understand)

thanks

stason325 commented 1 year ago

Hello. The overall result of that conversation was that starting from 0.5.11 defFile for that device was updated (based on MIOT protocol) and tested.

Make sure that you have copy-pasted defFile to target folder according to readme. This solves 99% of the problems according to my experience.

As for cloud auth - it turned out that it doesn't give any profit in connection to the device. I'm planning to delete that option.

Regards

TheNON75 commented 1 year ago

Thanks for the reply. I am on the latest version 0.5.12 Does the def file copy make sense?

stason325 commented 1 year ago

yes it does, because my nodes are just a sort of wrapper for node-mihome lib. The main engine is inside the lib, that's why you need to copy defFile to the target lib's folder to make node-mihome work with it.

As for version it's critical that it is >= 0.5.11

TheNON75 commented 1 year ago

Ok, clear

Get node payload is still empty. Send command has no effect if custom json. If preselected e.g. power and a Boolean false is injected, it throws an exception error.

The device is on the same vlan as nodered, the device is registered to mihome app Token is obtained from the mi cloud.

stason325 commented 1 year ago

No response from get-node at all? Try to turn on polling for say 30 seconds and click something in mihome app. Get-node should return actual JSON with props after this or after sending command through send-node

Custom JSON: be careful with spelling here (see devises.md table). It should be something like { Power: true, Buzzer: false}

TheNON75 commented 1 year ago

Thanks, I will try it a little later. For custom json I used in the inject as payload

It went through the send node without issue but had no effect.

TheNON75 commented 1 year ago

Tested:

stason325 commented 1 year ago

Tested:

  • get node returns no payload when the device is operated.
  • Polling is enabled and set to 30 seconds, but no messages are generated

I still think something wrong with defFile. We started from this very point when tested ca4 previous time. Empty payload = lib doesn't see any properties = doesn't see correct defFile with properties

stason325 commented 1 year ago

Thanks, I will try it a little later. For custom json I used in the inject as payload

  • type object
  • {"Power":false}

It went through the send node without issue but had no effect.

Try it without the quotes

TheNON75 commented 1 year ago

as the inject type is object, "Power" as property has to be with quotes, false is a boolean, it must be without quotes... but tried, the inject node was highlighted with a red tiangle as error.

There is no remark in the def files re to which version it is, but anyhow, the def file is 200k. Without the def file (downloaded yesterday), the send node only had "custom object". With the file, the possible commands are listed, so unless there is something else to download in addition, I have download what was suggested (only the ca4.js)

Shall i run some debugging? if yes, what do you need?

stason325 commented 1 year ago

as the inject type is object, "Power" as property has to be with quotes, false is a boolean, it must be without quotes... but tried, the inject node was highlighted with a red tiangle as error.

Yes, You are right about key in object, but it seems that value should be in quotes too. Look, how it worked for me image

stason325 commented 1 year ago

There is no remark in the def files re to which version it is, but anyhow, the def file is 200k. Without the def file (downloaded yesterday), the send node only had "custom object". With the file, the possible commands are listed, so unless there is something else to download in addition, I have download what was suggested (only the ca4.js)

Let me continue with stupid questions a bit so we can move to next step😊 You are 100% that in target (node-mihome lib) folder: ~/.node-red/node_modules/node-mihome/lib/devices this file? https://github.com/stason325/node-red-contrib-miio-localdevices/blob/master/defFiles/zhimi.humidifier.ca4.js with all this code inside

stason325 commented 1 year ago

Latest tests of ca4 with a friend of mine gave this result image

TheNON75 commented 1 year ago

okay, i decided to do it from scratch and strictly followed these steps from the guide

So until now it seems to be cool and fine, but send node has only custom json (yesterday I have downloaded the ca4 file from github and then the specific commands were listed, but the things did not work)

I can live with custom json as I prefer that anyway, unless you recommend to perform further steps

(there are no stupid questions on the way to a resolution, thanks very much for pointing out the possible root cause)

stason325 commented 1 year ago

Hello, You've closed the issue .. do the separate commands work fine for you? Or do we need to make any further tests?

Regards

TheNON75 commented 1 year ago

Hello, No, the separate commands do not appear, only the custom object.

In the first attempt, which didn't work:

The second attempt was from scratch:

We can do some more tests if you'd like, but as said, I am happy.

One small note, the water level is inaccurate it should be divided by 1.2 as max water level is 120 and not 100, but I can handle it in my flow.

Furthermore, I am missing the "target speed" and "clean mode". For instance this exists in other miio solutions