Skip to content

Commit

Permalink
Documentation: Add new action "send a zigbee2mqtt message" (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
William-De71 authored Nov 11, 2024
1 parent 943a232 commit d8ea4d5
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/scenes/send-a-zigbee2mqtt-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
id: send-a-zigbee2mqtt-message-action
title: Send a Zigbee2Mqtt message
sidebar_label: Send a Zigbee2Mqtt message
---

In scenes, it is sometimes useful to send an order to control zigbee2mqtt devices that are not managed by Gladys Assistant.

## Send a Zigbee2Mqtt message in a scene

To send a Zigbee2Mqtt message, it's very simple, create a "send a Zigbee2Mqtt message" action in a scene.

![Send Zigbee2Mqtt message](../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/send-a-zigbee2mqtt-message.png)

## Concrete example: Trigger a siren [Woox R7051](https://www.zigbee2mqtt.io/devices/R7051.html) from a Gladys Assistant scene

### In Gladys, create a scene

Create a new scene in Gladys, then add an "send a Zigbee2Mqtt message" action to it.

Specify the topic of your device.

![Device topic](../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/device-topic.png)

Specify the command to control your device. You can find your device's information on the [Zigbee2mqtt](https://www.zigbee2mqtt.io/devices/R7051.html#warning-composite) website.

![Device message](../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/device-message.png)

Save the scene and launch it.

## Inject a variable into a message

You want to inject the duration value into the message, in order to know the current duration value.

To do this, you must add a "retrieve the last state" action to your scene and select the device you want to request.

![Get device value](../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/get-device-value.png)

Then, further in the scene, you can add a "send a Zigbee2Mqtt message" action, and in the message you type `{{` and select the previously defined variable.

![Send message with injected variable](../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/send-a-zigbee2mqtt-message-with-injected-variable.png)

When the scene runs, you should get the value in your message 🥳
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
id: send-a-zigbee2mqtt-message-action
title: Envoyer un message Zigbee2Mqtt
sidebar_label: Envoyer un message Zigbee2Mqtt
---

Dans les scènes, il est parfois utile d'envoyer une commande pour contrôler des appareils Zigbee2Mqtt qui ne sont pas gérés par Gladys Assistant.

## Envoyer un message Zigbee2Mqtt dans une scène

Pour envoyer un message Zigbee2Mqtt, c'est très simple : créez une action "envoyer un message Zigbee2Mqtt" dans une scène.

![Envoyer un message Zigbee2Mqtt](../../../../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/send-a-zigbee2mqtt-message.png)

## Exemple concret : Déclencher une sirène [Woox R7051](https://www.zigbee2mqtt.io/devices/R7051.html) depuis une scène Gladys Assistant

### Dans Gladys, créer une scène

Créez une nouvelle scène dans Gladys, puis ajoutez une action "envoyer un message Zigbee2Mqtt".

Spécifiez le topic de votre appareil.

![Topic de l'appareil](../../../../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/device-topic.png)

Spécifiez la commande pour contrôler votre appareil. Vous pouvez trouver les informations de votre appareil sur le site [Zigbee2mqtt](https://www.zigbee2mqtt.io/devices/R7051.html#warning-composite).

![Message de l'appareil](../../../../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/device-message.png)

Enregistrez la scène et lancez-la.

## Injecter une variable dans un message

Vous voulez injecter la valeur de durée actuelle dans le message, afin de savoir la valeur de durée actuelle.

Pour cela, vous devez dans votre scène ajouter une action "Récupérer le dernier état" puis vous sélectionnez l'appareil que vous voulez requêter.

![Récupérer valeur capteur](../../../../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/get-device-value.png)

Ensuite, plus loin dans la scène, vous pouvez ajouter une action "Envoyer un message" et dans le message vous tapez `{{ ` puis vous sélectionnez la variable précédemment définie.

![Envoyer un message avec variable injectée](../../../../../static/img/docs/en/scenes/send-a-zigbee2mqtt-message-action/send-a-zigbee2mqtt-message-with-injected-variable.png)

Lorsque la scène est lancée, vous devriez obtenir la valeur dans votre message 🥳
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module.exports = {
"scenes/wait-action",
"scenes/continue-only-if-action",
"scenes/send-a-message-action",
"scenes/send-a-zigbee2mqtt-message-action",
"scenes/turn-on-off-the-lights-action",
"scenes/http-request",
"scenes/user-presence",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d8ea4d5

Please sign in to comment.