xman111
(Craig)
November 23, 2025, 12:43am
1
Hey guys, trying to follow a config i saw on the internet. Its a sensor to tell when a 3d print will end. I am getting line 110: expected dictionary for dictionary value ‘sensors’ error and cannot figure it out.
# P1S time to finish print job
- platform: template
sensors:
p1s_finish:
friendly_name: p1s_finish_time
icon: mdi:clock-end
state: >
{% set remaining = states('sensor.p1s_remaining_time') | float(0) %}
{% if remaining > 0 %}
{{ (now() + timedelta(hours=remaining)).strftime('%I:%M %p') }}
{% else %}
"N/A"
{% endif %}
finity
November 23, 2025, 1:22am
2
You’re mixing old and new sensor yaml configs.
if you want to stick to the legacy template format change “state:” to “value_template:” and “icon:” to “icon_template:”.
# P1S time to finish print job
- platform: template
sensors:
p1s_finish:
friendly_name: p1s_finish_time
icon_template: mdi:clock-end # I think this should work
value_template: >
{% set remaining = states('sensor.p1s_remaining_time') | float(0) %}
{% if remaining > 0 %}
{{ (now() + timedelta(hours=remaining)).strftime('%I:%M %p') }}
{% else %}
"N/A"
{% endif %}
xman111
(Craig)
November 23, 2025, 1:44am
3
thanks so much, that was it, really appreciate your help!
1 Like
xman111
(Craig)
November 23, 2025, 4:44pm
4
just as a follow-up, when the printer is not in use, it says “N/A”. is there any way to get rid of that?