WLED Seek Tracker

That’s a cool project. Your tv room is very nice too.

1 Like

Hi,

really cool project.

I want to do this on my own and i’m facing two problems:

  1. sensor.chromecastremainingtime is not updated. Splitting the movie time in parts works well, but i didn’t get a value vor sensor.chromecastremainingtime

This is what my sensor.yaml looks like:

- platform: template
  sensors:
    chromecastremainingtime:
        friendly_name: "Chromecast Time Remaining"
        value_template: "{{ state_attr('media_player.wohnzimmer', 'media_duration') - (state_attr('media_player.wohnzimmer', 'media_position') + as_timestamp(now()) - as_timestamp(state_attr('media_player.wohnzimmer', 'media_position_updated_at'))) + ((as_timestamp((states.sensor.date_time_iso.state)) - as_timestamp((states.sensor.date_time_iso.state)))) }}"
  1. Where did you get entity_id and device_id from the wled for the automatation?

thanks in advance.

Hi,

For the automation i didnt use state but device. If you choose in the actions Device you can select your WLED device and then you get an option to change your preset to whatever is the corresponding preset for the trigger. This basically assighs the device ID.

For the sensor can you please check it under developer options? I see that you are using a chromecast from the entity name. If you put it on your dashboard, does it display the progress?

Are you using plex or something else which you stream to the chromecast?

You mean the device attributes?

These are displayed for media_player.wohnzimmer.

But the sensor.chromecastremainingtime stays unavailable.

What does as_timestamp((states.sensor.date_time_iso.state)) do?

I can’t find this sensor in the developer options. Maybe this causes the problem?

I use jellyfin and netflix for streaming.

This is taking into consideration the time that is passing.

On plex, you have attributes: media duration and media position, but those alone are not enough to calculate the remaining time of the media file. We needed to implement the time that is passing in order to calculate correctly. Does Netflix media player have media duration and media position attributes?

Yes, I’ve checked all attributes you are using.
They are all available.

Maybe the wrong format?

Can you post the code from the configuration file please, just for me to understand what you are using to calculate…

EDIT: now it occured to me… It can be the format as you are stating. If you don’t have the following to your configuration please add:

- platform: time_date
  display_options:
    - 'time'
    - 'date'
    - 'date_time'
    - 'date_time_utc'
    - 'date_time_iso'
    - 'time_date'
    - 'time_utc'
    - 'beat'

This should help the states.sensor.date_time_iso.state to calculate the time!

I’ve wrote this here.

EDIT: I might that’s the problem.

This is not configured.

I’m currently not at home, but i will check this in about two hours

Thanks, i edited by post above. If that fixes the problem i will add it to the first post so everybody will copy it from there.

Hi, did this fix the issue?

Thanks

Hi,

Yes, that was the solution!

Thanks a lot for your help and sorry for the last response.

One another question: I’ve done some research regarded this because i want to increase the segments.

Here is written, that on a esp32 32 segements should be possible. I’ve tried this with a esp32 wroom 32. Adding the segments works, but creating the presets leads into an unstable wled.

What are your experiences in this regard?

Did you ever tried adressing each single led out of home assistant?

According to the Documation of WLED could this be a solution for a smoother progress bar.

I have tried with an ESP8266 so for me the segments are 15 max. And even so, sometimes the automation throws errors in the log. There is a post in Home Assistant community but there was no solution: Error using light services with WLED device - #3 by michaelkrtikos

I didnt try the per-segment individual control but if you want to give it try it looks like a good solution. In regards to the smoothness, it depends on your needs. For me, the strip of 28 leds in total is small under my tv and because the light is diffused, i wouldnt see much of a difference if one led turns off. I use it more or less as an indicator of how long the movie goes.

I did this automation mostly for my wife who usually when watching a movie is getting sleepy and she usually asks “how long till the end?” :slight_smile:

To be honest, i wasnt aware of the per-segment individual control but it bothers me that in the documentation its written that its not persistant. In practice it may be ok though…

Same as me :smile:

I have a canvas with a base cabinet.

And my led strip is 2 m with 288 LEDs.

Therefore it would be nice to get a smoother progress bar.

Wow, then yes, because if you have 288 LEDs you are turning off about 20 LEDs each chunck of the movie and that’s a lot.

I can’t get enough of it, I would like to resolve my seek tracker more finely.

I found out that you can control individual leds via the JSON API.

The command is as follows:

curl -X POST "http://WLED-IP/json" -d '{"seg":{"i":[1,[255,0,0]]}}' -H "Content-Type: application/json"

This command is switching the first led to on.

But I have no idea how I could implement this in HA.

WLED also has the “Percent” effect, you can use the intensity slider to specify the % of the segment that is illuminated

I didn’t know that you are still working on it… To be honest, i didn’t furhter try and i am not sure if the below helping somehow but, i use Hyperion for Ambilight and i have a 3D TV. I have an automation that turns on the Hyperion instance when a movie starts but i wanted it to switch to 2D/3D based on the movie type.

Hyperion has as well an API that you can control it via HA and i did this the following way: In The configuration file i added:

# Ambilight 2D/3D  
rest_command:
  ambilight_2d:
    url: "http://hyperionIP:port/json-rpc"
    method: post
    content_type: "application/json"
    payload: '{"command":"videomode","videoMode":"2D"}'
  ambilight_3dsbs:
    url: "http://hyperionIP:port/json-rpc"
    method: post
    content_type: "application/json"
    payload: '{"command":"videomode","videoMode":"3DSBS"}'

Maybe you can change the payload with the command for the WLED API and try.

The above creates 2 entities in Home Assistant which i call from an automation like this:

While this might work by adjusting the curl command for each led, it will require you to enter 288 entities to your configuration file and if this is not enough, you will have to split the movie runtime to 288 parts and call them in an automation.

I think it is just too much…

You can also have a look in this post which seems similar to what you are trying to do: Execute CURL Command from an Automation