Pittini / iobroker-nodemihome

Steuerung von bisher nicht unterstützten Xiaomi Geräten in Iobroker via node-mihome
MIT License
27 stars 15 forks source link

Mi Smart Standing Fan 2 #37

Closed j-r79 closed 3 years ago

j-r79 commented 3 years ago

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 commented 3 years ago

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

dmaker.fan.p18.devicelist.txt

Pittini commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Ok, tnx, see V 0.2.23

Pittini commented 3 years ago

Can we close here, any problems?

j-r79 commented 3 years ago

sure, my fan is working.

w-marco commented 2 years ago

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

j-r79 commented 2 years ago

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