New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sensor_cube.aqgl01 #190
Comments
Same trouble here with the Cube. The Mi Home app shows mine as sensor_cube.aqgl01, and it doesn't appear through Homebridge. Interesting thing, though, is that my MagicSquareParser.js doesn't even have the list you added this name to. |
Yesterday, I updated to 0.6.9 and the Cube didn't appear. Today, it's suddenly there. |
@Wormaap the interval of the find the new device is 30 minutes, or restart homebridge. |
Ahh, that makes sense. The switches that showed up in the Home app still aren't doing much, though, but that's probably just me not having them figured out yet. Thank you! :) |
Same problem here. Everything works fine on MI home app. After updating to 0.6.9 cube finally appears to Homekit but actions triggered (shake, flip, etc) are not delivered to Homekit. Any ideas? |
Same problem here: the buttons / virtual switches are correctly discovered but not showing any reaction at all. (see also #214) |
My cube appears to be discovered, in that logging shows:
... and I now see 6 StatelessProgrammable switches in Homekit (although I didn't initially) for Flip90, Flip180, Move, TapTwice, ShakeAir and Rotate. However, assigning actions to these switches does nothing. Should this version of the cube work? Interestingly I also see Switches for Flip90, Flip180, Move, TapTwice and ShakeAir - and if I try changing the state of one of these in Homekit an error is logged - for example:
|
Today I updated my gateway firmware to 1.4.1_157.0143 using the Mi Home App (on mainland china server) and now the cube is working fine. My plugin version is 0.6.9 and the buttons/switches are discovered in Homekit, assining actions also works. So you have to update your Gateway and the issue should be solved. Also restart your homebridge to refresh the accessories. So I guess it was a faulty gateway firmware. |
Yes, some functionality was restored by the firmware update! Rotate, however, as well as all stateful switches still appear to be broken. |
I have installed version 0.7.1. In the release notes (of 0.7.0) is stated that the MagicSquare Rotate StatelessProgrammableSwitch should be working now. I have tested this, however the tile in the Home app does not show any movement when rotating the cube. Neither the action is performed. So in my opinion the rotate function is still not working. What about you guys? In a previous release the rotate tile in the Home app was also moving when performing other actions. Ffor example: flip90, then the flip90 tile was moving but also the rotate tile. |
got same problem with rotate, too, not fixed after 0.7.1 But can't hide the switches, even I stated it in the config. { |
I have a fix for rotate, the parser is faulty. I read the debug log and found this line: class MagicSquareStatelessProgrammableSwitchRotateParser extends MagicSquareStatelessProgrammableSwitchBaseParser {
getProgrammableSwitchEventCharacteristicValue(jsonObj, defaultValue) {
var value = null;
var proto_version_prefix = this.platform.getProtoVersionPrefixByProtoVersion(this.platform.getDeviceProtoVersionBySid(jsonObj['sid']));
if(1 == proto_version_prefix) {
value = this.getValueFrJsonObjData1(jsonObj, 'rotate');
} else if(2 == proto_version_prefix) {
value = this.getValueFrJsonObjData2(jsonObj, 'cube_status');
} else {
}
if(parseFloat(value) > parseFloat(0)) {
return this.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS;
} else if (value === 'rotate'){
return this.Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS;
} else {
return defaultValue;
}
}
} My idea: Create a new accessory parser that recognizes the rotation direction. So maybe this way: 'MagicSquare_StatelessProgrammableSwitch_Rotate_Clockwise': MagicSquareStatelessProgrammableSwitchRotateClockwiseParser,
'MagicSquare_StatelessProgrammableSwitch_Rotate_Counterclockwise': MagicSquareStatelessProgrammableSwitchRotateCounterclockwiseParser The new code above recognizes clockwise only. All other switches are working properly. I haven't checked yet if hiding the switches is possible. Edit: Working version of MagicSquareParser.js attached |
To disable them you have to the delete the "_d768". See below. This should work. |
For me this is too technical (however I do understand what you explain). Hopefully one of the developers of this plugin can fix this. @YinHangCode ? |
Thank you so much! This solved my problem! |
The rotate function is still not working. The other five movements are. |
I just installed the cube. And i see the switches in homekit. But when i select one i get:
|
Try: It is very important to update your gateway firmware to the newest version using the Mi Home app. My gateway version is: 1.4.1_159.0143 on Mainland China server. |
I realised that MiAqaraPlatform was finding my cube but not recognising it as the magic cube:
Turns out that my cube is the model "sensor_cube.aqgl01" so I added it to "parser/MagicSquareParser.js" in the following line:
MagicSquareParser.modelName = ['cube', 'sensor_cube', 'sensor_cube.aqgl01'];
Now it finds it, recognises it and configures it, great! :-),
The problem now is that I don't receive any event message from the gateway, when I move the cube it appears in the log of the YiHome App but I receive nothing, what can I do? Can you help me @YinHangCode ?
Thanks!
The text was updated successfully, but these errors were encountered: