diff --git a/Commands.md b/Commands.md index 130dff1d..7b0e24d6 100644 --- a/Commands.md +++ b/Commands.md @@ -357,11 +357,6 @@ See also|[`SetOption28`](#SetOption28) - Set RF received data format ### IR Remote -See [Linux Infrared Remote Control (LIRC)](http://www.lirc.org/) for more information. - -A [specialized version of Tasmota](Tasmota-IR) can be compiled which supports almost all of the IR protocols available in the [`IRremoteESP8266` library](https://github.com/crankyoldgit/IRremoteESP8266). - - Command|Parameters :---|:--- IRsend``|Send an IR remote control code as a decimal or hexadecimal string in a JSON payload. In order to send IR data, _**you must configure one of the free device GPIO as `IRsend (8)`. GPIO01 nor GPIO03 can be used.**_
`` [_optional_] = number of times the IR message is sent. If not specified or `0..1`, the message is sent only once (i.e., not repeated) _(default)_
`>1` = emulate a long-press on the remote control, sending the message `` times, or sending a repeat message for specific protocols (like NEC)

`{"Protocol":"","Bits":,"Data":}`

`"Protocol"` (select one of the following):
  • `"NEC"`
  • `"SONY"`
  • `"RC5"`
  • `"RC6"`
  • `"DISH"`
  • `"JVC"`
  • `"PANASONIC"`
  • `"SAMSUNG"`
  • `"PIONEER"`
`"Bits":1..32` = required number of data bits
    for PANASONIC protocol this parameter is the the address, not the number of bits

`"Data":1..(2^32)-1` = data frame as 32 bit decimal.
    e.g., `IRsend {"Protocol":"NEC","Bits":32,"Data":2170978686}`
**or**
`"Data":0x1..0xFFFFFFFF` = data frame as 32 bit hexadecimal.
    e.g., `IRsend {"Protocol":"NEC","Bits":32,"Data":0x8166817E}`

Alternatively, you can send IR remote control codes using [RAW command encoding](IRSend-RAW-Encoding).

Information on [Receiving Infrared Data](Receiving-Infrared-Remote-Control-Data) diff --git a/IR-Remote.md b/IR-Remote.md new file mode 100644 index 00000000..90be929c --- /dev/null +++ b/IR-Remote.md @@ -0,0 +1,65 @@ +IR Remote driver enables sending IR codes through an IR transmitter and receiving them through an IR receiver via [IRremoteESP8266 library](https://github.com/crankyoldgit/IRremoteESP8266). + +A [specialized version of Tasmota](Tasmota-IR) can be compiled which supports almost all of the IR protocols available in the [`IRremoteESP8266` library](https://github.com/crankyoldgit/IRremoteESP8266). + + +# IR Transmitter +## Configuration +The prebuilt transmitter modules have a weak IR LED, effective transmit distance is really short. If you need range, either look for a breakout board with a TSAL6x00 LED or build your own. + +## Wiring +| IR | ESP266 | +|---|---| +|S |GPIOx | +|+ | 5v | +|- |GND | + +## Tasmota +In the _Configuration -> Configure Module_ page assign: +- GPIOx to `IRsend (8)` + +See [IR commands](Commands#ir-remote) for use. + +# IR Receiver + + +IR Receiver is used to capture IR codes. Those codes can be sent using [`IRSend`](commands#irsend) or used as a [rule](Rules) trigger. + +> Example uses the widely available [KY-022](https://arduinomodules.info/ky-022-infrared-receiver-module/) breakout board. + +## Wiring +| KY-022 | ESP266 | +|---|---| +|S |GPIOx | +|+ | 5v | +|- |GND | + +## Tasmota +In the _Configuration -> Configure Module_ page assign: +- GPIOx to `IRrecv (51)` + +On a captured code IR receiver sends a `tele/%topic%/RESULT` JSON reponse: + +```json +{ + "Time": "2019-01-01T00:00:00", + "IrReceived": { + "Protocol": "NEC", + "Bits": 32, + "Data": "0x00FF00FF" + } +} + +``` +### Further Reading +This covers only the basic IR protocols. Read [Complete IR Remote Protocols](Tasmota-IR) for more advanced applications. + +[IR Send RAW configuration and use](IRSend-RAW-Encoding) + +User maintained [codes database for IR](Codes-for-IR-Remotes-(for-YTF-IR-Bridge)) + +[Linux Infrared Remote Control (LIRC)](http://www.lirc.org/) for more information. + +### Other Projects +- [IR Blaster with Tasmota](http://www.asknoone.com/ir-blaster-with-tasmota/) +- [Sonoff Basic IR "hat"](https://github.com/altelch/SonoffIR) \ No newline at end of file diff --git a/Peripherals.md b/Peripherals.md index 29eb79de..63c11af4 100644 --- a/Peripherals.md +++ b/Peripherals.md @@ -29,7 +29,7 @@ More about [general configuration](Sensor-Configuration). - **HTU21** - Temperature and Humidity sensor (I2C) - **HX711** - Load Cell sensor (single wire) - **INA219** - High-Side DC Current and Voltage sensor (I2C) -- [**IR Remote Control**](https://github.com/altelch/SonoffIR) - DIY IR transmitter +- [**IR Remote**](IR-Remote) - IR transmitter and receiver - **K30, K70, S8** - CO2 sensor (I2C) - - [**LM75AD**](LM75AD) - Temperature Sensor (I2C) - **MAX31855** - Thermocouple Sensor (SPI)