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

Added current orientation to aqara vibration sensor #1235

Merged
merged 4 commits into from
Dec 28, 2021
Merged

Added current orientation to aqara vibration sensor #1235

merged 4 commits into from
Dec 28, 2021

Conversation

schwickster
Copy link
Contributor

@schwickster schwickster commented Dec 27, 2021

As reported in #1230.. The aqara vibration sensor does not show the current orientation after doing a rotation. The code is based on https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/xiaomi/aq1_vibration_sensor.json and https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/xiaomi/aq1_vibration_sensor_orientation.js.

I tested it using this method https://github.com/zigpy/zha-device-handlers#testing-quirks-in-development-in-docker-based-install and using nodered the new event showed up using zha_event. Example of output

{
  "payload": {
    "event_type": "zha_event",
    "event": {
      "device_ieee": "00:15:8d:00:02:a5:7d:8f",
      "unique_id": "00:15:8d:00:02:a5:7d:8f:1:0x0500",
      "device_id": "a226eedbb4e375656c507de02530d4f1",
      "endpoint_id": 1,
      "cluster_id": 1280,
      "command": "current_orientation",
      "args": [
        {
          "rawValueX": 27,
          "rawValueY": 65520,
          "rawValueZ": 1166,
          "X": 0,
          "Y": 89,
          "Z": 1
        }
      ]
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-27T09:57:38.030045+00:00",
    "context": {
      "id": "90dce445d31b118a7c38bb3111f54747",
      "parent_id": null,
      "user_id": null
    }
  },
  "topic": "zha_event",
  "event_type": "zha_event",
  "_msgid": "750c5e7d616c5134"
}

…ys returns 90 degrees to the Y axis.. still need to look into it
Added raw values to output
@codecov-commenter
Copy link

codecov-commenter commented Dec 27, 2021

Codecov Report

Merging #1235 (2d4f00e) into dev (d5a7e9f) will decrease coverage by 0.15%.
The diff coverage is 15.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1235      +/-   ##
==========================================
- Coverage   80.41%   80.26%   -0.16%     
==========================================
  Files         207      207              
  Lines        5668     5680      +12     
==========================================
+ Hits         4558     4559       +1     
- Misses       1110     1121      +11     
Impacted Files Coverage Δ
zhaquirks/xiaomi/aqara/vibration_aq1.py 64.28% <15.38%> (-11.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5a7e9f...2d4f00e. Read the comment docs.

@coveralls
Copy link

coveralls commented Dec 27, 2021

Pull Request Test Coverage Report for Build 1631299406

  • 2 of 13 (15.38%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 80.264%

Changes Missing Coverage Covered Lines Changed/Added Lines %
zhaquirks/xiaomi/aqara/vibration_aq1.py 2 13 15.38%
Totals Coverage Status
Change from base Build 1622304008: -0.2%
Covered Lines: 4559
Relevant Lines: 5680

💛 - Coveralls

@schwickster
Copy link
Contributor Author

All done :) Apologies for the "many" commits fixing newbie mistakes :) First time working with Python. Let me know if it's good to be pulled.

@schwickster schwickster reopened this Dec 28, 2021
Copy link
Collaborator

@dmulcahey dmulcahey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dmulcahey dmulcahey merged commit 7c284b8 into zigpy:dev Dec 28, 2021
@fgonza2
Copy link

fgonza2 commented Mar 31, 2022

is this now available in home assistant 2022.3? i still can't access the device tilt on it

@schwickster
Copy link
Contributor Author

is this now available in home assistant 2022.3? i still can't access the device tilt on it

It's been available since 2021.12 release and works by checking zha_event event. See #1296

@majuss
Copy link

majuss commented Apr 6, 2022

I'am listenting to zha_event but nothing is coming in there. It just stays empty.

EDIT: okay now it works. I'am now fiddeling with the eventsensor custom component... Still no look getting the raw values.

@triggerx
Copy link

As of 2022.4.... still not there. Hoping it makes it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants