How to control my automations from a tab

Hello. I struggle to find the right approach how to move forward.

I did a simple blueprint to be able to control an automation for a power plug (see pic).

I would like to have this in a tab so it is quickly accessible but the only card useful is ‘website’, but it duplicates the left sidebar and does not work on mobile for some reason (never loads)

However, I would like to step back and just know from a high level what would be the best approach to be able to achieve that.

So far my thoughts are a custom card (never done that) or a web app and updating needed variables via API (have some experience). But looking for the simplest solution.

Much obliged.

I’m trying to follow what you are doing here. What exactly are you trying to do? You want to create an automation that will control a smart plug that turns on a coffee machine and you also want to be able to have UI access to disable the automation manually?

1 Like

I would like to have the ‘blueprint edit’ ability in a tab basically, for the current blueprint in the picture. So it is quickly accessible for a family member.

So the automation / blueprint is done, thats not a problem, automation can also be enabled all the time this is not the issue.

The blueprint:
The user can edit the time schedule, set the offset, enable / disable two different triggers as needed.

  • one is manual time schedule
  • second reads the next alarm sensor from the users phone.

When starting out I thought I would make a blueprint so it’s less complex for the user, but now I struggle to display this to the user directly (the blueprint edit window). I would like a simple UI, I don’t want them to click too deep to get to the blueprint edit window.

Hope that’s clearer now? thanks

Generally, the purpose of a blueprint is to be able to more easily create multiple similar automations… not really to have a frontend to make changes to an automation.

From what you have described, you would probably be better to just create an automation that uses Helper entities for the time and boolean values you need. Those Helpers can then be used on your dashboard so you can easily update the values used by the automation… no new custom cards needed.

1 Like

Interesting idea sir, let me try with helpers, will report back.

@Didgeridrew I think this is pretty neat so far and a great solution.

I only struggle with date time helper not allowing for negative time. I would prefer a negative offset. But I will see down the road if this input is really much needed for the user.

Thank you for the idea!

1 Like

That might not be the best Helper for that use, you may be better served by a Number helper. You should consider the lengths of time you typically use for your offset. If it’s usually in a range that can be expressed as a single unit, probably “minutes”, and doesn’t need 3-unit resolution; then you can alter the automation to use that instead.

If you need help altering the automation, there are plenty of folks on here willing to help, just post the automation’s configuration so we can see what changes are needed.

2 Likes

Well I tried this, but it does not trigger (template trigger). others are disabled for testing, but work fine:

alias: Moccamaster Turn ON Rules
description: ""
triggers:
  - trigger: time
    at: input_datetime.manual_time_trigger
    id: manual
    enabled: false
  - trigger: time
    at:
      entity_id: sensor.pixel_6a_next_alarm
      offset: "-00:05:00"
    id: alarm
    enabled: false
  - trigger: template
    value_template: >-
      {% set alarm_timestamp = states('sensor.pixel_6a_next_alarm') |
      as_timestamp %}

      {% set offset_minutes = states('input_number.next_alarm_trigger_offset') |
      int(0) %}

      {{ (alarm_timestamp - (offset_minutes * 60)) | timestamp_local }}
    id: alarm2
    enabled: true
conditions:
  - condition: time
    after: "03:00:00"
    before: "09:00:00"
    enabled: false
  - condition: zone
    entity_id: person.polona_burnik
    zone: zone.home
    enabled: false
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - manual
          - condition: state
            entity_id: input_boolean.enable_manual_time_trigger
            state: "on"
        sequence:
          - action: switch.turn_on
            target:
              entity_id:
                - switch.moccamaster
            data: {}
      - conditions:
          - condition: trigger
            id:
              - alarm2
              - alarm
          - condition: state
            entity_id: input_boolean.enable_alarm_time_trigger
            state: "on"
        sequence:
          - action: switch.turn_on
            target:
              entity_id:
                - switch.moccamaster
            data: {}
mode: single

Output time seems to be ok though.

A template trigger fires when the template output changes from false to true (docs). You want something like:

      {{ now()|as_timestamp < (alarm_timestamp - (offset_minutes * 60)) }}

which will trigger as soon as your time is no longer in the future.

I see, thank you for pointing that out. I’ll test it out. :ok_hand: