WIP: spaceapid: adjustments to 3d printer state sensors #8

Draft
dx wants to merge 1 commit from dx/nix-infra:3d-printer-state-part-2 into main
Member
  • Prefix sensor names with ext_ as the spec says we should use that for
    extensions (this also improves attribute access for tools that don't
    like fields starting with a number)
  • Rename printer state to printer busy state, to make it clearer.
  • Add ext_3d_printer_minutes_remaining sensors

Talked to @bendodroid and got some feedback to refine this

This is marked as WIP because it requires changes in home assistant:

  1. The last two steps that hit the REST endpoint to update 3d_printer_state should now hit ext_3d_printer_busy_state
  2. ext_3d_printer_minutes_remaining needs a new automation that triggers every minute when a printer is printing. The tricky part of this one is that we get the finish time in absolute time from the entity, and we want to turn that into relative time in minutes. I don't know how difficult this is, likely involves writing some pseudopython in the jinja value template.

The first change is a breaking change (of an unannounced feature that only i am using currently), but it is easy enough. If someone wants to do that for me, this can be merged and deployed.

The second one can stay as 0 until the next time I visit club and implement that. (Unless, of course, someone else wants to take that challenge)

- Prefix sensor names with ext_ as the spec says we should use that for extensions (this also improves attribute access for tools that don't like fields starting with a number) - Rename printer state to printer busy state, to make it clearer. - Add ext_3d_printer_minutes_remaining sensors ---- Talked to @bendodroid and got some feedback to refine this This is marked as WIP because it requires changes in home assistant: 1. The last two steps that hit the REST endpoint to update `3d_printer_state` should now hit `ext_3d_printer_busy_state` 2. `ext_3d_printer_minutes_remaining` needs a new automation that triggers every minute when a printer is printing. The tricky part of this one is that we get the finish time in absolute time from the entity, and we want to turn that into relative time in minutes. I don't know how difficult this is, likely involves writing some pseudopython in the jinja value template. The first change is a breaking change (of an unannounced feature that only i am using currently), but it is easy enough. If someone wants to do that for me, this can be merged and deployed. The second one can stay as 0 until the next time I visit club and implement that. (Unless, of course, someone else wants to take that challenge)
dx added 1 commit 2024-08-17 23:20:30 +02:00
- Prefix sensor names with ext_ as the spec says we should use that for
  extensions (this also improves attribute access for tools that don't
  like fields starting with a number)
- Rename printer state to printer busy state, to make it clearer.
- Add ext_3d_printer_minutes_remaining sensors
june approved these changes 2024-08-17 23:25:10 +02:00
june left a comment
Owner

Looks good!

Looks good!
Author
Member

Okay handling of time in templates is well documented and looks doable: https://www.home-assistant.io/docs/configuration/templating/#time

Okay handling of time in templates is well documented and looks doable: https://www.home-assistant.io/docs/configuration/templating/#time
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 3d-printer-state-part-2:dx-3d-printer-state-part-2
git checkout dx-3d-printer-state-part-2
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CCCHH/nix-infra#8
No description provided.