Skip to content
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

Recover Domoticz angle of rotation of the Cube from Xiaomi. #329

Closed
nicog2 opened this issue Jan 27, 2019 · 27 comments
Closed

Recover Domoticz angle of rotation of the Cube from Xiaomi. #329

nicog2 opened this issue Jan 27, 2019 · 27 comments
Labels
enhancement Improvement

Comments

@nicog2
Copy link

nicog2 commented Jan 27, 2019

Hello,

Would it be possible to remake under domoticz the value of the angle made. With for example a positive angle if the rotation is clockwise, and negative if anti-clockwise. This value can go up in a second device (ID). In order to control, for example, the volume, a variable lamp ...

thanks in advance

@pipiche38 pipiche38 added the enhancement Improvement label Jan 27, 2019
@pipiche38
Copy link
Collaborator

Today's widget provides Clock wise and Anti-Clock wise information as well as Flip 90 or 180 and some other possible actions from the Cube.

Creating a Second widget when pairing a Cube is of course possible.
This second widget would be a Text widget ( not a switch ) and will be available on the Utility section (not in the switch section ).

In order to make it more useful, we could eventually push all Cube events to this Text widget and of course when receiving angle pushing the clock+anti-clock angle ( with + or - )

Now, the main question is can an update to a Text Widget trigger LUA/dzEvent ?

@nicog2
Copy link
Author

nicog2 commented Jan 27, 2019

when i connect the cube to the xiaomi gateway, i have to widget on domoticz, one in switch with the action (rotation, shake,...) and another Text widdget in Utility section with the angle of rotation.
With this case, when an event from cube in switch, you can read the angle if necessary.
cubeutility
cubeswitch

@pipiche38
Copy link
Collaborator

If you switch to beta ( 959df90 ), you should be able to see in the Logs the XCube rotation angle. Could you kindly check ?

@ben33880
Copy link
Contributor

yes i see rotation :

2019-01-29 19:30:58.171 (Zigate) ReadCluster - ClusterId=000c - Magic Cube angle: -51.40000534057617
2019-01-29 19:30:58.171 (Zigate) Update v2 Values 90:'90:' (Xiaomi Cube Lumiere)
2019-01-29 19:30:58.975 (Zigate) ReadCluster - ClusterId=000c - Magic Cube angle: -9.149998664855957
2019-01-29 19:31:02.633 (Zigate) Update v2 Values 40:'40:' (Xiaomi Cube Lumiere)

@pipiche38
Copy link
Collaborator

pipiche38 commented Jan 30, 2019 via email

@ben33880
Copy link
Contributor

ben33880 commented Jan 30, 2019

cant say if it match correctly but positive and negative is ok !!!
it seems correct for angle.

@ben33880
Copy link
Contributor

I do not know if it's related to the changes made for the rotation but the flip_90 only works once. you have to make another move for the flip_90 to work again

@pipiche38
Copy link
Collaborator

pipiche38 commented Feb 1, 2019

That is correct. The Cube is not sending a new message after a flip, and I beleive this is true for all. If you do clock rotation, and then you do it once more ... the 2nd one is not seen.

From the LOg I do not see any message from the device itself. It seems the behaviour of the Xcube.

@ben33880
Copy link
Contributor

ben33880 commented Feb 2, 2019

with xiaomi gateway, you can flip many times.

@pipiche38
Copy link
Collaborator

could you reach me on keybase.io ?

@Smanar
Copy link
Contributor

Smanar commented Feb 2, 2019

Nope, it's not true for all, on my installation it's same.
For exemple, if I use the cube to set a speaker volume, I make a clockwise rotation, if the sound is not hight enought, I make a second clockwise rotation more faster. No need to make a "blank" move to enable the rotation again.
So I can confirm too, it's possible.

@pipiche38
Copy link
Collaborator

pipiche38 commented Feb 2, 2019 via email

@pipiche38
Copy link
Collaborator

@ben33880 please use latest beta version from that morning .

@ben33880
Copy link
Contributor

ben33880 commented Feb 3, 2019

we can now flip many times !!!!

@pipiche38
Copy link
Collaborator

Will work on the text widget to get the rotation angle .

@Smanar
Copy link
Contributor

Smanar commented Feb 3, 2019

Lol, Hello.
I m still here, I m still following this project.
I think there is a mistake on my side with rotation and flip. But on all case flip or rotation, you need to trigger notification, and perhaps use the same ResetDevice() fonction than the motion sensor (with smaller temporisation).

@pipiche38
Copy link
Collaborator

pipiche38 commented Feb 3, 2019 via email

@Smanar
Copy link
Contributor

Smanar commented Feb 3, 2019

Yep, I have just see the corrective > ForceUpdate_ = True

@pipiche38
Copy link
Collaborator

@ben33880 If you can do an update of beta branch. Delete the existing Domoticz widget related to Xcube and repair it you should then see 2 widgets created for the device. The classic one and a text widget (can be found in Utility/Mesures)

For now, Rotation angle are reported to the Text widget .

@ben33880
Copy link
Contributor

ben33880 commented Feb 3, 2019

text widget is ok.
nice

@pipiche38
Copy link
Collaborator

What do you have in the log

@pipiche38
Copy link
Collaborator

@nicog2 could you confirm that it works as expected ? Please use latest beta branch

@pipiche38
Copy link
Collaborator

pipiche38 commented Feb 4, 2019 via email

@ben33880
Copy link
Contributor

ben33880 commented Feb 4, 2019

2019-02-04 19:44:02.510 (zig) Update v2 Values 20:'20:' (Cube Lumières)
2019-02-04 19:45:24.319 (zig) Update v2 Values 0:'-65:' (Cube Lumières Angle)
2019-02-04 19:45:24.321 (zig) Update v2 Values 90:'90:' (Cube Lumières)

'Cube Lumières Angle' is the text widget

@pipiche38
Copy link
Collaborator

Can we close the issue ?

@ben33880
Copy link
Contributor

ben33880 commented Feb 5, 2019

it works for me !!!

@nicog2
Copy link
Author

nicog2 commented Feb 5, 2019

I have not the time for testing. But if it works for ben33880, i think it work for me.

@nicog2 nicog2 closed this as completed Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement
Projects
None yet
Development

No branches or pull requests

4 participants