I have just got back from 4 days of work, so super tired, I just cut and paste the lines of code over the other, but now I am getting this instead,
Not sure if I messed up something somewhere. Got to see what I can, but as I said, super tired, so will probably just go to bed and try again in the morning.
due to perfomrmance Issues I cant recommend to calculate back in running time.
Additionally you will have to refresh the dashboard to recalculate the time.
But here you will find how to calculate the time difference
Sorry maybe I didn’t explain it properly, in HA i have this “x time since last triggered”
So the 2 minutes ago, 10 hours ago, etc.
Was wondering if it was possible to have the same thing on the sensor’s on HADashboard, so it would look something like this really quick photoshop I just did,
that would be hard to do, because you have to update the widget based on time and now its only updated if something in the entity has changed.
that would need an invisible clock widget inside each widget or some general javascript that would compare the stuf (in theory possible inside a custom skin)
Well if you are having trouble thinking of a solution, then I have no chance It wouldn’t necessarily need to be updated constantly, as you could have the dashboard on a reload through fully kiosk, so it would just updated every 10 minutes or so, I just think it looks nicer on the eye that way, rather than just a time.
if you have the idea that the reload moment would be sufficient.
but then it would be bad to have seconds ago and minutes ago, because if it shows 2 minutes ago and it keeps that for 10 minutes it will be highly inaccurate.
i would then suggest like
< 1 hour
1 hour
2 hours
3 hours
23 hours
1 day
2 days
i am not that experienced in JS at all as i like to be.
the function would be something like:
if ("state_text" in self.parameters && self.parameters.state_text == 2)
{
datetimestr = self.full_state["last_changed"]
time = new Date(datetimestr);
now = new Date()
difference = now - time
if (difference<3600){
str = "< 1 hour"
}
elif (difference < (3600 * 24){
calculate the hour from difference
str = hour + " hours"
}
self.set_field(self, "state_text", self.map_state(self,str))
}
and for days the same. maybe that @Stiff04 can come up with something more complete in a short time.
Hey all I would like to ask you for a new little support
I’m looking for a widget like the climate control with + and - (slider does not work good on my wall mounted tablet) to control the lights bright of my rf controlled lights. So I’m looking for an Option to switch on and off the light and controll brightness with +&- in a single widget What do you think?
second I like to have an enhanced cover widget with the three controlls (Up, Stop, Down)
the lights were with + and - before and that is replaced.
i think that there is no widget anymore where you can control the lights that way, so it would need to be a custom widget.
in the github history it should be possible to find the files from before the change and use that as custom widget.
for your cover widget you could use an input_select with those 3 options.
in HA you would need to create an input_select and automations or scenes that get triggered by the input_select.
Sorry. I was trying to search for this in the doc but couldn’t find it. I guess I was searching for the wrong thing. I try not to post randomly but I was looking through the images here and saw empty spaces so I figured someone in here knew how to do it. I will do better next time.
Hi jpez, curious how you got the artwork out of the spotify media player. your album cover entity is [redacted] :). It is somewhere since HA pulls it, but i tried “camera” with media_player.spotify and get nothing…thanks !