Timer bug?

Perhaps found a bug?

I have an automation that triggers when a TV is turned ON that should pause a timer. According to the log book, the automation runs, the proper choice is made and the action is a service call to pause a timer. However, it simply doesn’t pause.

If I open Visual editor, and manually run that exact same action, the timer pauses as expected. I’m at a bit of a loss further troubleshooting. Could this be some type of bug with the timer pause service when called from an automation?

//Brew

YAML is below… the Timer.Pause never runs via the automation, but the log book says it did… When I manually run “Choice 1” the timer pauses as expected…

alias: Basement - TV Lighting
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.vizio_tv_e65_f1_television
    from: "off"
    to: "on"
    id: TV-TurnedON
  - platform: state
    entity_id:
      - media_player.vizio_tv_e65_f1_television
    from: "on"
    to: "off"
    id: TV-TurnedOFF
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - TV-TurnedON
        sequence:
          - service: timer.pause
            data: {}
            target:
              entity_id: timer.basement_roomlights
      - conditions:
          - condition: trigger
            id:
              - TV-TurnedOFF
        sequence:
          - service: timer.start
            data: {}
            target:
              entity_id: timer.basement_roomlights
mode: single

What does your trace show? Download it and post the result here.

Like this?

{
“trace”: {
“last_step”: “action/0/choose/0/sequence/0”,
“run_id”: “959cef3a24b970734df389a39c073082”,
“state”: “stopped”,
“script_execution”: “finished”,
“timestamp”: {
“start”: “2023-11-22T12:46:36.973308+00:00”,
“finish”: “2023-11-22T12:46:36.978223+00:00”
},
“domain”: “automation”,
“item_id”: “1700579780907”,
“trigger”: “state of media_player.vizio_tv_e65_f1_television”,
“trace”: {
“trigger/0”: [
{
“path”: “trigger/0”,
“timestamp”: “2023-11-22T12:46:36.973445+00:00”,
“changed_variables”: {
“this”: {
“entity_id”: “automation.basement_tv_turned_on”,
“state”: “on”,
“attributes”: {
“id”: “1700579780907”,
“last_triggered”: “2023-11-22T12:37:16.477382+00:00”,
“mode”: “single”,
“current”: 0,
“friendly_name”: “Basement - TV Lighting”
},
“last_changed”: “2023-11-21T15:40:51.785825+00:00”,
“last_updated”: “2023-11-22T12:37:16.485485+00:00”,
“context”: {
“id”: “01HFVGHRHX6HRXVH4A32J33NEB”,
“parent_id”: “01HFVGHRHVS6XV05KQP193DR7H”,
“user_id”: null
}
},
“trigger”: {
“id”: “TV-TurnedON”,
“idx”: “0”,
“alias”: null,
“platform”: “state”,
“entity_id”: “media_player.vizio_tv_e65_f1_television”,
“from_state”: {
“entity_id”: “media_player.vizio_tv_e65_f1_television”,
“state”: “off”,
“attributes”: {
“source_list”: [
“HDMI-1”,
“HDMI-2”,
“HDMI-3”,
“HDMI-4”,
“COMP”,
“TV”,
“USB”,
“SMARTCAST”,
“AirPlay”,
“WatchFree+”,
“hdmi5”,
“vin3”,
“vin4”,
“vin5”,
“dp1”,
“dp2”,
“ext1”,
“vcec-1”,
“vcec-2”,
“vcec-3”
],
“device_class”: “tv”,
“friendly_name”: “Vizio TV E65-F1 Television”,
“supported_features”: 18433
},
“last_changed”: “2023-11-22T12:37:16.475739+00:00”,
“last_updated”: “2023-11-22T12:37:16.475739+00:00”,
“context”: {
“id”: “01HFVGHRHVS6XV05KQP193DR7H”,
“parent_id”: null,
“user_id”: null
}
},
“to_state”: {
“entity_id”: “media_player.vizio_tv_e65_f1_television”,
“state”: “on”,
“attributes”: {
“source_list”: [
“HDMI-1”,
“HDMI-2”,
“HDMI-3”,
“HDMI-4”,
“COMP”,
“TV”,
“USB”,
“SMARTCAST”,
“AirPlay”,
“WatchFree+”,
“hdmi5”,
“vin3”,
“vin4”,
“vin5”,
“dp1”,
“dp2”,
“ext1”,
“vcec-1”,
“vcec-2”,
“vcec-3”
],
“source”: “HDMI-1”,
“device_class”: “tv”,
“friendly_name”: “Vizio TV E65-F1 Television”,
“supported_features”: 18433
},
“last_changed”: “2023-11-22T12:46:36.971852+00:00”,
“last_updated”: “2023-11-22T12:46:36.971852+00:00”,
“context”: {
“id”: “01HFVH2VXBW9FMZBNZ3X5DRRE9”,
“parent_id”: null,
“user_id”: null
}
},
“for”: null,
“attribute”: null,
“description”: “state of media_player.vizio_tv_e65_f1_television”
}
}
}
],
“action/0”: [
{
“path”: “action/0”,
“timestamp”: “2023-11-22T12:46:36.974950+00:00”,
“changed_variables”: {
“context”: {
“id”: “01HFVH2VXDBHYQWGAA6BWQRW8F”,
“parent_id”: “01HFVH2VXBW9FMZBNZ3X5DRRE9”,
“user_id”: null
}
},
“result”: {
“choice”: 0
}
}
],
“action/0/choose/0”: [
{
“path”: “action/0/choose/0”,
“timestamp”: “2023-11-22T12:46:36.975071+00:00”,
“result”: {
“result”: true
}
}
],
“action/0/choose/0/conditions/0”: [
{
“path”: “action/0/choose/0/conditions/0”,
“timestamp”: “2023-11-22T12:46:36.975120+00:00”,
“result”: {
“result”: true
}
}
],
“action/0/choose/0/sequence/0”: [
{
“path”: “action/0/choose/0/sequence/0”,
“timestamp”: “2023-11-22T12:46:36.975606+00:00”,
“result”: {
“params”: {
“domain”: “timer”,
“service”: “pause”,
“service_data”: {},
“target”: {
“entity_id”: [
“timer.basement_roomlights”
]
}
},
“running_script”: false
}
}
]
},
“config”: {
“id”: “1700579780907”,
“alias”: “Basement - TV Lighting”,
“description”: “”,
“trigger”: [
{
“platform”: “state”,
“entity_id”: [
“media_player.vizio_tv_e65_f1_television”
],
“from”: “off”,
“to”: “on”,
“id”: “TV-TurnedON”
},
{
“platform”: “state”,
“entity_id”: [
“media_player.vizio_tv_e65_f1_television”
],
“from”: “on”,
“to”: “off”,
“id”: “TV-TurnedOFF”
}
],
“condition”: ,
“action”: [
{
“choose”: [
{
“conditions”: [
{
“condition”: “trigger”,
“id”: [
“TV-TurnedON”
]
}
],
“sequence”: [
{
“service”: “timer.pause”,
“data”: {},
“target”: {
“entity_id”: “timer.basement_roomlights”
}
}
]
},
{
“conditions”: [
{
“condition”: “trigger”,
“id”: [
“TV-TurnedOFF”
]
}
],
“sequence”: [
{
“service”: “timer.start”,
“data”: {},
“target”: {
“entity_id”: “timer.basement_roomlights”
}
}
]
}
]
}
],
“mode”: “single”
},
“blueprint_inputs”: null,
“context”: {
“id”: “01HFVH2VXDBHYQWGAA6BWQRW8F”,
“parent_id”: “01HFVH2VXBW9FMZBNZ3X5DRRE9”,
“user_id”: null
}
},
“logbookEntries”: [
{
“name”: “Basement - TV Lighting”,
“message”: “triggered by state of media_player.vizio_tv_e65_f1_television”,
“source”: “state of media_player.vizio_tv_e65_f1_television”,
“entity_id”: “automation.basement_tv_turned_on”,
“context_id”: “01HFVH2VXDBHYQWGAA6BWQRW8F”,
“when”: 1700657196.973574,
“domain”: “automation”
}
]
}

Looks fine. Are you sure the timer was running?

Yes it was… I have a card to monitor them… before it got to Zero, I manually ran the step to pause it… then in the card, the countdown stopped and it said xx:xx (Paused) so I knew it worked…

the other way I knew it WASN’T working, was my lights kept turning off when the timer expired… It’s driving me crazy.

Maybe I’ll try a “windows fix” and reboot my HA system. :slight_smile:

It’s just the same service call. not sure how a reboot will fix anything.

it seems like something else is going wrong and you’re looking in the wrong spot.

I’d check your logs for errors.

Can you post one when you are turning the TV off?

:man_facepalming: Ignore that… I missed my :coffee: this morning

Also, double check that the TV is actually going from “on” to “off” and “off” to “on”. I haven’t taken the time to nail down the specifics yet, but our Vizio seems to pass through “unavailable” to “on” or “off” about 30% of the time.

I just looked through the log… and it’s very minimal so far today with most complaints about “invalid response from API” for my Roku devices… none of which are in ANY automations I have… but I’ll keep testing and poking around. Thanks for putting some eyes on this for me!

The OFF condition works every time… When the state changes from ON to OFF, the automation to resume the timer runs and within the proper time frame my lights turn out… so that aspect works like a charm.

So this may have been an issue with my Homekit integration with the Vizio TV… I deleted it, and reset the integration… Named my entities as I wanted, then updated my automations… It SEEMS like things are properly working now. :slight_smile:

So no bug in the timer pause service… just some sort of entity issue…