niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
495 stars 65 forks source link

Aqara smart knob switch H1 incompatible problem #137

Open linjt325 opened 1 year ago

linjt325 commented 1 year ago

Hi ! I have bought a Aqara smart knob switch H1(ZNXNKG01LM) , the channels work well but i can't get the state of switch .After looking into the mqtt log ,I found out the 'lumi res name' is not same as the param set in util.py:706

  # ['0.24.85', 'rotate_angle', 'rotate_angle', None], 
  # ['0.25.85', 'action_duration', 'action_time', None], 
  # ['0.29.85', 'rotate_angle', 'rotate_angle', None],  # while hold 
  # ['0.30.85', 'action_duration', 'rotate_angle', None],  # while hold  
  ['13.2.85', 'rotate_angle', 'rotate_angle', None],  
  ['13.6.85', 'action_duration', 'action_time', None], 
  ['13.9.85', 'rotate_angle', 'rotate_angle', None],  # while hold 
  ['13.13.85', 'action_duration', 'rotate_angle', None],  # while hold

here is my log ,i have taged the actions knoblog.log

and i don't know how to get the rotate angle . please tell me if there is a sloution.

linjt325 commented 1 year ago

according to aqara equipment-resourece model: lumi.switch.rkna01

res_name (CN) alias ResourceId
单次累计旋转角度 rotate_cumulate_angle 13.2.85
当前旋转角度 rotate_current_angle 13.3.85
当前旋转角度的百分比 rotate_current_angle_percent 13.5.85
累计旋转角度的百分比 rotate_cumulate_angle_percent 13.6.85
按着单次累计旋转角度 press_rotate_cumulate_angle 13.9.85
当前按着旋转角度 press_rotate_current_angle 13.10.85
单次按着累计旋转时间 press_rotate_cumulate_time 13.11.85
当前按着旋转角度的百分比 press_rotate_curr_angle_per 13.12.85