Effortless Timer Automation for Recording Sessions

Hey everyone! I wanted to share a neat setup I created to automate recording sessions using my Broadlink RM4 Pro and Cloner Alliance. It’s been a game-changer for me, especially when I’m juggling multiple tasks and can’t always be by the controls. Let me walk you through how I did it!

First, I set up a timer script that allows me to input the exact duration I need for my recording. This was a bit of a learning curve, but I figured it out by tweaking some variables and using input numbers for hours and minutes. The script looks like this:

alias: Custom TV Timer
sequence:

  • variables:
    timer_hours: “{{ states(‘input_number.timer_hours’) | int(default=0) }}”
    timer_minutes: “{{ states(‘input_number.timer_minutes’) | int(default=0) }}”
    total_seconds: “{{ (timer_hours * 3600) + (timer_minutes * 60) }}”
  • data:
    entity_id: timer.custom_timer
    duration: “{{ total_seconds }}”
    action: timer.start

I paired this with a simple dashboard where I can easily input the hours and minutes. The interface includes input numbers for hours and minutes, a status indicator for the recording, and a big, friendly button to start everything off. Here’s how it looks:

type: vertical-stack
cards:

  • type: entities
    entities:
    • entity: input_number.record_timer_hours
      name: Hour
      secondary_info: none
    • entity: input_number.record_timer_minutes
      name: Minutes
    • entity: input_boolean.recording_active
      show_name: true
      show_icon: true
  • type: button
    name: Start Recording
    show_state: true
    tap_action:
    action: call-service
    service: input_boolean.turn_on
    service_data:
    entity_id: input_boolean.recording_active

To make it all work seamlessly, I created two automations. The first one starts the timer and sends a signal to my USB DVR when I press the start button. The second automation stops the recording once the timer finishes. Here’s a quick breakdown:

Start Recording and Timer

  • Trigger: When the recording active boolean turns on
  • Actions:
    • Start the timer
    • Send a signal to the DVR to begin recording

Stop Recording After Timer

  • Trigger: When the timer finishes
  • Actions:
    • Stop the timer
    • Send a signal to the DVR to stop recording
    • Turn off the recording active boolean

This setup has been a lifesaver for me. It’s straightforward, reliable, and best of all, it frees me up to focus on what really matters during my recording sessions. If you’re looking to automate your recording process, I highly recommend giving this a try! It’s a small tweak that makes a big difference.

Happy automating, and if you have any questions or tips, drop them below—I’d love to hear from you! :movie_camera::sparkles: