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

Mi Smart Standing Fan 2 #37

Closed
j-r79 opened this issue Jun 30, 2021 · 9 comments
Closed

Mi Smart Standing Fan 2 #37

j-r79 opened this issue Jun 30, 2021 · 9 comments

Comments

@j-r79
Copy link

j-r79 commented Jun 30, 2021

Hi,

i changed your script and added the device-file:

dmaker.fan.p18.js.txt

In the devices list i added:

DefineDevice[22] = { // Tested and working info: {}, model: "dmaker.fan.p18",// https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p18:1 description: "Mi Smart Standing Fan 2", setter: { "fan.on": async function (obj, val) { await device[obj].setPower(val) }, "fan.mode": async function (obj, val) { await device[obj].setMode(val) }, "fan.fan-level": async function (obj, val) { await device[obj].setFanLevel(val) }, "fan.horizontal-swing": async function (obj, val) { await device[obj].setHorizontalSwing(val) }, "fan.horizontal-angle": async function (obj, val) { await device[obj].setHorizontalAngle(val) }, "alarm.alarm": async function (obj, val) { await device[obj].setAlarm(val) }, "motor-controller.motor-control": async function (obj, val) { await device[obj].setMotorController(val) }, "physical-controls-locked.physical-controls-locked": async function (obj, val) { await device[obj].setChildLock(val) }, "off-delay-time.off-delay-time": async function (obj, val) { await device[obj].setOffDelayTime(val) } }, common: [{ name: "fan.on", type: "boolean", role: "switch", read: true, write: true }, { name: "fan.mode", type: "number", role: "switch", read: true, write: true, min: 0, max: 1, states: { 0: "Straight Wind", 1: "Natural Wind" } }, { name: "fan.fan-level", type: "number", role: "switch", read: true, write: true, min: 1, max: 4, states: { 1: "Slow", 2: "Middle", 3: "High", 4: "Turbo" } }, { name: "fan.horizontal-swing", type: "boolean", role: "switch", read: true, write: true }, { name: "fan.horizontal-angle", type: "number", role: "switch", read: true, write: true, min: 30, max: 140, unit: "°", states: { 30: "30°", 60: "60°", 90: "90°", 120: "120°", 140: "140°" } }, { name: "fan.status", type: "number", role: "indicator", read: true, write: false, min: 1, max: 100 }, { name: "alarm.alarm", type: "boolean", role: "switch", read: true, write: true }, { name: "motor-controller.motor-control", type: "number", role: "switch", read: false, write: true, min: 0, max: 2, states: { 0: "None", 1: "Left", 2: "Right" } }, { name: "physical-controls-locked.physical-controls-locked", type: "boolean", role: "switch", read: true, write: true, min: false, max: true }, { name: "off-delay-time.off-delay-time", type: "number", role: "switch", read: true, write: true, min: 0, max: 480, unit: "m" } ] };

Maybe you can add the support in your official script.

@j-r79
Copy link
Author

j-r79 commented Jun 30, 2021

Sorry, here is the same as txt-file with better form:

dmaker.fan.p18.devicelist.txt

@Pittini
Copy link
Owner

Pittini commented Jun 30, 2021

DefineDevice[22] already exists in line 135, pls use 23. Which Definition File is used for? Yes, shure i will add it in the script, working on it, i think in an hour or so its updated.

@j-r79
Copy link
Author

j-r79 commented Jun 30, 2021

I'm sorry, i have not the newest version in my iobroker, in my script was 22 not used :-)

i will change it.

@j-r79
Copy link
Author

j-r79 commented Jun 30, 2021

it was hard to get it working, not because of your script, but i have all IoT devices in an extra subnet which is sepereated by a firewall. All firewall-rules were correct, but the fan did not work. The error is: xiaomi/mi devices do not answer to requests of devices which are not in the same subnet. i changed my firewall to do a 1:1 nat between iobroker and the IoT-subnet and now i get responses.

I used the settings of 'dmaker.fan.p15' and removed the indicator light, which is not supported.

@Pittini
Copy link
Owner

Pittini commented Jun 30, 2021

Ok, tnx, see V 0.2.23

@Pittini
Copy link
Owner

Pittini commented Jul 16, 2021

Can we close here, any problems?

@j-r79
Copy link
Author

j-r79 commented Jul 18, 2021

sure, my fan is working.

@w-marco
Copy link

w-marco commented May 18, 2022

@j-r79 this seems broken for me (see issue 59). is it still working for you?

@j-r79
Copy link
Author

j-r79 commented May 19, 2022

I'm sorry, i switched to HAM-xiaomifan a while ago...

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

No branches or pull requests

3 participants