Hi,
I’m trying to use a rf-bridge to receive rf-messages and do some automations.
I flashed a sonoff rf-bridge with Tasmota and Portisch.
When I press a button, I get
15:45:19.402 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:45:19","RfReceived":{"Sync":11100,"Low":280,"High":980,"Data":"FF5F71","RfKey":"None"}}`
and with following automation works like a charm:
# -------------------------------------------
- id: tasmota_rf_bridge_FF5F71_mqtt
alias: tasmota_rf_bridge_FF5F71_mqtt
trigger:
- platform: mqtt
topic: "tasmota/tasmota-112/tele/RESULT"
payload: "FF5F71"
value_template: "{{ value_json.RfReceived.Data }}"
action:
- data:
entity_id: light.group_n00_p00
transition: 0
service_template:
homeassistant.toggle
However, a lot of my RF-devices are not supported (even with Portisch), so I have to switch to “raw”-mode: rfraw 177
The messages I receive then are something like (below is message sent from pressing same button on my remote):
15:48:48.093 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:48:48","RfRaw":{"Data":"AA B1 04 03FC 017C 010E 2B52 3818181818181818190819081818181819081818190A090819 55"}}
15:48:48.276 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:48:48","RfRaw":{"Data":"AA B1 04 03FC 0186 0118 2B48 381818181818181819081A08181818181A0818181A0A090819 55"}}
15:48:48.413 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:48:48","RfRaw":{"Data":"AA B1 04 049C 00E6 019A 2B5C 38182828282828282908290828282828290828282A09090829 55"}}
15:48:48.960 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:48:48","RfRaw":{"Data":"AA B1 04 03F2 0190 0122 2B3E 38181818181818181A081A08181818181A0818181A0A0A081A 55"}}
15:48:50.238 MQT: tasmota/tasmota-112/tele/RESULT = {"Time":"2021-11-06T15:48:50","RfRaw":{"Data":"AA B1 04 03FC 019A 0118 2B48 38181818181818181A081A08181818181A0818181A0A0A081A 55"}}
as you can see, the messages are different, some “buckets” are in front and I can not use the “Data” as a whole.
What I want to do is to take only the last 53 characters from “Data”, thus:
AA B1 04 03FC 0190 0122 2B7A 38181818181818181A081A08181818181A0818181A0A0A081A 55
will become:
38181818181818181A081A08181818181A0818181A0A0A081A 55
and than create an automation based on this value.
Can this be done? How?
any help is appreciated,
kind regards
Bart