Mi Smart Pedestal Fan

@monkey-house sure thing here you go

#################################################################
#                                                               #
#                   Playroom - Smart Fan Card                   #
#                                                               #
#################################################################

          - type: custom:card-modder
            card:
              type: picture-elements
              image: /local/lovelace/playroom/playroom-fan_2.jpg
              elements:
                - type: state-icon
                  entity: fan.xiaomi_smart_fan
                  style: {color: white, left: 5%, top: 88%}
                - type: state-label
                  entity: fan.xiaomi_smart_fan
                  style: {color: white, left: 11%, top: 89%}
                - type: state-label
                  entity: sensor.playroom_fan_speed_level
                  style: {color: white, left: 20%, top: 89%}
                - type: state-label
                  entity: sensor.playroom_fan_speed
                  style: {color: white, left: 35%, top: 89%}
                  prefix: "Speed : "
                - type: state-label
                  entity: sensor.playroom_fan_angle
                  style: {color: white, left: 54%, top: 89%}
                  prefix: "Angle : "
                - type: state-label
                  entity: sensor.playroom_fan_oscillate
                  style: {color: white, left: 74%, top: 89%}
                  prefix: "Oscillate : "
                - type: state-icon
                  entity: sensor.playroom_fan_battery
                  style: {color: white, left: 88%, top: 88%}
                - type: state-label
                  entity: sensor.playroom_fan_battery
                  style: {color: white, left: 94%, top: 89%}
                  
                - type: state-label
                  entity: sensor.playroom_fan_temperature
                  style:
                    top: 12%
                    left: 5%
                    color: rgb(255, 255, 255)
                    transform: translate(0%,-50%)
                    pointer-events: none
                    text-shadow: 1px 1px black
                    font-family: Trebuchet MS
                    font-size: 90%
                    font-weight: bold
                    border-left-style: solid
                    border-color: rgb(34, 154, 210)
                    background-color: rgb(54, 65, 78)
                    opacity: 0.8

                - type: state-label
                  entity: sensor.playroom_fan_humidity
                  style:
                    top: 12%
                    right: 5%
                    color: rgb(255, 255, 255)
                    transform: translate(0%,-50%)
                    pointer-events: none
                    text-shadow: 1px 1px black
                    font-family: Trebuchet MS
                    font-size: 90%
                    font-weight: bold
                    border-right-style: solid
                    border-color: rgb(34, 154, 210)
                    background-color: rgb(54, 65, 78)
                    opacity: 0.8
            style:                 
              background-image: url("/local/lovelace/cardbackK.png")
              background-repeat: no-repeat
              background-color: rgba(50,50,50,0.3)
              background-size: 100% 68px
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
              overflow: hidden 

Complete config can be found here

2 Likes

Cheers for that! I’ll integrate that and try to figure how to get the sa1 fans to work.
@syssi: Any hints on the latter?

@monkey-house Just use this custom component: https://github.com/syssi/xiaomi_fan

Copy the complete custom_components directory to your `config/’ directory. It must look like this afterwards:

config/configuration.yaml
config/custom_components/fan/xiaomi_miio_fan.py

And load the platform at your configuration.yaml:

fan:
  - platform: xiaomi_miio_fan
    name: Xiaomi Smart Fan
    host: YOURFANIP
    token: YOURFANTOKEN
1 Like

@syssi Thanks for this. I had 2 issues:

  1. The fans were not connecting and staying connected to the network
  2. The custom component had not been updated
    This now works great and I look forward to integrating this with @jimpower’s custom card for Lovelace…

Thanks to all for their hard work!

2 Likes

@monkey-house So, your problem is solved?

Yes, indeed. Tanks!

@syssi Will you be updating this component to comply with changes in the latest updates?

2 Likes

I hope someone can support with the development of this custom component

Hi, i tried to add the custom component on HA raspberian, but im getting the error:
platform xiaomi_miio_fan not ready yet. retrying in 30 seconds.

somebody knows how to fix this?

what version HA are you running?

HA version 0.93.2

did you rename folder to xiaomi_miio_fan and the py file to fan.py I think there are also dependencies past 0.92.0 like adding this file __init__.py and a manifest.json not sure what the manifest should contain @syssi might be able to help with this maybe try this

{
  "domain": "fan",
  "name": "Xiaomi Miio Fan ",
  "documentation": "https://github.com/syssi/xiaomi_fan/",
  "dependencies": [],
  "codeowners": ["@syssi"],
  "requirements": ["miio==x.x.x"]
}

after creating the manifest.json HA is not starting

can you ssh into your machine?

im not sure how to get the debug code here, by the way, i installed python-miio using pip3. and i deleted the requirement in the manifest file. Still not responding.
Deleting the fan from the config and restarting the raspberry fixes everything, so im pretty sure that the problem is in the fan platform

I am also interested in the necessary step to use this custom component with the latest home assistant version. Can you give some advice @syssi? I’ll do some research and try to customize it myself.

I will update the custom component the next days!

4 Likes

@Tribune I’ve updated the custom component. Please give it a try!

3 Likes

Awesome! Thanks for the swift update. It works like a charm for me. I am currently running v1.3.1.0091. I wonder if someone tried the latest firmware version (v2.0.5.0094). Is it safe to upgrade?

The updated custom component works for me (HA version 0.92.2). Thanks a lot for your work!

1 Like