-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphs for sensors #30
Comments
i tried the esphome png library and its super slow. I don't know if theres any alternatives for jpg or bmp esphome/esphome#3255 you can get history from REST so we can try that. Decoding the REST might make the device lag for a second but it could work we might need to make our own graph by drawing points because the esphome graph just takes in a sensor |
Oh the ha rest api, nice idea - havent thought of that to be honest 👍 [edit] fix typo |
I played a bit with esphome's This works fine: but this fails with 401 - not authorized: - http_request.get:
url: 'http://<ip>:8123/api/history/period/2022-11-22T10:00:00+00:00?filter_entity_id=sensor.my_sensor'
headers:
Authorization: 'Bearer <token>'
Content-Type: application/json
verify_ssl: false
on_response:
then:
- logger.log:
format: 'Response status: %d'
args:
- status_code I'll play some more and when I get it to work I'm really curious to see the performance parsing a that json 😆 |
are you using a long lived access token? https://developers.home-assistant.io/docs/auth_api/#making-authenticated-requests |
Yes I am |
After poking through the esphome code to no avail I found the error - it was the token 🤦♂️ I somehow missed a character. After fixing the token it works fine.... |
nice! pics |
yeah I'm pretty much at the beginning so there aren't any pics yet - sorry 😞 I think I'll approach it like this:
|
this is really interesting |
oh yeah that's nice indeed. I agree, pulling the data from HA and visualizing it on device is the way to go. |
Is your feature request related to a problem? Please describe.
Sensors currently only show numeric values.
Describe the solution you'd like
By pressing the sensor menu item it could show a graph over the last x min/hours
Describe alternatives you've considered
Instead of drawing it could be a solution to receive a png (from HA) and display that. I wouldn't prefer showing pngs because it would require external configuration and I'm not sure it's possible with our device.
Additional context
I investigated a bit and it;s it pretty doable to show a graph. The tricky part is getting the data to show. Natively esphome only supports collecting values over a period of time and show them in a graph. But I would like to see a graph for a sensor even if I just turned on the remote (or return it from deep sleep). Maybe this could be resolved by having ha send an array of values on demand but it would mean external configuration. AFAIK ha doesn't support that natively.
The text was updated successfully, but these errors were encountered: