I am trying to develop a service that retrieves data from devices of this brand.
Once the information is retrieved from the account and the devices, I want to retrieve all the historical measurement data.
I create feature_states for each measurement by defining the created_date and the updated_date, but after saving, these 2 dates are forced to the current date and not to what I defined.
In this service, I start by requesting the information to connect the user’s Withings account (via OAuth2).
Once the connection is validated, I retrieve the account information to create the existing devices in this account (scale, watch, etc.) and I create the associated features (battery, weight, pulse, etc.). I also retrieve the history of existing measurements, and I would like to record these measurements (with their actual creation dates) to have the history in Gladys and allow display in the form of a curve, for example.
Once all this is done, I want to set up a poll to retrieve new measurements once a day. In my case, it is not the time when Gladys retrieves the measurements that counts, but the creation date of the measurement by the device on the Withings account.
I’ve made significant progress on this development. I’ve just pushed a nearly final version of the PR [WIP] Withings.
This integration allows:
Connecting to the Withings account
A generic API (server & front) to connect to OAuth2 services (to be confirmed on other integrations)
Automatic creation of Withings devices
Retrieving device measurements
Displaying a ‹ Health › box in the dashboard similar to the DeviceInRoom box
The remaining tasks to consider the integration correct are:
Integration documentation (in progress)
Adding a configuration for the demo site
Code review if possible and taking into account the remarks
[Optional] Testing the integration by volunteers with more devices (the integration should work for all Withings devices, but I only have one for now)
Ideally, for a next version, I would have liked to display a box on the dashboard in the form of a line graph. Are there components already planned to display the history of data?
Great all that! Thanks @euguuu
By any chance would it be possible to display a historical weight curve? Which is generally the whole interest of a connected scale. To be set as desired: 1 week / 1 month / 1 year.
I think this is more something we want in general for Gladys, not just for this service. So I don’t think it’s necessary to develop this in the service.
Great! Well, as I don’t understand how Gladys is built, I didn’t think we could create a « history » tool and use it on all the sensors we want. Thanks for the info!
Is there any development ongoing at this display level? Have there already been decisions made about the technology to use or the architecture to implement, or do we need to start from scratch?
There is no development currently underway. We discussed this in the other topic, which is just a « to-do » list, but overall, everything needs to be done: choosing the chart library and development
Hello everyone,
I’m bringing up the topic again. @euguuu is nearing the end of development, the PR is under review, so we are looking for volunteers to test/validate the service, preferably with hardware.
The associated documentation describes each page of the service step by step. I can do a demo if needed or provide my Withings codes (corresponds to OAuth2 as I can delete/change them with one click after testing).
I have only tested in real conditions with one device (the Body scale), but in theory, the service is compatible with all devices of the brand.
The service automatically creates devices based on those declared on the Withings profile, retrieves the history of measurements, and then performs a daily poll to retrieve new measurements.
In terms of measurement usage, there is a box similar to the device in-room box but which only retrieves features of the ‹ health › category.