RodBr / miflora-card

A Home Assistant Lovelace card to report MiFlora plant sensors based on the HA Plant Card.
21 stars 30 forks source link

Read values from plant domain #13

Open k1rd3rf opened 4 years ago

k1rd3rf commented 4 years ago

It would be nice to specify one entity instead of each and every entity, since HA support the plant domain.

plant:
  ficus:
    sensors:
      moisture: sensor.plant_ficus_moisture
      conductivity: sensor.plant_ficus_conductivity
      brightness: sensor.plant_ficus_brightness
      temperature: sensor.plant_ficus_temperature
      battery: sensor.plant_ficus_battery
    min_moisture: 20
    max_moisture: 60
    min_conductivity: 350
    max_conductivity: 2000
    min_brightness: 2500
    max_brightness: 35000
    min_temperature: 8
    max_temperature: 32
    min_battery: 15

lovelace:

- type: custom:miflora-card
  title: 'Ficus microcarpa'
  image: images/ficus_microcarpa.jpg
  plant: plant.ficus
Olen commented 4 years ago

I like the idea. Getting the current status from the plant entity is easy enough. However, I can't find an easy way to get the configured max/min-values. There is another card here that just checks if the state contains a keyword, and will color the icon red based on that: https://github.com/jckoester/lovelace-picture-plant-card

But I don't really like that approach.

I think it would be better to get the configured min/max-values into the attributes of the plant "sensors": https://github.com/home-assistant/core/blob/dev/homeassistant/components/plant/__init__.py

That way we could read it directly from the plant entity. But that requires a PR to the plant component...