找回密碼
 立即註冊
惟家LINE群QRCODE
    查看: 3003|回覆: 2

    紅外線 電風扇設定檔分享

    [複製鏈接]

    !lvup!   100%

    11

    主題

    6

    回帖

    518

    積分

    超級版主

    積分
    518
    發表於 2022-4-22 22:38:40 | 顯示全部樓層 |閱讀模式
    本帖最後由 Borfang 於 2022-6-3 23:30 編輯

    我的風扇型號 奇美DF14D601 使用Broadlink RM4C Mini控制
    #請修改實體ID改成自己的
    HACS安裝 remote Fan speed control
    https://github.com/yiskang/homeassistant-remote-fan-speed-control



    switch:
      - platform: template
        switches:
          chimei_dc_fan_power:
            friendly_name: "Chimei DC Fan Power"
            value_template: "{{ states('sensor.kong_5_4_current_consumption')|float > 1.6 }}"
            turn_on:
              service: script.turn_on
              data:
                entity_id: script.chimei_fan_power
            turn_off:
              service: script.turn_on
              data:
                entity_id: script.chimei_fan_power

    script:
      chimei_fan_power:
          sequence:
            - service: input_text.set_value
              data_template:
                entity_id: input_text.status_chimei_fan_speed
                value: '{{4/7 * 100 | int}}'
            - service: remote.send_command
              data:
                entity_id: remote.fang_jian_rm4c_mini_remote
                command: b64:JgCcACcPKQ4OKCoOKQ8MKg0pDigOKA4pDSkqAAUdKg4pDw0pKQ8pDg4pDSkNKQ0pDigOKCoABR4pDykODSkqDikPDCoNKQ4rCygOKQ0pKQAFHikPKQ8NKSkPKQ4NKQ4oDikNKQ0pDSkpAAUeKg4pDwwqKQ8pDg0qDSkNKQ0pDSkOKCkABR8pDikPDSkpDykPDSkNKQ0pDSkOKA4oKgANBQ==

    input_text:
      status_chimei_fan_speed:
        name: 'Chimei DF-14D601 Speed'
        initial: 0 # //!<<< Adjust this value if your actual fan speed is not zero. Formula: round( current_speed / speed_count * 100 );


    input_select:
      fan_osc:
        name: 'Fan osc'
        options:
          - 'True'
          - 'False'


    fan:
      - platform: template
        fans:
          chimei_fan:
            friendly_name: "Chimei DC Fan"
            speed_count: 7
            value_template: "{{ states('switch.chimei_dc_fan_power') }}"
            percentage_template: "{{ states('input_text.status_chimei_fan_speed') | int }}"
            oscillating_template: "{{ states('input_select.fan_osc') }}"
            turn_on:
              - condition: state
                entity_id: switch.chimei_dc_fan_power
                state: 'off'
              - service: switch.turn_on
                entity_id: switch.chimei_dc_fan_power
            turn_off:
              - condition: state
                entity_id: switch.chimei_dc_fan_power
                state: 'on'
              - service: switch.turn_off
                entity_id: switch.chimei_dc_fan_power
            set_percentage:
              - service: python_script.remote_fan_speed_control
                data_template:
                  percentage: "{{ percentage }}"
                  entity_id: fan.chimei_fan
                  speed_entity_id: input_text.status_chimei_fan_speed
                  speed_count: 7
                  service: remote.send_command
                  service_data_decrease:
                    entity_id: remote.fang_jian_rm4c_mini_remote
                    command: b64:JgBOACgOKQ8NKSkPKQ8pDg4oDikNKSkOKg4NAAU5KQ4pDw0pKQ8pDioODigOKA4pKQ4pDw0ABTgpDykPDSkpDykOKQ8NKQ0oDygpDykPDAANBQ==
                  service_data_increase:
                    entity_id: remote.fang_jian_rm4c_mini_remote
                    command: b64:JgBOACcPKQ8NKSkOKg4NKQ4oDigOKQ0pKQ8NAAU4KQ8pDw0pKQ8pDg0pDigOKQ0pDSkpDw0ABTgqDikODisnDikPDSkOKA4oDikNKSkODgANBQ==
            set_oscillating:
              - condition: state
                entity_id: switch.chimei_dc_fan_power
                state: 'on'
              - service: remote.send_command
                data:
                  entity_id: remote.fang_jian_rm4c_mini_remote
                  command: b64:JgCCACgOKQ8NKSkPKQ8MKg0pKQ8NKQ0pDSkNAAU5KQ8pDg0qKQ4pDw0pDigpDw0pDSkOKQ0ABTkpDikPDCopDykODikMKikODSoMKgwqDQAFOSkOKg4NKSkPKQ8MKg0pKQ8MKg0pDSkOAAU4KQ8pDg0pKg4pDw0pDigpDwwqDSkOKA4ADQU=
              - service: input_select.select_next
                entity_id: input_select.fan_osc




    !lvup!   8%

    0

    主題

    1

    回帖

    62

    積分

    註冊會員

    積分
    62
    發表於 2022-4-25 18:55:52 來自手機 | 顯示全部樓層
    請問一下資料是要放哪個路徑 是config.yaml還是放呢

    !lvup!   100%

    11

    主題

    6

    回帖

    518

    積分

    超級版主

    積分
    518
     樓主| 發表於 2022-4-26 21:42:16 | 顯示全部樓層
    loveoreo2020 發表於 2022-4-25 18:55
    請問一下資料是要放哪個路徑 是config.yaml還是放呢

    都可以 我習慣放packages裡面
    您需要登入後纔可以回帖 登入 | 立即註冊

    本版積分規則

    Archiver|手機版|惟家的智能論壇

    GMT+8, 2026-9-24 13:17 , Processed in 0.101415 second(s), 24 queries .

    快速回覆 返回頂部 返回列表