New version of the plant integration

I have the following that you could use as base

The exclude functionality does not work yet, and in the near future i will add grouping by area, but don’t know when I will get time.

1 Like

it seems I figured some things out and with both the new HA update and your work done, thanks!

1 Like

Suddenly all cards are only showing the plant picture, name and battery status, but no sensors. No errors in the logs.

Home Assistant Core 2024.4.3
Hom Assistant Plant 2024.1.0
OpenPlantbook 1.2.0
Flower Card 2024.1.1

image

Some help would be appreciated.

Oh the sensors do work at least in settings:

Thank you for this awesome integration!

What kind of sensors do you use?

I use the Xaiomi/HHCC flower care devices and they don’t have an air humidity sensor.

I have other air humidity sensors in each room with plants, can I somehow add them to the plant device?

Edit: ok I found the solution with the plant.replace_sensor service

The sensors are completely independent, so they do not need to be from the same device.

Possibly it can be solved by clearing the cache of the browser or the App, or even restarting HA. It has happened to me at some point (I don’t know how to reproduce it again) and by restarting it worked again.

HA has already a restarted numerous times and it happens in all browsers. Mobile app, Firefox, edge, from work laptop, from private laptop, from private desktop. So not sure which cache needs to be cleared. It hasn’t shown the sensors for several months now.
Is there a way to troubleshoot this?

It was a bug that was fixed in the latest beta.

Created relases for both flower-card and plant now.
Upgrade to 2024.4.1 of both, and you should be fine.

You mean the ones that haven been added 30 minutes ago?
Will this show up later as an automatic update - or do I have to manually install it?

It will show up in HACS as soon as HACS reloads the repository. Usually happens within a few hours.

1 Like

Is there a way to use a dynamic battery sensor in the flower-card?
This isn’t working:

type: custom:auto-entities
card:
  type: custom:layout-card
  layout:
    layout:
      grid-gap: 1px 1px
      grid-template-columns: 50% 50%
      grid-template-rows: auto
      mediaquery:
        '(max-width: 1200px)':
          grid-gap: 1px 1px
          grid-template-columns: 100%
        '(max-width: 799px)':
          grid-gap: 1px 1px
          grid-template-columns: 100%
    layout_type: custom:grid-layout
    type: custom:layout-card
    cards: []
  layout_type: custom:horizontal-layout
card_param: cards
filter:
  include:
    - and:
        - domain: plant
        - area: tuin
      options:
        type: custom:stack-in-card
        mode: vertical
        cards:
          - type: custom:flower-card
            display_type: full
            show_bars: none
            entity: this.entity_id
            battery_sensor: >-
              {% if expand('group.bodemsensor_japanse_sneeuwbal') | selectattr(
              'entity_id','eq', this.entity_id) | list | count == 1 %}
                {%  set batsensor = 'sensor.border_japanse_sneeuwbal_battery_percent' %}
              {% else %}
                {%  set batsensor = 'sensor.border_japanse_sneeuwbal_battery_percent' %}
              {% endif %}
             {{ batsensor }}

Hi @Olen thank you for your plant integration!

I have an issue, I’m trying to create a new plant from UI, but it says that I don’t have entites for the soil moisture sensor:

But I have installed the Ecowitt GW1100 gateway and 2 WH51 Soil moisture sensors, do I have to do something more?

Thanks! :slight_smile:

The Soil Moisture sensors of the integration should have device_class moisture, not humidity.

See definitions here:

  • humidity: Percentage of humidity in the air in %
  • moisture: Percentage of water in a substance in %

Create a bugreport for the Ecowitt integrations.

In the mean time, you can use the “Replace sensor” service call (see README) to add the moisture sensor manually. The service call does not validate the device class of the sensor it adds.

Hi Olen,

thanks for the reply :wink:

for now I’ve done a template helper and it works:

- unique_id: soil_one
  trigger:
    - platform: time_pattern
      seconds: "/30"
    - platform: event
      event_type: event_template_reloaded
  sensor:
    - name: soil_one
      unique_id: soil_one
      state: "{{ states('sensor.gw1100a_soil_moisture_1') }}"
      unit_of_measurement: "%"
      device_class: moisture

Otherwise I will use the replace sensor service call.

thanks again! :wink:

My take on this:

image

2 Likes

Very nice touch. Care to share code?

One beer :beer: :smiley:
Sure, here you go.

type: custom:stack-in-card
keep:
  margin: false
  box_shadow: false
  background: false
cards:
  - type: grid
    square: false
    columns: 1
    cards:
      - type: custom:mushroom-template-card
        entity: input_button.golden_cane_palm_last_watered
        primary: Golden Cane Palm
        secondary: >
          Last watered: {{ (as_timestamp(now()) -
          as_timestamp(states.input_button.golden_cane_palm_last_watered.last_changed
          | default(0)) | int ) | timestamp_custom("%Hh %Mm", false)}} ago
        icon: mdi:palm-tree
        icon_color: white
        tap_action: more-info
  - type: grid
    square: false
    columns: 3
    cards:
      - type: custom:mushroom-entity-card
        entity: sensor.ble_moisture_plant_sensor
        primary_info: state
        secondary_info: false
        name: '%'
        icon_color: white
      - type: custom:mushroom-entity-card
        entity: sensor.ble_temperature_plant_sensor
        primary_info: state
        secondary_info: false
        name: °C
        icon_color: white
      - type: custom:mushroom-entity-card
        entity: sensor.ble_conductivity_plant_sensor
        icon: mdi:electron-framework
        icon_color: white
        primary_info: state
        secondary_info: false
        name: qS/cm
  - type: picture
    image: /local/images/gcp2.png
    image_entity: input_button.golden_cane_palm_last_watered
    tap_action:
      action: more-info
    card_mod:
      style: |
        ha-card {
        margin: -45px 0px !important;
        }
2 Likes

You can copy the sensor name and put it manually, it will recognize it. I have it working that way in my configuration.

I have similar issue as describeb before. Im not sure if its connected but it occured in almost the same time as update of OpenPlantbook. On most of the flower cards, the moisture has dissapeared (card is configured properly), on some it stayed as shown on below picture. When I go to plant integration, all data are pulled properly. I tried redownloading both PlantMonitor and downgrading OpenPlantBook, but didnt solve issue for existing cards. I was able to add new flower and it worked. There is an error in log that is related to these integrations.

If anyone has any idea what may have caused it, please let me know.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:229
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:40:59 (927 occurrences)
Last logged: 10:51:26

[546285233360] Error handling message: Unknown error (unknown_error) M from 192.168.xxx.xx (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36)
[546312347008] Error handling message: Unknown error (unknown_error) M from 192.168.xxx.xx (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36)
[546312110288] Error handling message: Unknown error (unknown_error) M from 192.168.xxx.xx (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 229, in async_handle
    handler(self.hass, self, schema(msg))
  File "/config/custom_components/plant/__init__.py", line 305, in ws_get_info
    msg["id"], {"result": plant_entity.websocket_info}
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/plant/__init__.py", line 469, in websocket_info
    ATTR_CURRENT: self.sensor_temperature.state or STATE_UNAVAILABLE,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 541, in state
    unit_of_measurement = self.unit_of_measurement
                          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 530, in unit_of_measurement
    return self.hass.config.units.temperature_unit
           ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'config'

I make a blueprint to check and notify all configured plants with this integration.

1 Like