resoai
(Alexey)
July 17, 2018, 9:32pm
534
You have forgotten to add unit: 'min'
to each list item to display “min”, as for formatting, we have filter which be defined as a function:
filter: function (value) {return Math.round(value)},
Please read through our README and Wiki for more information.
k1282
July 17, 2018, 11:14pm
535
hi,
i tried the math.round approach as well but it didnt help. the formatting of the duration number stays the same…
i applied as follows:
title: ‘Home to Airport’,
icon: ‘mdi-airplane’,
value: ‘&sensor.home_to_airport.attributes.duration’,
filter: function (value) {return Math.round(value)},
unit: ‘min’
the unit topic has been fixed though.
resoai
(Alexey)
July 17, 2018, 11:23pm
536
How about this:
value: function () {
return Math.round(this.states['home_to_airport'].attributes.duration);
},
k1282
July 17, 2018, 11:31pm
537
using your approach ended up only returning “min” and not showing any number at all.
the code now looks as follows:
title: 'Home to Airport',
icon: 'mdi-airplane',
value: function () {return Math.round(this.states['home_to_airport'].attributes.duration);},
unit: 'min'
resoai
(Alexey)
July 17, 2018, 11:34pm
538
Sorry, I made a mistake since I’m typing from my phone:
value: function () {
return Math.round(this.states['sensor.home_to_airport'].attributes.duration);
},
1 Like
k1282
July 17, 2018, 11:35pm
539
your phone skills were good enough
it now works. thanks a lot!
1 Like
resoai
(Alexey)
July 17, 2018, 11:37pm
540
If I’m not mistaken, this could also work like this:
value: function (value) {
return Math.round(value);
},
Can you share that background image?
To save some screen estate, I’d like to configure a sensor tile that switches between temperature and humidity. Or between the temperature of two different sensors.
Is this possible?
resoai
(Alexey)
July 18, 2018, 8:28am
543
You can have temperature as a value and humidity as state (top right).
1 Like
Thanks, @resoai . This seems to be a decent workaround for what I am trying to achieve, yet a tile that slides between the different views would be visually more appealing to me. Plus, you wouldn’t be limited to just two different things. Any chance you might consider this in the future?
resoai
(Alexey)
July 18, 2018, 8:38am
546
In all fairness, humidity is secondary data and state is the perfect place for it. I’m not sure we need to complicate things with the reverse side of the tiles as this would make things even more complicated for people. You could probably use the anonymous function with timeout and swap between two values in the sensor.
k1282
July 18, 2018, 9:25am
547
Hi Nilskilz,
how did you realize the time and date info on the top right corner of your screenshot? i need exactly the same…
Nilskilz
(Rob Stokes)
July 18, 2018, 9:46am
549
I edited the index.html and css manually for that.
However, I believe the projects been updated and you can now do this in the config…
Have a look here
1 Like
Is it possible to only show the status of an input boolean and not toggle it?
{
position: [1, 2],
width: 1,
type: TYPES.SENSOR_ICON,
title: 'Laundry',
classes: [CLASS_BIG],
type: TYPES.INPUT_BOOLEAN,
id: 'input_boolean.laundry',
states: {
on: "On",
off: "Off",
},
icons: {
on: 'mdi-washing-machine',
off: 'mdi-washing-machine',
},
},
cgarwood
(Charles Garwood)
July 19, 2018, 1:55am
551
You have type: TYPES.INPUT_BOOLEAN and type: TYPES.SENSOR_ICON set currently.
If you use TYPES.SENSOR or TYPES.SENSOR_ICON it should show the value without toggling it on click.
Is it possible to show/hide pages and/or tiles and/or groups based on automations/states from home assistant?