I use Python script called rpi-rf_receive-mqtt. This script catches signals from RF receiver on GPIO27 (Raspberry).
If I push a button on my RF device, it broadcasts multiple numebrs but randomly. This is why I need to add multiple numbers to payload_on.
as you can see there are multiple number codes. 1792 or 1024 repeats. This is why I need to set those repeated codes because they are present in the list every time I push the button. This will cause HA will notice button being pushed every time not only in those times it send single code defines i payload_on.
The way I would approach it is to create a payload template that accepts all the know values and returns the value in payload on. This is assuming that what you have is a component that accepts templates - it is not exactly clear from your extract.
Something like
value_template: {% if value == "1792" %}14110972{% endif %}
value_template: {% if value == "1792" %}14110972{% endif %}
value_template: {% if value == "1234" %}14110972{% endif %}
value_template: {% if value == "12345" %}14110972{% endif %}
value_template: {% if value == "123456" %}14110972{% endif %}
Almost. There can only be one value_template: entry, so you will need to include all incoming values in that. My jinja isn’t very good, but I think this would work,
value_template: {% if value == "1792" or value=="1234" %}14110972{% endif %}
or you might use else statements. Some jinja experts around might be able to suggest something more elegant.
Thenk you @gpbenton. Please any expert - which solution is better concerning to CPU load (or system stability?). Multiple “IF” or multiple “ELSE” ? Thanks.