Some entities have been removed in Home Assistant 2021.11
https://github.com/dangreco/threedy/blob/de1be7a961ce47e161d9d0c7b79ea7d35716cfe2/src/Components/Stats/utils.tsx#L56-L84
See breaking changes in the PR https://github.com/home-assistant/core/pull/58040
Had to remove the following monitors from my card to have it working again
- ETA
- Elapsed
- Remaining
Hi, got the same issue, creating two template sensors temporarily patches the issue
- name: OctoPrint Time Elapsed
unit_of_measurement: 's'
availability: >
{{ not is_state('sensor.octoprint_start_time', 'unavailable') }}
state: >
{% set start = as_timestamp(states('sensor.octoprint_start_time')) %}
{% if is_number(start) %}
{{ (as_timestamp(now()) - start) | int }}
{% else %}
unknown
{% endif %}
attributes:
start_time: "states('sensor.octoprint_start_time')"
- name: OctoPrint Time Remaining
unit_of_measurement: 's'
availability: >
{{ not is_state('sensor.octoprint_estimated_finish_time', 'unavailable') }}
state: >
{% set finish = as_timestamp(states('sensor.octoprint_estimated_finish_time')) %}
{% if is_number(finish) %}
{{ (finish - as_timestamp(now())) | int }}
{% else %}
unknown
{% endif %}
attributes:
start_time: "states('sensor.octoprint_estimated_finish_time')"
For some reason I have an issue formatting this code in here :'(
EDIT: Thanks @0rax, with your example, I've been able to format mine correctly :)
Thanks @SupremeSports, worked like a charm.
Here is a formatted version of the sensors:
template:
- sensor:
- name: "OctoPrint Time Elapsed"
unit_of_measurement: 's'
availability: >
{{ not is_state('sensor.octoprint_start_time', 'unavailable') }}
state: >
{% set start = as_timestamp(states('sensor.octoprint_start_time')) %}
{% if is_number(start) %}
{{ (as_timestamp(now()) - start) | int }}
{% else %}
unknown
{% endif %}
attributes:
start_time: "states('sensor.octoprint_start_time')"
- name: "OctoPrint Time Remaining"
unit_of_measurement: 's'
availability: >
{{ not is_state('sensor.octoprint_estimated_finish_time', 'unavailable') }}
state: >
{% set finish = as_timestamp(states('sensor.octoprint_estimated_finish_time')) %}
{% if is_number(finish) %}
{{ (finish - as_timestamp(now())) | int }}
{% else %}
unknown
{% endif %}
attributes:
start_time: "states('sensor.octoprint_estimated_finish_time')"
Similar issues. Although these entities are present in the Octoprint integration (via UI) they must be different to what this card looks for. If any of these are added it kills the whole lovelace page. ETA Elapsed Remaining
Can use a template like listed in other posts, but this is a bit of a messy work around
Can use a template like listed in other posts, but this is a bit of a messy work around
I created this workaround as a, hopefully, temporary measure 👍
Unfortunately, it appears that development on this project has stalled.
Hi, got the same issue, creating two template sensors temporarily patches the issue
- name: OctoPrint Time Remaining unit_of_measurement: 's' availability: > {{ not is_state('sensor.octoprint_estimated_finish_time', 'unavailable') }} state: > {% set finish = as_timestamp(states('sensor.octoprint_estimated_finish_time')) %} {% if is_number(finish) %} {{ (finish - as_timestamp(now())) | int }} {% else %} unknown {% endif %} attributes: start_time: "states('sensor.octoprint_estimated_finish_time')"
Shouldn't the second attribute (for "OctoPrint Time Remaining" be something like "estimated_finish_time" rather than "start_time"?
Unfortunately for me, this solution doesn't work in my use case. What I want to do is send a notification on end-of-print, but with the condition that the elapsed time for the finished print was more than 15 minutes. Previously, elapsed time was available after the print had finished, but now it appears to be "unavailable". Is there a way I can access the elapsed time similarly to percentage complete and other values?
Hi trying to make this workaround but I find some issues. I defined the sensor above like @0rax reported but don't understand how to recall it on the threedy card (if I have too?). If I tick one of the ETA Elapsed Remaining on the card, error appears. How did you do? thanks
I thought all the "sensors" were generated by Home Assistant and the integration. Threedy only displays the sensors that are available.
A sensor that is unavailable would be an issue with the Octoprint Integration rather than with Threedy as far as I can tell.
The Integration within the UI Exposes 10 entities as far as I can see. Actual Bed Temp, Actual Tool Temp, Current State, Estimated Finish Time, Job Percentage, Printing, Printing Error, Start Time, Target Bed Temp, Target Tool Temp.
Elapsed Time sensor is not generated any longer.
You could use a template to work out elapsed time based on Start Time and current time and make that an Elapsed Time sensor. I am not good enough with templating in HA to give you the code though.
Template code is given in previous comments... https://github.com/dangreco/threedy/issues/43#issuecomment-962372145
Yes I copied the one formatted from @0rax but right now the threedy card with ETA, Elapsed and Remaining reports errors (these entities are not defined):
template:
- sensor:
- name: "OctoPrint Time Elapsed" unit_of_measurement: 's' availability: > {{ not is_state('sensor.octoprint_start_time', 'unavailable') }} state: > {% set start = as_timestamp(states('sensor.octoprint_start_time')) %} {% if is_number(start) %} {{ (as_timestamp(now()) - start) | int }} {% else %} unknown {% endif %} attributes: start_time: "states('sensor.octoprint_start_time')"
- name: "OctoPrint Time Remaining" unit_of_measurement: 's' availability: > {{ not is_state('sensor.octoprint_estimated_finish_time', 'unavailable') }} state: > {% set finish = as_timestamp(states('sensor.octoprint_estimated_finish_time')) %} {% if is_number(finish) %} {{ (finish - as_timestamp(now())) | int }} {% else %} unknown {% endif %} attributes: start_time: "states('sensor.octoprint_estimated_finish_time')"
I defined them into sensor but how can I re-call it inside the threedy card?
Hey guys, could someone help me? I defined those sensors but I can't say them into my sensors and I didn't understand how to re-call them into the card definition. Could you explain me? thanks
Hey guys, could someone help me? I defined those sensors but I can't say them into my sensors and I didn't understand how to re-call them into the card definition. Could you explain me? thanks
When you create those sensors in template, they will be created as sensor.template_octoprint_time_elapsed and sensor.template_octoprint_time_remaining, you have to edit them and remove the template_ part from the entity_id.
Nothing else is needed as the card is looking for those 2 sensors with correct names
Maybe somebody can fix this in the integration ?
:-)
Hi... just wanna leave this update for everybody in case it will need. I finally got the sensors and everything is working well again. My problem is that I have multiple printers. Basically, the goal is to create two sensor like @SupremeSports made and @0rax formatted cause the threedy addon search and report those sensor in its section "time elapsed" and "time remaining". With just a printer is more simple and you should get it right from the box, but in case of multiple printers you need to pay attention of printer name. To get the name of the printer, add the threedy card on a dashboard and select the printer. Then check the yaml text, threedy report printer name, in my case octoprint 1. Well the sensor you have to create are:
template:
- sensor:
- name: "OctoPrint 1 Time Elapsed" unit_of_measurement: 's' availability: > {{ not is_state('sensor.octoprint_1_start_time', 'unavailable') }} state: > {% set start = as_timestamp(states('sensor.octoprint_1_start_time')) %} {% if is_number(start) %} {{ (as_timestamp(now()) - start) | int }} {% else %} unknown {% endif %} attributes: start_time: "states('sensor.octoprint_1_start_time')"
- name: "OctoPrint 1 Time Remaining" unit_of_measurement: 's' availability: > {{ not is_state('sensor.octoprint_1_estimated_finish_time', 'unavailable') }} state: > {% set finish = as_timestamp(states('sensor.octoprint_1_estimated_finish_time')) %} {% if is_number(finish) %} {{ (finish - as_timestamp(now())) | int }} {% else %} unknown {% endif %} attributes: start_time: "states('sensor.octoprint_1_estimated_finish_time')"
Reboot Home assistant and you should find two sensors called: sensor.octoprint_1_time_elapsed and sensor.octoprint_1_time_remaining, which are exactly the sensors threedy addon need. Hope this will help someone! :)
Thanks guys. This works just fine.
I've created a fork of this repo and fixed some issues like the state undefined stuff, check it out here: https://github.com/e11en/ha-threedy-card