You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to setup a value that I can reuse in config.
I have multiple sensors and would like them all to have the same interval value.
So I tried to use Jinja2, but the config does not load.
This is my line of code: {% set myinterval = 60 %} and reuse like this {{ myinterval }}.
How can I make a variable available over all config sensor entries?
mqtt:
host: mypizero2
port: 1883
user: ""
password: ""
topic_prefix: test
keepalive: 600
status_topic: status
status_payload_running: running
status_payload_stopped: stopped
status_payload_dead: dead
{% set interval = 60 %}
sensor_modules:
- name: a
module: ds18b
type: DS18B20
address: 01131b6c22e4
sensor_modules:
- name: b
module: ds18b
type: DS18B20
address: 01131b711e04
sensor_inputs:
- name: a
module: a
interval: {{ interval }}
digits: 2
sensor_inputs:
- name: b
module: b
interval: {{ interval }}
digits: 2
The text was updated successfully, but these errors were encountered:
Found this: #209
added this to my supervisor config and then it worked:
command = /home/myuser/mqtt-io/.venv/bin/python -m mqtt_io mqtt-io_config.yaml --render render.yaml
I am trying to setup a value that I can reuse in config.
I have multiple sensors and would like them all to have the same interval value.
So I tried to use Jinja2, but the config does not load.
This is my line of code:
{% set myinterval = 60 %}
and reuse like this{{ myinterval }}
.How can I make a variable available over all config sensor entries?
The text was updated successfully, but these errors were encountered: