Automation stopped working due a failed step at the beginning

Hi there,

I have an automation with my Dahua VTO portier which works perfectly (see code below).
Yesterday, for some reason, the screen of the tablet didn’t switch on and basically I see full automation was stopped at the very beginning for some reason related to the camera snapshot was not taken → and consequently all other steps were not executed, including switching on the tablet screen, playing a music, showing camera feed etc … :

id: 4cf62087-4164-4685-be6d-2ede8401d5fa
alias: Dahua VTO
trigger:
  - platform: event
    event_type: dahua_vto
    event_data:
      Code: BackKeyLight
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.Data.State | int in [1, 2] }}'
        sequence:
          - data:
              title: >-
                {{ 'Doorbell Ring' if trigger.event.data.Data.State | int in [1,
                2] else 'Doorbell No Ring' }}
              message: '{{ trigger.event.data }}'
            action: persistent_notification.create
          - target:
              entity_id: camera.192_168_1_110
            data:
              filename: /config/www/Camera-snapshots/ced-snapshot.jpg
           action: camera.snapshot
          - data:
              title: Portier VTO2000
              message: Quelqu'un sonne à la porte !!
              data:
                content-type: jpg
                image: >-
                  http://www:8123/local/Camera-snapshots/ced-snapshot.jpg
                clickAction: http://www:8123/smartphone-cameras/0
            action: notify.mobile_app_sm_a536b
          - data:
              title: Portier VTO2000
              message: Quelqu'un sonne à la porte !!
              data:
                content-type: jpg
                image: >-
                  http://www:8123/local/Camera-snapshots/ced-snapshot.jpg
            action: notify.mobile_app_sm_a515f_nada
          - metadata: {}
            data: {}
            target:
              entity_id: switch.lenovo_tab_m10_plus_3rd_gen_screen
            action: switch.turn_on
          - delay:
              hours: 0
              minutes: 0
              seconds: 3
              milliseconds: 0
          - target:
              entity_id: media_player.lenovo_tab_m10_plus_3rd_gen
            data:
              media_content_type: music
              media_content_id: http://www:8123/local/Lili25.mp3
            action: media_player.play_media
          - data:
              value: '300'
            target:
              entity_id: number.lenovo_tab_m10_plus_3rd_gen_screen_off_timer
            enabled: true
            action: number.set_value
          - data:
              title: Caméra Extérieure
              dismissable: false
              content:
                camera_view: live
                type: picture-glance
                entities: []
                camera_image: camera.192_168_1_110
              timeout: 120000
              size: fullscreen
              browser_id:
                - Lenovo-tablette
              right_button: Raccrocher
              right_button_action:
                service: media_player.media_stop
                data:
                  entity_id: media_player.lenovo_tab_m10_plus_3rd_gen
              left_button: Laisser vidéo 5m
              left_button_action:
                service: browser_mod.sequence
                data:
                  sequence:
                    - service: browser_mod.popup
                      data:
                        title: Caméra Extérieure
                        dismissable: true
                        content:
                          camera_view: live
                          type: picture-glance
                          entities: []
                          camera_image: camera.192_168_1_110
                        timeout: 300000
                        size: fullscreen
                        browser_id:
                          - Lenovo-tablette
                    - service: media_player.media_stop
                      data:
                        entity_id: media_player.lenovo_tab_m10_plus_3rd_gen
            action: browser_mod.popup
          - delay:
              hours: 0
              minutes: 3
              seconds: 0
              milliseconds: 0
          - data:
              value: '30'
            target:
              entity_id: number.lenovo_tab_m10_plus_3rd_gen_screen_off_timer
            action: number.set_value
      - conditions:
          - condition: template
            value_template: |
              {{ trigger.event.data.Data.State | int == 6 }}
        sequence:
          - data:
              title: Dahua_VTO - Not answered - type 6
              message: '{{ trigger.event.data }}'
            action: persistent_notification.create
    default:
      - data:
          title: Unknown state {{ trigger.event.data.Data.State | int }}
          message: '{{ trigger.event.data }}'
        action: persistent_notification.create
mode: queued

Is there a way I can see what really happens ?
Camera not available or … ?
Is there a way I can tell if a step is not executing, to “ignore” it ? Because specifically here taking the camera snapshot is not really important, but I missed the call on my tablet :wink:

Many thanks !!

Seems like your camera was unavailable on the network to home assistant at the time of execution, based on the timeout error message.

You can use continue_on_error: in any action.

The continue_on_error is available on all actions and is set to false. You can set it to true if you’d like to continue the action sequence, regardless of whether that action encounters an error.

The example below shows the continue_on_error set on the first action. If it encounters an error; it will continue to the next action.

- alias: "If this one fails..."
  continue_on_error: true
  action: notify.super_unreliable_service_provider
  data:
    message: "I'm going to error out..."

- alias: "This one will still run!"
  action: persistent_notification.create
  data:
    title: "Hi there!"
    message: "I'm fine..."

Please note that continue_on_error will not suppress/ignore misconfiguration or errors that Home Assistant does not handle.

See this thread for discussion Notify on error, continue remainder of automation - Configuration - Home Assistant Community (home-assistant.io)

1 Like

Thanks a lot, I can try to put this condition in ly automation … important is that the screen goes on and music rings … more important than having a picture and live feed, and miss a call if camera is unavailable.

Checking the logs, I see indeed some entries showing the camera was unavailable on the 10/09 at 21:34, then inactive 10 seconds after … I probably need to check the camera log itself for the real reason …

P.S. to test thon, I will disconnect the camera, try to ring at the door verifying that the automation is not running, then add this “continue_on_error” condition and verify if it works !

I let you know

1 Like

mmm in fact I realize this is difficult to reproduce to put this camera in unavailable state …
This is in fact a portier Dahua VTO2000, so I disconnected the network cable but then what happens is that HA is obviously not triggered when pushing the ring button on the VTO2000 and automation is obviously even not triggered …

;-(

… and If I deactivate the entity, then it shows as deactivated but the automation runs, so I do not get the issue with the timeout error
;-(

So looks like for the automation, camera is ok and it runs perfectly ???

What is strange is that if the camera entity is deactivated as I manually did and showed on the screenshot above, the camera snapshot is taken anyway but the live feed of the camera is not showed on the tablet ???
I am completely lost in here …

The doorbell unit has it own configuration webportal, right? I mean regardless of HA.
Maybe it’s configured to use WiFi when not connected to wired LAN.

Can you check your router how its connected to your local LAN?
If it is connected you could go to the IP it’s connected to and check the settings in the doorbell its webportal.

EDIT: The Dahua tablet is it connected to your network separately, right? Check if it’s connected to your network (by Wifi or LAN?). You can power off and reboot it again when your doorbell unit is online.

In short, the tablet and doorbell unit are two seperate devices. If your tablet is not connected to the doorbell unit maybe the tablet is not connected to your network, but your doorbell unit can still be.