First!
Thanks to Dale3h wich made the first version,
and sinker1345 who got me on the right track for this JSON string
also Tinkerer & Ludeeus for all this support for us all!
Got an very old lightstrip laying around (You know this things with a IR Blaster for the colurs and an other part for the Power and reciving the message)
wanted to throw it in the garbage, but thourght… maybe i can use this LFN thing… so i just putted it on my “to try around” sonoff with all the cables outside - switching the GPIO14 to IR recv(gnd to gnd, vcc to vcc) and subscribing to tele/sonoff/RESULT…
WTF - Im getting a MQTT message… (hardest part for me was filtering the json string, took me a month =P ) and I can use an ordanary IR blaster to control ALL (insert evil laugh here)
sensor:
- platform: mqtt
name: "IR Data"
state_topic: tele/sonoff2/RESULT
value_template: '{{ value_json["IrReceived"]["DATA"] }}'
expire_after: 1
automation:
- action:
- data:
entity_id: light.nachttisch
service: light.toggle
alias: IRTEST OK
condition: []
id: '1525091728944'
trigger:
- entity_id: sensor.ir_data
platform: state
to: BCB47
The data i recive is
tele/sonoff2/RESULT = {“IrReceived”:{“PROTOCOL”:“SONY”,“BITS”:20,“DATA”:“B47”}} # sony remote button 1
and the debug mqtt logger helped a lot
logger:
default: warning
logs:
homeassistant.components.mqtt: debug