-
Notifications
You must be signed in to change notification settings - Fork 330
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
[Help wanted] Failed to add 'ZXFANS F2 smart knob remote control' device by myself #1391
Comments
found similar config of another knob and tried it in self converter (and fix battery spec error) DEVICES = [{
# https://home.miot-spec.com/spec/ailol.remote.ts4
18250: ["zxf", "ZXFANS F2 smart knob remote control", "ailol.remote.ts4"],
"spec": [
BaseConv("battery", "sensor", mi="4.p.1003"),
BaseConv("action", "sensor"),
MapConv("action", mi="5.e.1012.p.1", map={1:: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_4_SINGLE, 5: "knob_increasing", 6: "knob_reduced"),
MapConv("action", mi="5.e.1013.p.1", map={1: BUTTON_1_DOUBLE, 2: BUTTON_2_DOUBLE, 3: BUTTON_3_DOUBLE, 4: BUTTON_4_DOUBLE}),
MapConv("action", mi="5.e.1014.p.1", map={1: BUTTON_1_HOLD, 2: BUTTON_2_HOLD, 3: BUTTON_3_HOLD, 4: BUTTON_4_HOLD}),
]
}] + DEVICES restart hass, but nothing change. delete the device, then add it back, tried DEVICES = [{
# https://home.miot-spec.com/spec/ailol.remote.ts4
18250: ["ZXFANS", "ZXFANS F2 smart knob remote control", "ailol.remote.ts4"],
"spec": [
BaseConv("battery", "sensor", mi="4.p.1003"),
]
}] + DEVICES the battery still no resp |
After a day passed, I reopened the Gateway3 integration of HomeAssistant, and it seems that the Battery was updated 20 hours ago 🥲. I guess it is because after the modification of this script is saved, it doesn't take effect immediately? Or because of the device, the frequency of updating the Battery is very low. |
success! from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
# https://home.miot-spec.com/spec/ailol.remote.ts4
18250: ["ZXFANS", "ZXFANS F2 smart knob remote control", "ailol.remote.ts4"],
"spec": [
BaseConv("battery", "sensor", mi="4.p.1003"),
BaseConv("action", "sensor"),
MapConv("action", mi="5.e.1012.p.1", map={1: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_4_SINGLE, 5: "knob_increasing", 6: "knob_reduced"}),
MapConv("action", mi="5.e.1013.p.1", map={1: BUTTON_1_DOUBLE, 2: BUTTON_2_DOUBLE, 3: BUTTON_3_DOUBLE, 4: BUTTON_4_DOUBLE}),
MapConv("action", mi="5.e.1014.p.1", map={1: BUTTON_1_HOLD, 2: BUTTON_2_HOLD, 3: BUTTON_3_HOLD, 4: BUTTON_4_HOLD}),
]
}] + DEVICES It seems that I accidentally added a semicolon in the script above, which caused an error. Download the diagnostic information to see the specific error. Now my only question is, how is this 5.e.xxx parsed from the spec? |
pr here #1393 |
我直接在devices里边改了。体验不太好。不能连续旋转。旋转间隔还不能太短。转一下要等等。 |
@xiasi0 你的使用方式是怎么样的? 我这边的情况是, 假如自动化(automation)监听旋钮 action 的状态, 在按钮触发的时候它会快速触发(trigger)两次状态变换, 但是 action 的值都是对应的按钮, 导致我不得不针对点击类型的按钮做了一个 timer 来防止 1s 内连续触发. 旋转倒是不用等, 只是自动化的设置需要修改模式从 single -> parallel(max:5) |
四个按键体验还可以,就是四个无线按钮。就是这个旋转,只有开始旋转才上报一个knob_increasing或者knob_reduced。你必须停下旋稍等一下,再次开始旋转才会上报第二个旋转状态。它不是连续的。
|
@xiasi0 确实如此, 我与客服咨询了一下, 确认是由于米家的限制, 导致旋钮类的设备无法连续多次触发, 即无法无极调节; 假如使用乐式芯片则可以直连, 但是这与HA就没有什么关系了 I consulted with the customer service and confirmed that it was due to the limitation of Mijia that the knob-type devices could not be triggered multiple times continuously, that is, they could not be adjusted infinitely; if you use the Leshi chip, you can connect directly, but this has nothing to do with HA. If you still use the Mijia gateway to access and want a similar effect, the solution provided by the customer service is as follows: https://b23.tv/BacCzic -- After starting the knob, a script will be started to continuously reduce the value, and click the button to stop |
I had some problems when trying to customize an unsupported device (ZXFANS F2 smart knob remote control). I found the spec page for this device: 'https://home.miot-spec.com/spec/ailol.remote.ts4', and then tried to add my own converter in the config folder:
/homeassistant/xiaomi_gateway3.py
After adding it, I found that the device added the sensor corresponding to the battery, but there was no specific content, and the other monitoring properties added did not get the content, even if I triggered the button. At the same time, other defined BLE devices, such as 'Mijia Smart Temperature and Humidity Monitor', are working normally.
![image](https://private-user-images.githubusercontent.com/5369814/344447728-cd326d10-f096-4a9f-8cc5-74d50a2c47a7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4Mjg3NzQsIm5iZiI6MTcyMTgyODQ3NCwicGF0aCI6Ii81MzY5ODE0LzM0NDQ0NzcyOC1jZDMyNmQxMC1mMDk2LTRhOWYtOGNjNS03NGQ1MGEyYzQ3YTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjRUMTM0MTE0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTVkNzNiMmRjOWMwMDIwYjQxZjE0MDc0ZjI2MjUzNGZiYWQzOTU0YmQyZmZlMTU5MGUyZTU0NjEwNjMzZDc3NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.2Jcsukv6LtzDjJrLs7KcVqXJowyy5bnNqzYw39iX8_M)
For the problem of battery not displaying, I tried to check the log. In /homeassistant/homeassistant.log, it seems that there is no relevant log content except the loaded log, but the log of Humidity Monitor is there (I have turned on the integrated debug log):
For the problem of knob/button not displaying, I checked wiki - Converters, I don't understand how to define the trigger of the knob/button through the device piid. In the examples of devices.py, it seems that many are triggered by siid, but I don't know where the mi spec of 'x.e.x' is obtained (the spec page provided initially seems to have only piid). I suspect that there is a problem with the converter I wrote, but I don't know where the problem is.
I hope someone can give me some tips on related operations or document links. I would be grateful.
The text was updated successfully, but these errors were encountered: