DeerMaximum/QR-Code-Generator

Request: Example on how to send data to template configuration through an automation

ErikThorsell opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
Reading through the README.md I am unable to understand how I am supposed to populate the template in an automated way.

The README.md currently contains the following example:

For wifi access with template
Name: My wifi access
Content: WIFI:T:WPA2;S:MyNetworkName;P:{{states("input_text.wlan_password")}};H:true;

but the README.md does not describe how {{states("input_text.wlan_password")}} is supposed to be sent to the integration to achieve the dynamic update of the QR Code.

Describe the solution you'd like
I would like an example, showing an automation in Home Assistant that update the QR Code image by sending new data to its template .

The QR code updates automatically when the value of the template changes. That means to change the content you have to change the value of input_text.wlan_password with an automation, as soon as the value is changed the QR code changes too.

Example:

description: "Example"
mode: single
trigger: []
condition: []
action:
  - service: input_text.set_value
    data:
      value: New Value
    target:
      entity_id: input_text.wlan_password

I will add a note in the README.md to clarify this.