Hi ich würde gerne meinen Pflanzensensor auslesen, aber leider funktioniert die alte API, für die es hier im Forum ein Script gibt nicht mehr
Also wolle ich die neue API Version benutzt, aber habe keine Idee wie ich das hinbekomme
Koubachi Labs is the developer program of Koubachi that gives you access to our API. You can find further information about the available API calls under „Documentation“.
Please note that the API is in beta and therefore not stable yet. The API can change any time!
To access API calls you require an app_key and your user_credentials which you can find below.
Keep your user_credentials and app_key secure!
Authentication
API calls require authentication. It has to contain the user’s secret credential and the app_key, i.e., the request URL must contain the ‚user_credentials‘ property with the single access token as value. For example:
https://api.koubachi.com/v2/plants.json?user_credentials=<KEY eintragen>&app_key=<KEY eintragen>
Response Format
Each request has to explicitly define its desired response format. Currently we support JSON and XML, where the preference should be given to JSON (XML might be deprecated in the future). Specifying the response format is supported in two different ways:
HTTP Accept Header (preferred): set your HTTP Accept header to application/json
URL Extension: extend the resource by the requested format type. For example:
https://api.koubachi.com/v2/plants.json?user_credentials=<KEY eintragen>&app_key=<KEY eintragen>
Return Values & Error Messages
We use the mapping of HTTP error codes to Rails error codes as defined here. In addition to the status code, the server MAY also send a error messages with a detailed description of the error or exception. The format of this error messages depend on the requested Content-Type. For example, if the Content-Type is set to ‚application/xml‘, an error message might look like this:
<?xml version=„1.0“ encoding=„UTF-8“?>
<errors>
<error>Login has already been taken</error>
<error>Email can’t be blank</error>
</errors>
und wenn ich die URL im Browser ausführe kommt auch schön diese Antwort:
[{„plant“:{„created_at“:„2015-11-27T07:19:22+01:00“,„display_position“:6,„fertilizer_id“:null,„fertilizer_type“:null,„id“:299602,„last_fertilizer_at“:null,„last_mist_at“:null,„last_water_at“:null,„name“:„Pflanzi“,„next_fertilizer_at“:„2015-12-11T07:19:22+01:00“,„next_mist_at“:null,„next_water_at“:null,„note“:null,„plant_type_family_id“:911,„pot_color“:-1,„pot_shape“:2,„size“:2,„space“:0,„updated_at“:„2015-11-27T07:21:28+01:00“,„user_id“:173853,„wcd_calibration_checked_at“:null,„wcd_calibration_ended_at“:null,„wcd_calibration_started_at“:null,„zone_id“:null,„location“:„Ka“,„vdm_calibration_start_pending“:false,„vdm_calibration_check_pending“:false,„vdm_next_calibration_check_at“:null,„vdm_last_calibration_check_at“:null,„vdm_calibration_in_progress“:false,„vdm_last_water_source“:null,„vdm_water_pending“:false,„vdm_water_level“:0.48306169044852404,„vdm_precalibrated“:false,„vdm_water_cycle“:0.0,„vdm_water_instruction“:„Use lime-deficient (downcooled boiled) water. Water moderately to moisten the substrate. As soon as the first drops of water pour out of the drainage hole, stop watering and remove the excess water from the saucer.“,„vdm_water_analyzing_until“:„2015-11-29T11:56:15+00:00“,„vdm_mist_pending“:false,„vdm_mist_level“:0.0,„vdm_mist_instruction“:„This plant does not require misting.“,„vdm_fertilizer_pending“:false,„vdm_fertilizer_level“:0.9052283948977975,„vdm_fertilizer_instruction“:„Use Flower fertilizer (e.g. N8-P12-K6). Follow the instructions on the bottle. Water as usual.“,„vdm_temperature_pending“:false,„vdm_temperature_advice“:null,„vdm_temperature_level“:0.5686857111394735,„vdm_temperature_instruction“:null,„vdm_temperature_hint“:„Koubachi is analyzing the temperature.“,„vdm_temperature_analyzing_until“:„2015-12-01T10:51:09+00:00“,„vdm_light_pending“:false,„vdm_light_advice“:null,„vdm_light_level“:0.22249500151252474,„vdm_light_instruction“:null,„vdm_light_hint“:„Koubachi is analyzing the lighting conditions.“,„vdm_light_analyzing_until“:„2015-12-05T10:51:09+00:00“,„pot_color_hex“:„ffffff“,„has_smart_device_associated“:true,„plant_photos“:}}]
Wäre schön wenn mir jemand helfen könnte :rolleyes: