feat: adds Moonraker sensor charts#1885
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds charting for Moonraker “Sensors” by loading historical measurements from Moonraker and appending live numeric sensor updates into per-sensor chart stores, then rendering those charts in the Sensors widget UI.
Changes:
- Add Moonraker sensor measurement typings and a new
server.sensors.measurementssocket action. - Initialize and maintain per-sensor chart stores (
sensor:<id>) from historical measurements + live sensor updates. - Update Sensors widget UI to show expandable panels with charts per numeric field (with “No data” fallback text).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/typings/moonraker.sensor.d.ts | Adds typings for sensor measurement history payload. |
| src/store/sensors/actions.ts | Requests initial sensor measurements; streams live sensor updates into chart helper. |
| src/store/charts/mutations.ts | Adds mutation to initialize a per-sensor chart store. |
| src/store/charts/actions.ts | Adds action to build per-sensor chart data from Moonraker measurement history. |
| src/store/chart_helpers.ts | Adds helper to append numeric sensor updates into chart series. |
| src/locales/en.yaml | Adds app.general.label.no_data string. |
| src/components/widgets/sensors/Sensors.vue | Reworks sensor display into expansion panels and renders charts per numeric field. |
| src/components/widgets/sensors/SensorChart.vue | New chart component for a single sensor field. |
| src/api/socketActions.ts | Adds serverSensorsMeasurements() calling server.sensors.measurements. |
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
|
Thank you @mike00107, that's perfect feedback and helps me testing this!
Fluidd will now remember what section were expanded so it starts the same way when you reload the page.
I've now implemented some changes touching these 2 items to improve the chart max and min (max is now padded, min always shows 0 in the bottom of the chart, or goes negative when there are actually negative values) |
No saying it is impossible, but layout is quite tricky and can easily break (as I've seen a few times before). The fact that we allow 2 to 4 columns in Fluidd makes layout always very fiddly to changes...
I get your point, but this is not Grafana nor will we ever get to that level! 🤣 |
|
Ahh, I suspected it had something to do with the layout preset. Thank you for clarifying. As for average I can calculate that anyway in moonraker and add an extra graph! |
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
|
@mike00107 I've refactored most of the code here as I noticed the graph was missing a lot of data points. If you are able to pull the latest and give it a test, I would really appreciate it! 😁 |
|
I saw the notifications, will try tomorrow! |
Sensor update interval causes misleading tooltip timestamps@pedrolamas I just pulled the latest code and noticed one (issue?) with the graph tooltip. One important detail I forgot to mention earlier: my sensor only reports a new value every 15 seconds. Currently, when hovering over the graph, the tooltip shows a timestamp and value for the exact hover position. This makes it look like there is new sensor data at that timestamp, even though the sensor can only provide a new reading every 15 seconds. For example, in the video the tooltip shows a value at a specific time such as Expected behaviorI would expect the graph/tooltip to better reflect the actual reported sensor values. For example:
The last example image is closer to what I expected: a graph based on the actual reported samples, without implying intermediate readings between sensor updates. Possible improvementMaybe showing timestamps on the graph, similar to the Thermals tab, could also help make this clearer. That said, this would only be useful if it does not clutter the Sensors tab too much. Main concernThe current hover behavior makes it look like the sensor is reporting more frequently than it actually is. For low-frequency sensors, this can be misleading because the tooltip appears to show values at times where no real sensor update happened. Image of current situation (after pull)
Video of current behaviourRecording.2026-06-23.090412.mp4Expected behaviour of what is logical to me
As always. Please correct me if there is something that i mentioned which is not doable or in the scope of Fluidd. Thank you for maintaining Fluidd and adding this new feature! |
Full page reload causes data to be lostWhen i reload the brouwer it causes the graph to go empty and start from the beginning. |
|
Thank you for your comments and review, @mike00107. I've made some decisions here considering how Fluidd works, how Moonraker stores and reports the data, and how these sensors work. Starting by the sensors, I have a couple of sensors myself and noticed a similar behavior to yours, where it will only report the value if there is an actual change, or after a long period. This can easily lead to measurement errors but that is something that Moonraker or upstream devices would have to fix, so I will skip that issue altogether. Then there is how Moonraker stores sensor history once the services starts: it will record every second, no matter if the sensor has reported a value or not - so it will just use the last known value as the current one and move on. This behavior led to an issue because when it starts, Moonraker doesn't actually have a known value for the sensor and thus records as Given this, I decided not to load the historical data from Moonraker to avoid this situation, and to use the same approach as to sensor data recording (use the last known value on the chart) and record a data point every second. I will see if there is anything we can do from Fluidd side to mitigate this, but truth is that all the charts around Fluidd are using this approach (use last known value from heater/fan/sensor/etc. when recording new data point for chart) |
|
Thank you for clarifying! |






Adds Moonraker sensor charts showing history data from Moonraker.
Screenshots
Resolves #1883