Okay, so, you know the angle, but does it only give you an absolute angle or does it give you a delta value (how much the angle has changed)? You can definitely do this in rule machine using variable math but it's going to be different depending on whether we have to determine the delta value ourselves. I'll assume that the angle is just an absolute number and we won't know what the delta is.

First thing you are going to want to do in your rule is set up some number variables. You're going to need:

old_angle

new_angle

angle_delta

old_hue

new_hue

The trigger for your rule is going to be Custom Attribute and then get to the Mi Cube and pick the angle attribute and then "Changed".

In the action of your rule, the first step is to store the angle in new_angle and set the hue equal to old_hue. Then you want to do variable math. Each of this functions will have to be a different line in your action.

angle_delta set to new_angle minus old_angle

new_hue set to old_hue plus angle_delta

then an if statement that if new_hue >360

more variable math to subtract the constant 360 from new_hue

Then set the hue equal to new_hue and set old_angle equal to new_angle to store it for the next time.

This also assumes you're hue is defined as being 360 and not 100. If you're using 0-100 for your hue for this device, you'll have to do more variable math on new_hue before setting the device to that hue by dividing by the constant 3.6 and then more variable math to round to the nearest integer, since hue can't be a decimal I don't believe.

Were you able to follow all that? I know it's only in the broad strokes but it should work.