# Notification PortierVidéo avec choix d'action

**URL:** <https://forum.hacf.fr/t/notification-portiervideo-avec-choix-daction/12349>\
**Category:** Entraide Home Assistant\
**Tags:** automatisation-automation, integration, aide\
**Created:** [Juillet 14, 2022, 9:41 UTC](https://forum.hacf.fr/t/notification-portiervideo-avec-choix-daction/12349 "2022-07-14T09:41:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo\_BNTT](https://forum.hacf.fr/user_avatar/forum.hacf.fr/hugo_bntt/32/15033_2.png) [@Hugo\_BNTT](https://forum.hacf.fr/u/Hugo_BNTT)\
**Post date:** [Juillet 14, 2022, 9:41 UTC](https://forum.hacf.fr/t/notification-portiervideo-avec-choix-daction/12349/1 "2022-07-14T09:41:36Z")

</div>

Hello tout le monde.

## Mon problème

Je voudrais être notifié par mon application, voir mon flux VTO et choisir si je veux ouvrir (déverrouiller la porte) ou fermer (ne rien faire).

J’ai créé une automatisation mais malheureusement elle ne fonctionne pas totalement, je n’arrive pas à activer le déverrouillage de la porte …

J’ai mis ça dans ma première automatisation :

```auto
id: '1657652181779'
alias: Sonette
description: ''
trigger:
  - platform: state
    entity_id:
      - binary_sensor.videophone_button_pressed
    from: 'off'
    to: 'on'
condition: []
action:
  - service: notify.mobile_app_iphone_hb
    data:
      message: 'Quelqu''un sonne à la porte :'
      data:
        entity_id: camera.videophone
        presentation_options:
          - alert
          - badge
        actions:
          - action: Fermer
            title: Laisser fermé
            icon: sfsymbols:lock.fill
            destructive: true
          - service: dahua.vto_open_door
            data: {}
            title: Ouvrir
            icon: sfsymbols:lock.open.fill
            target:
              device_id: c2806629847d4f1be392720f909a58d8

```

J’ai pensé à une autre manière de fonctionner et j’ai donc essayé ceci mais sans grand succès :

```auto
id: '1657652181779'
alias: Sonette
description: ''
trigger:
  - platform: state
    entity_id:
      - binary_sensor.videophone_button_pressed
    from: 'off'
    to: 'on'
condition: []
action:
  - service: notify.mobile_app_iphone_hb
    data:
      message: 'Quelqu''un sonne à la porte :'
      data:
        entity_id: camera.videophone
        presentation_options:
          - alert
          - badge
        actions:
          - action: Fermer
            title: Laisser fermé
            icon: sfsymbols:lock.fill
            destructive: true
          - action: Ouvrir
            title: Ouvrir
            icon: sfsymbols:lock.open.fill
  - wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: Ouvrir
    continue_on_timeout: false
    timeout: '10000'
  - service: dahua.vto_open_door
    data: {}
    target:
      device_id: c2806629847d4f1be392720f909a58d8

```

Est-ce que quelqu’un à une solution ou pourrait m’aider à solutionner mon problème, svp ?

## Ma configuration

* * *

## System Health

| version | core-2022.7.4 |
| --- | --- |
| installation\_type | Home Assistant OS |
| dev | false |
| hassio | true |
| docker | true |
| user | root |
| virtualenv | false |
| python\_version | 3.10.5 |
| os\_name | Linux |
| os\_version | 5.15.45 |
| arch | x86\_64 |
| timezone | Europe/Paris |
| config\_dir | /config |

> **Home Assistant Community Store**
>
> | GitHub API | ok |
> | --- | --- |
> | GitHub Content | ok |
> | GitHub Web | ok |
> | GitHub API Calls Remaining | 4940 |
> | Installed Version | 1.26.1 |
> | Stage | running |
> | Available Repositories | 1073 |
> | Downloaded Repositories | 6 |

> **Home Assistant Cloud**
>
> | logged\_in | false |
> | --- | --- |
> | can\_reach\_cert\_server | ok |
> | can\_reach\_cloud\_auth | ok |
> | can\_reach\_cloud | ok |

> **Home Assistant Supervisor**
>
> | host\_os | Home Assistant OS 8.2 |
> | --- | --- |
> | update\_channel | stable |
> | supervisor\_version | supervisor-2022.07.0 |
> | agent\_version | 1.2.1 |
> | docker\_version | 20.10.14 |
> | disk\_total | 31.8 GB |
> | disk\_used | 5.5 GB |
> | healthy | true |
> | supported | true |
> | board | ova |
> | supervisor\_api | ok |
> | version\_api | ok |
> | installed\_addons | Mosquitto broker (6.1.2), tydom2mqtt (2.2.0), Node-RED (12.0.2), SSH & Web Terminal (11.0.1), File editor (5.3.3), Samba share (10.0.0) |

> **Dashboards**
>
> | dashboards | 1 |
> | --- | --- |
> | resources | 1 |
> | views | 1 |
> | mode | storage |

> **Recorder**
>
> | oldest\_recorder\_run | 4 juillet 2022 à 17:05 |
> | --- | --- |
> | current\_recorder\_run | 14 juillet 2022 à 10:43 |
> | estimated\_db\_size | 123.49 MiB |
> | database\_engine | sqlite |
> | database\_version | 3.38.5 |

\_\_\_

---

<div class="post-metadata">

**Author:** ![AlexHass](https://forum.hacf.fr/user_avatar/forum.hacf.fr/alexhass/32/11197_2.png) [@AlexHass](https://forum.hacf.fr/u/AlexHass)\
**Post date:** [Juillet 14, 2022, 4:01 UTC](https://forum.hacf.fr/t/notification-portiervideo-avec-choix-daction/12349/2 "2022-07-14T16:01:13Z")

</div>

Salut,

Ton automatisation pour passer des actions dans la notification ça a l’air ok dans ton 2ème exemple.  
En revanche je créerais une automatisation séparée pour l’event «&nbsp;mobile\_app\_notification\_action&nbsp;» avec l’event comme trigger.  
Car je ne suis pas certain si le wait\_for\_trigger soit une bonne idée dans ce cas là.  
Si tu sépare les 2 partie complètement au moins ce sont des éléments qui n’ont pas de dépendances l’un sur l’autre.

Je n’ai pas d’exemple à te donner dans HA, mais c’est comme ça que j’ai fait ça avec NodeRed, et ça marche très bien.

---

<div class="post-metadata">

**Author:** ![Hugo\_BNTT](https://forum.hacf.fr/user_avatar/forum.hacf.fr/hugo_bntt/32/15033_2.png) [@Hugo\_BNTT](https://forum.hacf.fr/u/Hugo_BNTT)\
**Post date:** [Juillet 14, 2022, 10:59 UTC](https://forum.hacf.fr/t/notification-portiervideo-avec-choix-daction/12349/3 "2022-07-14T22:59:04Z")

</div>

Je ne suis plus chez moi pour le wk, je regarde ça en début de semaine pro mais je te ferai  
un retour de ce que tu m’as dit car actuellement ce que j’ai fait, ne fonctionne pas 😢
