Beginner -HomeAssistant - Octoprint: Time remaining convert from seconds to HH:MM or anything more readable

Hey guys. Before I go into detail I need to be really clear I’m very beginner with HA so I’m going to need help from start to finish or at least to be pointed in the direction of what I need to go and learn before I can pull this off.

I’ve successfully added octoprint to HA. I can monitor my prints’ status and view the webcam in a picture glance. But the time elapsed and time remaining are in seconds and constantly converting them in my head to minutes and hours is a pain in the nuts because they can be 15h prints.

There’s nothing in the documentation for HA’s octopi that seems to help. The topics I’ve found on here that already exist about it seem to assume that the person already knows how to use template sensors. So far I’ve tried to chop in pieces of code that have been suggested into my configuration.yaml changing my printer name. So far nothing has worked. No new sensor is created and the existing time elapsed and remaining do not change. I’ve never touched template sensors before so I’m not sure how they’re meant to work. But my quick bit of research to try get my head around it seems to suggest that they’re a fairly advanced feature of HA and will take a lot more understanding before I get to grips with it.

If someone can easily tell me step by step how to change the time format I’d be very grateful. Or if it’s like asking someone to tell you how to be able to speak mandarin, even just some pointers on what I need to learn to achieve this would be great.

Thanks peeps!

Edit: I’ve since managed to get this working. I can’t seem to delete the thread. If anyone comes across this and wants a complete how to for getting this working as there are a few pittfalls that will prevent it from working, let me know. Otherwise I’ll just leave this here to get archived.

2 Likes

Hi!

Also a beginner should be able to search a forum? Or google? It is all over the place…
Read “how to ask a question”.

This is not an octoprint question but a home assistant one. You will need to to use a template converter.

this is mine:

      octoprint_time_elapsed_friendly:
        friendly_name: "Octoprint Time Elapsed"
        value_template: "{{ states('sensor.ender3pro_time_elapsed') | int | timestamp_custom('%H:%M:%S', 0) }}"
      octoprint_time_remaining_friendly:
        friendly_name: "Octoprint Time Remaining"    
        value_template: "{{ states('sensor.ender3pro_time_remaining') | int | timestamp_custom('%H:%M:%S', 0) }}"
      octoprint_time_finished_calculated:
        friendly_name: "Octoprint Time Finished"
        value_template: "{{ (states('sensor.ender3pro_time_remaining') | float + now().timestamp()+7200 | int) | timestamp_custom('%H:%M:%S', 0) }}"

i’ve probably spent 4 or 5 hours searching through this forum and google search results attempting to apply what people are saying to my config.yaml file with no success. I think you didn’t read my question. Your answer is about the same as I’ve seen in other answers. A snippet of code without any description of where it should go or what effect it should have. Should this go below ‘octoprint:’ in the in configuration.yaml? Should it be below sensor: - platform: template etc? Should it affect the time elapsed in sensor.3d_printer_time_elapsed? Or should it create a new sensor ‘octoprint_time_elapsed_friendly’?

Honestly man if you can’t or aren’t bothered to actually answer the question asked why respond at all? I mean I’ve been about as up front as I can be that I’m clueless what I’m doing here. I welcome someone saying ‘you need to do a lot of reading on such and such topic to be able to do this’. You just seem kind of arrogant.

3 Likes

If homeassistant is too difficult… then you shouldn’t use it?

Have you read my answer?

Put it below

sensors:
  - platform: template
    sensors:

Oh, and don’t call me arrogant please, I am just a volunteer like all others here. I am trying to help. Please read the section “how to ask a question”. I haven’t seen what you did yourself in your initial post. You just write like you are asking something to a service desk or something, this is a forum of and for users…

Oh number 2:
4 or 5 hours??? From your profile total:

Posted 13 mins ago

Joined Jul 8

Read 3h (2h recently)

Maybe you should learn to ask a question…

If home assistant is too difficult maybe don’t use it…

Giving an example with no context in a question that explicitly states it needs start to finish help or just pointers to where to get info if that’s asking too much.

You’re like an elitist who thinks they’re above someone else who’s struggling.

2 Likes

Goodluck, this was my last post on this topic.

1 Like

I’ve since managed to get this working. I can’t seem to delete the thread. If anyone comes across this and wants a complete how to for getting this working as there are a few pittfalls that will prevent it from working, let me know. Otherwise I’ll just leave this here to get archived.

2 Likes

Hello !

I’m in the same situation as you
so I humbly ask you to share the path you have taken.
small additional parameter I do not speak English I use Google Translate.

Sincerely Pierre

Hey Pierre, my HomeAssistance sd card corrupted so I stopped using it for a while. Just got it up and running again so I’m back. I see your comment is 2 weeks old so not sure if you still need help but if you do let me know.

always need help if possible

1 Like

Is this still an issue for you? Sender had the correct info but his personality got in the way.