Share your HADashboard setups

hey cee, give a try on that in the javascript

    if ("state_text" in self.parameters && self.parameters.state_text == 2)
    {
        datetimestr = self.full_state["last_changed"]
		time = new Date(datetimestr).toLocaleTimeString();
		timestr = "since:" + time;		
		
        self.set_field(self, "state_text", self.map_state(self,timestr))
    }
2 Likes

Thank you for giving this a try @Stiff04

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,

new%20motion%20trigger

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.

Hey Cee

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

1 Like

thank you @Stiff04 I will see if I can make head or tail of it, unfortunately programming was never my strong point, always a hardware guy instead.

I am guessing the way the the custom UI in HA does it, is different to the way AD would do it ?

yeah its different in HA because thats not javascript :wink:

what would you EXACTLY like to see?

1 Like

Sorry maybe I didn’t explain it properly, in HA i have this “x time since last triggered”

time%20since%20last

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,

Many thanks in advance @ReneTode

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)

1 Like

Well if you are having trouble thinking of a solution, then I have no chance :smiley: 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.

1 Like

Thanks , @jpez for sharing this , you Rock!!!

Hey all I would like to ask you for a new little support :slight_smile:

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 :slight_smile: What do you think?

second I like to have an enhanced cover widget with the three controlls (Up, Stop, Down)

@ReneTode do you have an Idea?

best regards

I would say I am 90% happy with this page of my HADashboard setup :smiley:

8 Likes

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.

Is there a way to leave a blank space in a column. I get that you can skip rows but I am struggling to skip a column space.

yup, its in the docs.

to make an unfilled widget you use “spacer”

and please next time dont just put your question anywhere, because this has nothing to do with the topic :wink:

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.

no problem.
if it is dashboard related and you cant find it in the docs, you also can ask me through PM.

1 Like

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 !

Will the basegooglemap work with google geocode api key?

@mviamin: The album cover i figured out from another thread on this forum. I believe this is the thread: Using media_player entity_picture

Essentially, you need to create a camera entity in home assistant, something like this:

camera:
  - platform: generic
    name: spotify_album_cover
    still_image_url: http://[ip]:8123{{ states.media_player.spotify.attributes.entity_picture }}

Then, you reference that entity in your .dash file:

spotify_album_cover:
  widget_type: camera
  entity_picture: http://[ip]:8123/api/camera_proxy/camera.spotify_album_cover?{{ states.camera.spotify_album_cover.attributes.access_token }}&api_password=[api password here]
  refresh: 10

I can’t remember the exact details but they’ll be covered in that thread~