al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.64k stars 664 forks source link

Add support for zhimi.toilet.va1 (local mode) #979

Open forhuan opened 1 year ago

forhuan commented 1 year ago

https://home.miot-spec.com/s/zhimi.toilet.va1

08:26:48 -> {"id":5537,"method":"set_power","params":["off"]}
08:26:48 <- {"code":0,"message":"ok","result":["ok"],"id":5537}
08:26:49 -> {"id":5539,"method":"get_prop","params":["power","onseat_state","seat_ring","closestool_cover","inwater_temp","water_temp_lvl","seat_temp","seat_temp_lvl","flow_level","wind_temp_lvl","nozzle_level","night_led","deodorize","filter_life","mode","user_work_statue","buzzer"]}
08:26:49 <- {"code":0,"message":"ok","result":["off","off","on","on",22,3,36,2,2,2,1,"off","off",98,"idle",0,"on"],"id":5539}
08:27:08 -> {"id":5540,"method":"set_power","params":["on"]}
08:27:08 <- {"code":0,"message":"ok","result":["ok"],"id":5540}
08:27:14 -> {"id":5541,"method":"set_watertemp_lvl","params":[2]}
08:27:14 <- {"code":0,"message":"ok","result":["ok"],"id":5541}
08:27:22 -> {"id":5542,"method":"set_watertemp_lvl","params":[3]}
08:27:22 <- {"code":0,"message":"ok","result":["ok"],"id":5542}
08:27:27 -> {"id":5543,"method":"set_seattemp_lvl","params":[3]}
08:27:27 <- {"code":0,"message":"ok","result":["ok"],"id":5543}
08:27:28 -> {"id":5544,"method":"set_seattemp_lvl","params":[2]}
08:27:28 <- {"code":0,"message":"ok","result":["ok"],"id":5544}
08:27:30 -> {"id":5545,"method":"set_flow_level","params":[3]}
08:27:30 <- {"code":0,"message":"ok","result":["ok"],"id":5545}
08:27:31 -> {"id":5546,"method":"set_flow_level","params":[2]}
08:27:31 <- {"code":0,"message":"ok","result":["ok"],"id":5546}
08:27:33 -> {"id":5547,"method":"set_windtemp_lvl","params":[3]}
08:27:33 <- {"code":0,"message":"ok","result":["ok"],"id":5547}
08:27:34 -> {"id":5548,"method":"set_windtemp_lvl","params":[2]}
08:27:34 <- {"code":0,"message":"ok","result":["ok"],"id":5548}
08:27:35 -> {"id":5549,"method":"set_nozzle_level","params":[2]}
08:27:35 <- {"code":0,"message":"ok","result":["ok"],"id":5549}
08:27:36 -> {"id":5550,"method":"set_nozzle_level","params":[1]}
08:27:36 <- {"code":0,"message":"ok","result":["ok"],"id":5550}
08:27:39 -> {"id":5551,"method":"set_night_led","params":["on"]}
08:27:39 <- {"code":0,"message":"ok","result":["ok"],"id":5551}
08:27:40 -> {"id":5552,"method":"set_night_led","params":["off"]}
08:27:40 <- {"code":0,"message":"ok","result":["ok"],"id":5552}
08:27:41 -> {"id":5553,"method":"set_buzzer","params":["off"]}
08:27:41 <- {"code":0,"message":"ok","result":["ok"],"id":5553}
08:27:42 -> {"id":5554,"method":"set_buzzer","params":["on"]}
08:27:42 <- {"code":0,"message":"ok","result":["ok"],"id":5554}
08:27:44 -> {"id":5555,"method":"set_deodorizer","params":["on"]}
08:27:44 <- {"code":0,"message":"ok","result":["ok"],"id":5555}
08:27:45 -> {"id":5556,"method":"set_deodorizer","params":["off"]}
al-one commented 1 year ago

{'power': 'off', 'onseat_state': 'off', 'seat_ring': 'on', 'closestool_cover': 'on', 'inwater_temp': 22, 'water_temp_lvl': 3, 'seat_temp': 36, 'seat_temp_lvl': 2, 'flow_level': 2, 'wind_temp_lvl': 2, 'nozzle_level': 1, 'night_led': 'off', 'deodorize': 'off', 'filter_life': 98, 'mode': 'idle', 'user_work_statue': 0, 'buzzer': 'on'}

mihsu81 commented 7 months ago

Would it be possible to add local mode also for zhimi.toilet.sa1? The specs are 100% the same in home.miot-spec.com (https://home.miot-spec.com/spec/zhimi.toilet.sa1). I'm currently on the latest release v0.7.17. Thanks in advance.

mihsu81 commented 7 months ago

When adding the device locally (with IP and token) I get only 5 control entities and they appear unavailable. In local mode I can control the device with the service _xiaomi_miot.sendcommand, like opening or closing the lid. image

service: xiaomi_miot.send_command
data:
  entity_id: binary_sensor.zhimi_sa1_849e_toilet
  method: set_cover
  params: "on"

These are the attributes of the binary sensor which gets created _binary_sensor.zhimi_sa1_849etoilet image