Cloud Plant DB with API for PlantCard

Any progress on the F to C functionality?

Any chance for adding this project to HACS?

1 Like

I’m missing a plant in the database and don’t know where to get the data elsewhere?
I’m looking for the: Phlebodium aureum nickname: Blue Star.

I don’t know where to get the data and how to push it through the api.

Is there someone willing to help :slight_smile:

Hi all,

I really want to move this forward. However, we need to get some traction on this issue before I am able to get this to a really usable state in HA.

1 Like

The info usually available in the internet. In order to push it to DB via API you can use Postman (I’m still working on Web UI functionality for this) using this collection:

The sequence is:

  1. Get API key form web UI.
  2. Get token via API (1st call in postman)
  3. Create plant (CREATE PLANT call in postman) with plant data in json format. See examples:
    https://github.com/slaxor505/OpenPlantbook-client
curl --request POST 'http://open.plantbook.io/api/v1/plant/create' \
--header 'Authorization: Bearer token_string' \
--header 'Content-Type: application/json' \
--data-raw '{
    "display_pid": "Solanum lycopersicum",
    "alias": "Tomato",
    "max_light_mmol": 7600,
    "min_light_mmol": 3200,
    "max_light_lux": 55000,
    "min_light_lux": 3000,
    "max_temp": 33,
    "min_temp": 12,
    "max_env_humid": 80,
    "min_env_humid": 15,
    "max_soil_moist": 60,
    "min_soil_moist": 20,
    "max_soil_ec": 2000,
    "min_soil_ec": 350
}'

Let me know if any issue with above.

Yeah should work out. Just don’t know where to find the data. Temperature is easy but then all other data is harder or it’s just my non green fingers that cannot figure it out xD

Lemme try and search for this information :slight_smile:

Any chance for adding this project to HACS?

Do you think it has some benefits?

@homelord @NOTORIOUSVR

  1. FYI, there is an error in your look up… its adding a 2nd .jpg on the end of any URL (local or remote) so right now local is the only way to make images work and you have to add a 2nd .jpg to the file name:
  1. Any progress on the F to C functionality?

Will take a look at both as next item in the list.

“Do you think it has some benefits?”

Of course is, one click installation and easy update of the plugin.

Did you find anything about this plant? Or is there a place I can search for myself? I just don’t know how to search for this data :slight_smile:

Sorry, it is still in progress. I had a chat about it with my friend botanist and this is what he proposed:

  1. Temp range - you can find it easily in internet.

  2. Light - Look for type of light the plant prefers, e.g.: Direct Sunlight, Indirect Sunlight, etc. Then find physical parameters for this type of light.
    For your particular plant Phlebodium aureum - Blue Star:
    https://smartgardenguide.com/blue-star-fern-care/
    It needs Bright Indirect light. So the number for the light is here:
    https://smartgardenguide.com/bright-indirect-light-for-plants/
    It possibly needs conversion to Lux we can only account for that at this stage. Though, ideally I think it should be in PAR or PPFD:
    https://420expertguide.com/resource/grow-light-par-ppf-ppfd-values-decoded/

It is feasible to implement in future because it is kind of accumulation of light over a period of time.

  1. Soil humidity can be approach the same way as light. Look for preferable soil humidity for the plant and then find its parameters in numbers.

  2. Air humidity. We don’t account currently in this integration but DB has it and it is important factor. Basically, can approach the same way as #2 and #3. Alternatively, look for a native place for the plant and then find typical air humidity at this geographical location.

  3. Soil fertility. I think scientifically it is Soil Electrical conductivity or EC. There is also TDC value which I think derives from EC.
    https://www.westlab.com/blog/2018/01/23/what-is-the-difference-between-conductivity-ec-and-tds
    This is tricky one and I’m still trying to figure this out. The proposed way is to go to fertilizer producer website. They have tables for specific plants with above values I assume (have not checked yet) For example producer site which may have such tables: https://generalhydroponics.com/

Again, I’m still researching those but combining efforts always produce better results :slight_smile:

Furthermore, if we go to more precise measurements for better plant growth automation, there are different ranges of temperature for day of light and time of the year :slight_smile: It also can be reflected in PlantDB.

This is another site where potentially we can get thresholds for different plants.
http://www.takii.com/

I hope it will help!

1 Like

I found some info and I believe I have a good rough estimate

curl --request POST 'http://open.plantbook.io/api/v1/plant/create' \
--header 'Authorization: Bearer token_string' \
--header 'Content-Type: application/json' \
--data-raw '{
    "display_pid": "Philodendron hederaceum",
    "alias": "Blue Star Fern",
    "max_light_mmol": 7600,
    "min_light_mmol": 3200,
    "max_light_lux": 2000,
    "min_light_lux": 800,
    "max_temp": 27,
    "min_temp": 14,
    "max_env_humid": 80,
    "min_env_humid": 30,
    "max_soil_moist": 75,
    "min_soil_moist": 25,
    "max_soil_ec": 1000,
    "min_soil_ec": 175
}'

But the only thing I cannot find out is the mmol data.
the Lux should be correct but I dont know what mmol is.

This is not me asking you to upload it. I will do this myself :slight_smile: Just a question about the mmol data before I upload it.

Oh and the question how to upload an image?

Wow! Excellent. I’m really curious how did you find them. Would you mind sharing?

But the only thing I cannot find out is the mmol data.

You don’t have to specify all the parameters at once. Set what you have and then you can update reminder if necessary or just leave them.

mmol is threasholds for photosynthetic photon flux (PPF). More info here. We don’t account for this in the HASS integration for now (though we should) You can omit those for now. To calculate PPFD you can use this calculator: Lux to PPFD. Thought, it requires to know the spectrum of the light. If you plant outside then you can use just Natural Daylight. If it is a lamp then laps spectrum should be used. I don’t really know which spectrum mmol in DB currently for so I assume it is daylight.

Oh and the question how to upload an image?

In answer to your question, the pics upload is manual process at this stage so please send the picture to [email protected] with “pid” which PlantBook API returned when you created the plant and I will upload it.

Sorry for the late reply.

I just looked up info about temperature (that was easy)
And the water and light I crossed referenced with different plants that has already numerical data.
And kind of guessed which numerical values were best.

So yeah it could still be changed if better values are found. But I think i’m quite close :slight_smile:

I will add it soon and send a picture.

EDIT: So adding doesnt work.

curl --request POST 'http://open.plantbook.io/api/v1/plant/create' \
--header 'Authorization: Bearer My_generated_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "display_pid": "Phlebodium aureum",
    "alias": "Blue Star Fern",
    "max_light_lux": 2000,
    "min_light_lux": 800,
    "max_temp": 27,
    "min_temp": 14,
    "max_env_humid": 80,
    "min_env_humid": 30,
    "max_soil_moist": 75,
    "min_soil_moist": 25,
    "max_soil_ec": 1000,
    "min_soil_ec": 175
}'

After that I get

curl: (7) Failed to connect to open.plantbook.io port 80: Connection refused

And I know internet works and the page can be reached. Because if I try it without token it gives me an authentication needed message. So I do get reply from the server.

oops… sorry I missed your update.

curl: (7) Failed to connect to open.plantbook.io port 80: Connection refused

This is because you use HTTP in the url. It must be HTTPS

The command should be:

curl --request POST 'https://open.plantbook.io/api/v1/plant/create' ....

@homelord is my understanding correct that your sensor values on the card are in F but thresholds in C?

I really want to move this forward. However, we need to get some traction on this issue before I am able to get this to a really usable state in HA.

Is there a way to help out with this? Do we need to make some buzz in that request thread? :slight_smile:

Hi there! Thanks for the great work! I just implemented this without problems.

What would you guys suggest as a interval time for polling? I have it set to 12 hours but will this mess up the plant card data when it is compared to the data in the API

Glad it works! Short answer, I’d say 1 hour would be enough. Which sensor do you use and how is it connected? Though, I use Xiaomi MiFlora + ESP32 BLE gateway + MQTT Mosquitto broker on HASS end. So there is no polling in my case as far as I understand. The sensor itself broadcast its values over BLE and it gets across MQTT gateway to HASS. I think the sensor broadcast every 1 hour or so.