Restart quand etat numérique du pzem est unvaluable

Salut a tous,

je souhaiterais creer une automatisation sur un sensor d’un etat numerique qui lancerait le restart switch lorsque celui-ci est en unvaluable.

voici mon auto actuellement

alias: Pzem restart auto
description: ''
trigger:
  - platform: state
    entity_id: sensor.enedis_courant
    to: unavailable
  - platform: state
    entity_id: sensor.pv_courant
    to: unavailable
  - platform: state
    entity_id: sensor.enedis_puissance
    to: unavailable
condition: []
action:
  - service: switch.toggle
    target:
      entity_id:
        - switch.tableau_restart
        - switch.tableau_restart_2
mode: single

voici ma congig

## System Health

version | core-2021.8.5
-- | --
installation_type | Home Assistant Supervised
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.9.6
os_name | Linux
os_version | 4.19.0-17-amd64
arch | x86_64
timezone | Europe/Paris

<details><summary>Home Assistant Community Store</summary>

GitHub API | ok
-- | --
Github API Calls Remaining | 4609
Installed Version | 1.13.2
Stage | running
Available Repositories | 854
Installed Repositories | 62

</details>

<details><summary>AccuWeather</summary>

can_reach_server | ok
-- | --
remaining_requests | 33

</details>

<details><summary>Home Assistant Cloud</summary>

logged_in | false
-- | --
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok

</details>

<details><summary>Home Assistant Supervisor</summary>

host_os | Debian GNU/Linux 10 (buster)
-- | --
update_channel | beta
supervisor_version | supervisor-2021.06.8
docker_version | 20.10.7
disk_total | 113.6 GB
disk_used | 16.1 GB
healthy | true
supported | true
supervisor_api | ok
version_api | ok
installed_addons | Samba share (9.5.1), MQTT Server & Web client (1.2.0), Terminal & SSH (9.1.3), Spotify Connect (0.9.0), Grafana (7.1.0), Node-RED (10.0.0), Tydom2MQTT - Beta (release_1.2.1), InfluxDB (4.2.1), File editor (5.3.3), Zigbee2mqtt (1.21.0-1), Glances (0.12.3), Dnsmasq (1.4.4), Duck DNS (1.13.0), ESPHome (1.20.4), Visual Studio Code (3.6.2)

</details>

<details><summary>Lovelace</summary>

dashboards | 3
-- | --
resources | 42
views | 17
mode | storage

</details>

<details><summary>Spotify</summary>

api_endpoint_reachable | ok
-- | --

</details>

merci d’avance pour vos conseils

Renseigner votre problème

Ma configuration


Texte à remplacer par votre configuration

Comment récupérer ma configuration :
Dans votre HA, Menu latéral Configuration > Info > bouton copier > Pour Github
image


Conseils sur quoi ?

Personnellement, je ne vois pas ce que tu veux…

Tu as ton automatisation.

Il y a un problème avec ? Un log ?

oui quand il se mets en unvulable il n’actionne pas le switch restart. c’est comme ci il ne voyait pas le changement d’etat

Il doit exister un log quelque part…

je vais chercher ca et je reviens vers vous