Olen / home-assistant-openplantbook

Integration to search and fetch data from Openplantbook.io
GNU General Public License v3.0
122 stars 5 forks source link

link integration with your openplantbook profile #21

Open ChristophCaina opened 4 months ago

ChristophCaina commented 4 months ago

Hi there,

Since the integration can upload your plant data to open plant book, it would be great, if it would be possible to 'add' your plants to the "My Plants" in OpenPlantBook.

Right now, the case is the following:

I can search for a plant in open Plant Book while setting up a new Plant sensor in the Plant integration. Through the OpenPlantBook integration, it will search the openPlantBook if this plant exists. This can be either a "Public" plant - or a user plant...

In openPlantBook, I can create a clone of the plants to add it to my plants - or I need to add a new plant - since cloning an existing Plant will not change the PID (as of now)... All created and cloned plants are then shown as "my Plants" in OpenPlantBook - so far, so good...

BUT: If a plant does already exist and the integration was able to fetch the data, it is now uploading sensor data to OpenPlantBook if enabled. It would also be great, if:

the integration would clone the plant to "my plants" - and if I could just see my uploaded sensor information within openPlantBook -> my plants....

So in short, a cross-link between the plants I have added in HA and OpenPlantBook would be great. :)

Or is something like this already possible and I haven't found it? :)

Thanks

slaxor505 commented 4 months ago

Hi Christoph,

Thank you very much for the suggestion and sorry for the delayed response.

I'm trying to understand the use case a bit more.

the integration would clone the plant to "my plants" - and if I could just see my uploaded sensor information within openPlantBook -> my plants....

If I got it right, you would like to see plants' sensor data and the plants in the dedicated place/page on in OPB Web UI. Is that right? If so then I was thinking to bring such functionality in the future and it makes perfect sense. However, I will need to change the structure of web UI a bit. The thing about "My Plants" is that currently it is for plants you have modified or contributed to the data base so it is not related to Sensor data. I think I will need to rename it to something like "My Contribution" or maybe make a subsection for DB and Sensor Data within "My Plants". I'm keen on hearing if you have your ideas how to structure it.

Secondly, the sensor data is in Grafana which is separated from main UI. It is very easy just to give you a list of plants you are uploading but if you would like to see their data then it is a bit trickier. The data in Grafana is anonymous so I will need to ask for explicit consent from users to make it traceable using their user_ID. So it will look like "if you like to browse your sensor data then please provide consent to make data traceable and bound to the internal OPB user identifier (number). No personal and private data will be stored." Then I can make it work either from OPB UI or in Grafana UI. Thoughts? Is it what you would like to see?

Please elaborate more on the below as I could not fully understand the scenario:

All created and cloned plants are then shown as "my Plants" in OpenPlantBook - so far, so good... BUT: If a plant does already exist and the integration was able to fetch the data, it is now uploading sensor data to OpenPlantBook if enabled.

Do you mean that this integration should upload data for plants which are in "My Plants"? Not sure about it but the integration only uploading data for plants which exists in HASS and it automatically matches them to plants in DB. Anyway, please clarify.

It is good that you mentioned cloned plants... I think I need to improve how the sensor data upload handles such plants as it may be a bit inaccurate at the moment. Thanks for that.

ChristophCaina commented 4 months ago

Hi :) Thanks for your reply - what you wrote sounds good to me - and is pretty much what I had in mind. Yes, I would like to have an area in OPB where all the plants I have created / or just added in the HASS integration are listed. If you need to change the structure in OPB for this - this is up to you - I'm perfectly fine with any technical solution this would require.

about the second part: Yes, my idea was, that you could access the sensors data of "your plants" from OPB. I know, that the Dashboard is based on Grafana... Right now, the integration does upload the sensors data to the plant - if it can be found in OPB ... and it should have a Unique ID... (Unfortunately, I can't show an example right now, because the graphana dashboard doesn't show anything for me right now...)

grafik

So my understanding is, that the "Plant Instant ID" is probably something like my personal token - If I have two coffee arabica installed in HASS - then, each would have it's own plant instant ID. The Dashboard-Link would then just use this ID - to have "direct access" to the 'correct' dashboard.

hope, that make sense how I tried to explain it?

slaxor505 commented 3 months ago

Thank you for explanation and suggestion. I've put this on roadmap and I'm planning to introduce this functionality in the future.