Hi,
unfortunately, despite reading several previous topics posted here, I do not really understand how the “value” variable works in value_templates.
I have configured the following browser_mod card as a service:
service: browser_mod.popup
data:
content:
type: custom:vacuum-card
entity: vacuum.valetudo_roborock
image: default
stats:
default:
- entity_id: sensor.valetudo_roborock_main_brush
value_template: "{{ (value | float(0) / 3600) | round(1) }}"
unit: hours
subtitle: Main brush
- entity_id: sensor.valetudo_roborock_right_brush
value_template: "{{ (value | float(0) / 3600) | round(1) }}"
unit: hours
subtitle: Right brush
- entity_id: sensor.valetudo_roborock_main_filter
value_template: "{{ (value | float(0) / 3600) | round(1) }}"
unit: hours
subtitle: Main filter
- entity_id: sensor.valetudo_roborock_sensor_cleaning
value_template: "{{ (value | float(0) / 3600) | round(1) }}"
unit: hours
subtitle: Sensors
cleaning:
- entity_id: sensor.valetudo_roborock_current_statistics_area
value_template: "{{ (value | float(0) / 3600) | round(1) }}"
subtitle: Cleaned Area
unit: m2
- entity_id: sensor.valetudo_roborock_current_statistics_time
value_template: "{{ (value | float(0) / 60) | round(1) }}"
unit: minutes
subtitle: Cleaning Time
shortcuts:
- name: Clean Selection
service: script.vacuum_clean_segments
icon: mdi:floor-plan
It worked well when I triggered it as a button from the GUI. Now I have moved the code to a script (for various reasons), but get the “UndefinedError: ‘value’ is undefined” error when I execute it.
What am I doing wrong?
Home Assistant version, browser_mod, cards etc are all up-to-date.
While trying to keep the post small, I hope I still posted all required information.