/ August 21, 2018/ Articles, Home Assistant, Xiaomi/ 0 comments

With the following code Xiaomi Mi Flora is added in Home Assistant via Docker and added with a nice LoveLace gui.

Be sure that you run Home Assistant in –net=host (docker) or network_mode: host (docker-compose) if running in docker. Needed for bluetooth access.

Home Assistant configuration:


plant:
miflora_plantname:
    sensors:
      moisture: sensor.miflora_plantname_moisture
      battery: sensor.miflora_plantname_battery
      temperature: sensor.miflora_plantname_temperature
      conductivity: sensor.miflora_plantname_conductivity
      brightness: sensor.miflora_plantname_light_intensity
    min_moisture: 8
    max_moisture: 150
    min_battery: 10
    min_conductivity: 50
    max_conductivity: 2000
    min_temperature: 0
    max_temperature: 40

sensor:
- platform: miflora
    name: MiFlora Plantname
    mac: 'xx:xx:xx:xx:xx:xx'

and the LoveLace:


cards:
        - type: picture-elements
          image: /local/cards/plants.jpg
          elements:
            - type: state-badge
              entity:  sensor.miflora_plantname_moisture
              style:
                top: 27%
                left: 10%
                --ha-label-badge-font-size: 1em
                color: rgb(255, 255, 255)
            - type: state-badge
              entity: sensor.miflora_plantname_light_intensity
              style:
                top: 27%
                left: 25%
                --ha-label-badge-font-size: 1em
                color: rgb(255, 255, 255)
            - type: state-badge
              entity: sensor.miflora_plantname_conductivity
              style:
                top: 27%
                left: 40%
                --ha-label-badge-font-size: 1em
                color: rgb(255, 255, 255)
            - type: state-label
              entity: sensor.miflora_plantname_temperature
              style:
                top: 15%
                left: 92%
                --ha-label-badge-font-size: 1em
                color: rgb(255, 255, 255)

Custom card based on example from here. It is changed with color white font so that a white theme will not make text invisable.

download plant image here.

Share this Post

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

11 − two =