Hi All,
I have a Maytronics Dolphin Active X6 pool robot cleaner and I’m using the MyDolphin Plus integration. The integration presents me with a nice little card:
I want to present this cycle time left (time remaining) in my dynamic dashboard, however using the following code:
- entity: vacuum.roger
attribute: message
type: custom:secondaryinfo-entity-row
secondary_info: |-
<i><style='color:gray'>[[
sensor.roger_cycle_time_left ]]m remaining</i>
But the time doesn’t come up how I want it to (ideally, it would say 1hr 24m remaining ) – see how it looks at the moment:
Really appreciate any help.
Thanks
WallyR
(Wally)
February 5, 2024, 1:34am
2
use |timestamp_custom('%H:%M')
Thank you.
Where exactly do I put that? I tried this and it didn’t work, sorry.
- entity: vacuum.roger
attribute: message
type: custom:secondaryinfo-entity-row
secondary_info: |-
<i><style='color:gray'>[[
sensor.roger_cycle_time_left |timestamp_custom('%H:%M')]]m remaining</i>
It says Template Matching Failed
WallyR
(Wally)
February 5, 2024, 3:18am
6
Try this.
secondary_info: |-
<i><style='color:gray'>{{
states('sensor.roger_cycle_time_left') |int|timestamp_custom('%H:%M') }}m remaining</i>
We are SO close!
Its just making 1 hr report as 11hrs
Grateful for your help
WallyR
(Wally)
February 5, 2024, 7:22pm
8
Can you please post the output from the states tab in the developer tools and the screenshot above from close to each other in time.
I need to see what the number looks like in the developer tools to figure out what is actually being reported.
This is what my dashboard currently says, using the following code:
- entity: vacuum.roger
attribute: message
type: custom:secondaryinfo-entity-row
secondary_info: |-
<i><style='color:gray'>{{
states('sensor.roger_cycle_time_left') |int|timestamp_custom('%H:%M') }} remaining</i>
And then this is the corresponding dev tool state:
State: 5224.391271
state_class: measurement
start_time: “2024-02-07T19:42:40”
expected_end_time: “2024-02-07T21:12:40”
unit_of_measurement: s
device_class: duration
icon: mdi:clock-time-one
friendly_name: Roger Cycle Time Left
WallyR
(Wally)
February 7, 2024, 9:15am
10
Ok it is not a timestamp as such.
{{- ((states('sensor.roger_cycle_time_left')|float(0))/3600)|int -}}:
{%- if ((states('sensor.roger_cycle_time_left')|float(0))%3600/60<10) -%}
0
{%- endif -%}
{{- ((states('sensor.roger_cycle_time_left')|float(0))%3600/60)|int -}}
Thank you!
Perfect, down to the minute.
Any idea why I cannot add another sensor that shows me the cleaning mode?
I just added it above your code:
- entity: vacuum.roger
attribute: message
type: custom:secondaryinfo-entity-row
secondary_info: >-
<i><style='color:gray'> Mode: [[ sensor.roger_s_mode ]] <br>
{{- ((states('sensor.roger_cycle_time_left')|float(0))/3600)|int -}}h: {%-
if ((states('sensor.roger_cycle_time_left')|float(0))%3600/60<10) -%}
0
{%- endif -%} {{-
((states('sensor.roger_cycle_time_left')|float(0))%3600/60)|int -}}m
remaining</i>
WallyR
(Wally)
February 7, 2024, 11:39am
12
The use of [[ indicate a template mode.
I have no idea how that works.
I prefer to use {{ states('sensor…