Cloud Plant DB with API for PlantCard

It seems that it still does not work:
Invalid config for [plant]: [client_id] is an invalid option for [plant]. Check: plant->plant->openplantbook->client_id.

I have to correct myself.
After several restarts, commenting and uncommenting the plant section in the config file, reintalling the component, it is working now.
Thank you!

@Damos Do you use HACS or install the component manually?

I’ve installed it through HACS.

1 Like

Hi, the last update solved the problem with “state”, but after reinstallation I was left with two error states that make it impossible to run the integration:

Logger: custom_components.plant
Source: custom_components/plant/init.py:191
Integration: plant
First occurred: 13:08:08 (1 occurrences)
Last logged: 13:08:08
Unable to get token from plantbook API: ‘access_token’

Logger: homeassistant.setup
Source: custom_components/plant/init.py:254
Integration: plant
First occurred: 13:08:08 (1 occurrences)
Last logged: 13:08:08
Error during setup of component plant
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 235, in _async_setup_component
result = await task
File “/config/custom_components/plant/init.py”, line 163, in async_setup
entity = Plant(plant_name, plant_config)
File “/config/custom_components/plant/init.py”, line 254, in init
name, PLANTBOOK_TOKEN[:4], PLANTBOOK_TOKEN[-4:]
TypeError: ‘NoneType’ object is not subscriptable

I tried a fresh install via HACS, but it didn’t solve the problem…

Hi,

All is working fine here after update, so problem is more likely related to your config
At least your token is not valid anymore

@Mag_Re make sure your HASS has access to internet as looking into code it seems that HASS cannot get token from Plantbook API. Also check if you still have valid API client/key in the HASS configuration. If you still having problems drop me private message here or in discord. Plantbook

Hey guys, can you help me with gathering some of information for further development of the HASS component and Plantbook API.
Please answer the following questions. If you choose “Other” for any of the questions then share what is that other in this thread or send me privately.
Thanks in advance!

I use the following Plant sensors:

  • Xiaomi Miflora
  • Vegtrug
  • Other

0 voters

I use the followig gateway to connect the plant sensors:

  • OpenMQTTGateway
  • ESPHome
  • Other

0 voters

Plantbook integration deployed

  • Manually using customer_component directory
  • HACS
  • Other

0 voters

UI configuration of the component is:

  • Nice to have
  • Crutial
  • Not necessary

0 voters

Hi,
HACS offered me an update again yesterday. After applying it, after some time, the update for plant came up as well. After applying it everything is fine. Apparently something was preventing get the token from the Plantbook API, but I couldn’t find the cause.

For anyone following this thread, my “Plant” integration is now completely rewritten, and in a much better state.
The new version is available as a beta release in HACS (custom repository), and is ready for testing.

Install and usage instructions are in the readme, but please note that the integration is not compatible with the regular plant integration.

3 Likes

I have beta 3 of Olen’s Homeassistant Plant with Beta 1 of Lovelace flower card and the Home Assistant openplantbook integration up and running. I want to change the icons of the sensors in my love-lace setup so I have done some yaml entries in cofiguration.yaml and tried to change the icon via gui and it works… everywhere else than love-lace. So I have installed mod-card by Thomas Loven and Im ready to do some styling, but hov do I style those attributes ??Skærmbillede 2022-08-09 kl. 06.31.23
Skærmbillede 2022-08-09 kl. 06.28.53
Skærmbillede 2022-08-09 kl. 06.42.16

Hi,

The icons are taken from the icon attribute of the different sensors. However I don’t know how that plays with cutomized icons. I’ll see if can figure out why it does not return the customized icon.

Got it.

A new beta 6 is released which should fix this.

Thank you Olen … it works when changing the icon under sensor
To others who see this There are several places were you can edit the icon in picture 1 below: Gui show under each plant an option for enhed (eng: unit) or entiteter (eng: entities) if you click on unit you will see the main settings page. if you change the icon under kontrolelementer (eng: control elements) (picture 2) the icon will not always update. pic the sensor instead that icon updates every time. also from picture 1 click on the entiteter (eng:entities) and change the icon from the entities page that works too
Skærmbillede 2022-08-12 kl. 00.45.08


Skærmbillede 2022-08-12 kl. 00.51.21

Thank you Olen … it works when changing the icon under sensor
To others who see this There are several places were you can edit the icon in picture 1 below: Gui show under each plant an option for enhed (eng: unit) or entiteter (eng: entities) if you click on unit you will see the main settings page. if you change the icon under kontrolelementer (eng: control elements) (picture 2) the icon will not always update. pic the sensor instead that icon updates every time. also from picture 1 click on the entiteter (eng:entities) and change the icon from the entities page that works too. Skærmbillede 2022-08-12 kl. 00.45.08

Out of curiousity, which solution are folks using to gather the ble data from the mi floras? I’ve been using room-assistant, but thinking of switching to theengs gateway.

The Passive BLE monitor custom component has been my go to until the 2022.8 release where it’s now natively supported.

I don’t really understand what you say here.
But the control element is just a virtual “plant” entity, and the icon will usually be the plant image almost anywhere in the GUI. I can’t see any good reasons to change this icon. That is, you can obviously change it i you want, but it is hardly ever shown anywhere, so there is little use.


(Example with an entites-card, the “official” plant card, and my version of the flower-card. The plant-icon is never shown unless the image is missing).

The “configuration” elements are the thresholds. These are separate entities, and their icons can be changed, and are unrelated to the other icons.

The “sensor” elements are the measurements. These icons can also be changed. These are the icons that are shown in the flower-card, but due to a bug, the flower card only showed the original icon, not the one you changed to. That was fixed, and should be working now. As you can see from the screenshot above, where I changed the conductivity-icon to something random un the GUI.

Oh, sorry, I see now.

You have a bunch of old entities hanging in the control elements box.
They are “dead” and can be deleted (the have been replaced with the new sensors). You can see they are all “Utilgængelig”

The big change before beta 5 had some side effects like this.
So just go the the “Settings” → “Entities” and delete all the unavailable “plant.*” entities.

I also used o use the passive ble integration, and just switched to th new built in Bluetooth + Xiaomi BLE integration.

I must say the naming of the sensors from the built in integration is pretty useless. They just name everything “Flower Care” and all sensors are just sensor.flower_care_illuminance_1 and …_2 and _3 etc. With NO indication of which is which or identification in any of the sensors.

So if you switch, what I did was to screenshot the values from all the existing sensors before I made the change, and I could make a reasonable guess on which new device was which old device based on the values for moisutre, conductivity etc.