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.53k stars 641 forks source link

米家落地扇风速和摆头为什么不能集成在一个选项内 #1743

Open xzajyjs opened 3 months ago

xzajyjs commented 3 months ago

Device model / 设备型号

dmaker.fan.p8

Component version / 插件版本

No response

HA core version / HA版本

No response

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

  1. 如图所示,电风扇速度和摆头能否合成一个实体?类似于空调伴侣中的风速、温度和模式集成在同一个里。
  2. 另外,如何添加操控电扇后的提示音?
  3. 此外,在电风扇风速的配件设置中,有摆动这个选项,但是为什么不会在控制界面中显示呢? IMG_6073 IMG_6074

Entity attributes / 实体属性

preset_modes: 
oscillating: false
percentage: 33
percentage_step: 33
preset_mode: Straight Wind
model: dmaker.fan.p8
lan_ip: 192.168.31.172
mac_address: 7C:C2:94:9E:00:2B
entity_class: MiotFanEntity
home_room: xxxx
miot_type: urn:miot-spec-v2:device:fan:0000A005:dmaker-p8:2
fan.on: true
fan.fan_level: 1
fan.horizontal_swing: false
fan.mode: 0
fan.off_delay_time: 0
fan.alarm: false
fan.brightness: true
indicator_light.on: true
alarm: false
physical_controls_locked: false
state_updater: lan
sub_entities: fan-2.horizontal_swing-3, fan-2.alarm-11, alarm-4.alarm-1, fan-2.off_delay_time-10, physical_controls_locked-3.physical_controls_locked-1, indicator_light-5
friendly_name: 电风扇
supported_features: 3

Home Assistant Logs / 系统日志

No response

SodaWithoutSparkles commented 3 months ago

我也附议。现在暂时写了一个这样的UI

type: vertical-stack
cards:
  - type: tile
    entity: fan.fan1
    show_entity_picture: false
    vertical: false
    hide_state: false
    state_content: percentage
    features:
      - type: fan-speed
      - type: fan-preset-modes
        style: dropdown
        preset_modes:
          - Normal
          - Nature
  - type: conditional
    conditions:
      - condition: state
        entity: input_boolean.fan_fan1_oscillation
        state: 'on'
    card:
      features:
        - style: slider
          type: numeric-input
      type: tile
      entity: number.feng_shan_oscillation_angle
      show_entity_picture: false
      vertical: false
      hide_state: true
      icon_tap_action:
        action: call-service
        service: input_boolean.toggle
        target:
          entity_id: input_boolean.fan_fan1_oscillation
  - type: conditional
    conditions:
      - condition: state
        entity: input_boolean.fan_fan1_oscillation
        state: 'off'
    card:
      type: horizontal-stack
      cards:
        - type: tile
          entity: input_boolean.fan_fan1_oscillation
          tap_action:
            action: call-service
            service: fan.set_direction
            target:
              entity_id: fan.fan1
            data:
              direction: reverse
          icon_tap_action:
            action: call-service
            service: fan.set_direction
            target:
              entity_id: fan.fan1
            data:
              direction: reverse
          name: Left
          icon: mdi:arrow-left-thick
          hide_state: true
        - type: tile
          entity: input_boolean.fan_fan1_oscillation
          name: ' '
          hide_state: false
          state_content: state
          tap_action:
            action: toggle
          icon_tap_action:
            action: toggle
          icon: mdi:arrow-oscillating-off
        - type: tile
          entity: input_boolean.fan_fan1_oscillation
          tap_action:
            action: call-service
            service: fan.set_direction
            target:
              entity_id: fan.fan1
            data:
              direction: forward
          icon_tap_action:
            action: call-service
            service: fan.set_direction
            target:
              entity_id: fan.fan1
            data:
              direction: forward
          name: Right
          icon: mdi:arrow-right-thick
          hide_state: true
SodaWithoutSparkles commented 3 months ago

Possible mitigation method: https://github.com/Nerwyn/service-call-tile-feature

这样在UI 上可能没那么难看

xzajyjs commented 3 months ago

没说清楚,我想的是ios家庭app里的界面,电风扇风速和摆头不能像空调伴侣那样温度、模式、风速 合并在同一个窗口里面

iibowen commented 3 months ago

我也特别想知道要如何配置才能做到这样的效果,有群友也是用的米家风扇X1升级包可以实现这样效果(但是他也不知道为什么会这样),和他同款风扇我尝试了很多次都没法显示到外面,有没有大佬提点下,感谢! 参考

XuCcc commented 3 months ago

通过nodered进行转换,借助nrchkb插件模拟homekit设备

  1. https://bbs.hassbian.com/thread-26049-1-1.html
  2. https://nrchkb.github.io/wiki/service/fanv2/