GithubHelp home page GithubHelp logo

coolguy001tv / lovelace-fan-xiaomi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ikaruswill/lovelace-fan-xiaomi

0.0 1.0 0.0 23.59 MB

适配智米3风扇的设置

License: Apache License 2.0

JavaScript 13.89% TypeScript 86.11%

lovelace-fan-xiaomi's Introduction

Xiaomi Fan Lovelace Card

hacs_badge

Xiaomi Smartmi Fan Lovelace card for HASS/Home Assistant.

Features

  • Supports HACS installation
  • CSS fan blade and oscillation animation
  • UI config of card
  • Wide range of fans support by using HA standard speeds flag

Toggles

  • Oscillation
  • Natural mode
  • Child lock
  • Sleep mode

Cycling

  • Speed level
  • Oscillation angle
  • Timer duration

Requirements

By default, the Xiaomi Miio native integration will be used.

If you have a model that's not supported by the native integration yet, this card also supports the Xiaomi Mi Smart Pedestal Fan integration.

HACS Installation

Search for Xiaomi Smartmi Fan Card

Manual Installation

  1. Download fan-xiaomi.js
  2. Copy to www/community/lovelace-fan-xiaomi/fan-xiaomi.js
  3. Add the following to your Lovelace resources
    resources:
      - url: /community_plugin/lovelace-fan-xiaomi/fan-xiaomi.js
        type: js

Card Configuration

Example of Lovelace config views.cards key

entity: fan.entity_id
name: Fan Name
type: "custom:fan-xiaomi"
platform: xiaomi_miio_airpurifier
Card attribute Default Description
entity_id - entity_id of your fan
type - Must be custom:fan-xiaomi
name - (Optional) Fan name shown on card title
platform default (Optional) If using Xiaomi Mi Smart Pedestal Fan integration, specify xiaomi_miio_fan.
disable_animation False (Optional) Disable fan image and animation
force_sleep_mode_support False (Optional) Enables Sleep button in UI which sets speed to 1%
hide_led_button False (Optional) Hide LED toggle for supported models

Preview

Contributing

  1. Clone the repo and install the latest node LTS
  2. Run npm install then npm run build from the root of the repo

Build output should appear in the /dist directory.

Development Inner Loop

  1. npm install
  2. Run npm run start to do a watch build and host the built files at http://127.0.0.1:5000/xiaomi-fan-card.js.
  3. On a running Home Assistant installation add this to your Lovelace resources:
- url: "http://127.0.0.1:5000/xiaomi-fan-card.js"
  type: module

You may need to change "127.0.0.1" to the IP of your development machine if you are developing remotely.

If your Home Assistant UI is running on https, you'll need to provide the resources via https as well. Use npm run start -- --https to serve via https, and switch the url: http://127.0.0.1 above to url: https://localhost.

Credits

fineemb (Original author)

shaonianzhentan

花神

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.