Using Input, Menu, etc buttons on a remote

I am hoping to have my FlipperZero replace my universal remote that I use when…ahem…adjusting…what the hotel TV shows. I plug in my FireStick and then have to access the menu to both change inputs and adjust a few menu settings.

Currently the Power, Channel, and Volume buttons are great but I need additional “buttons” for input and menu. If it helps, the TV’s are generally LG or Sony.

How would I do this?

You are in different hotels, that are providing only a few buttons?

If you stick a Fire TV Stick to the TV and are working with the Fire TV Remote, the signal path is most likely ‘Fire TV Remote -(Bluetooth)- Fire TV Stick -(HDMI/CEC)- TV’. There is no use for the flipper at this path.

If you want to get the IR codes for a given TV, you need to search. A good start is: GitHub - Lucaslhm/Flipper-IRDB: A collective of different IRs for the Flipper

Sometimes the TV Type is the filename, sometimes the remote. Sometimes there are the working/compatible TVs in the comment of a file, sometimes it is worth to give it a try.

1 Like

The Fire TV remote is really only used to control the FireStock and I had assumed that the Flipper wouldn’t really be useful in that process (as you pointed out).

I have to use the universal remote in order to be able to cycle through the inputs (to get to the HDMI where my fire TV is plugged in) and then sometimes I have to adjust other settings in the menu.

SO, after doing some additional hunting around, it looks like you can’t add buttons to the current universal remote setup on the Flipper. Instead, I’m wondering if I need to find the generic IR codes for the LG and Sony TVs and then create/write a new file where I can swap out the following buttons on the default TV setup:
Mute becomes Input
Volume up/down becomes menu left/right
Channel up/down becomes menu up/down

Do you think this would work? Is there an easier way?

Is there anyway to write a file so that flipper would cycle through all the various types of LG or Sony trying the substitutes buttons above?

Thanks for your help!

1 Like

Most are already available so no need to make a custom file. You can download .ir files for most TV. Use the links above. You may have to test a few different files but I suspect you will find one or two work most of the time. Put the .ir files in the “SD Card/Infrared” folder and you can access them from the Infrared menu of the Flipper.

I guess I’ll find out once I download them and start digging in but do those files carry the codes for all buttons or just the power/mute/volume/channel buttons?

It depends on the file. Some has just power, some has more …
Just open them and look for the line name: .

It looks like:

Filetype: IR signals file
Version: 1
#
name: Button_1
type: parsed
protocol: NECext
address: EE 87 00 00
command: 5D A0 00 00
#
name: Button_2
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 504 3432 502 483 500 484 510 502 502 482 501 485 509 1452 504 1458 509 1452 504 481 501 474 509 3420 503
#

Source: flipperzero-firmware/InfraredFileFormats.md at dev · flipperdevices/flipperzero-firmware · GitHub

If you still need this specific question answered…possibly. If you can get an IR read on the buttons you can, what does the Flipper say the protocol/encoding is (NECext, SIRC15, etc)? I may have an idea or two.

Edit: I re-read the original post. So do the hotel TVs have a remote at all?

I am working on this topic as well. Even if I can’t answer he question itself, I hope my analysis so far helps t get there.

I am not sure if we confusing protocol and brand here. A brand can use multiple protocols, and a protocol can be uses by many brands. A n:m relation.

One advantage of the given .ir files is: They are many.
On of the issues of the files are: They are many.

I really don’t ant to open every file itself. So I wrote a importer ‘IRDB2SQLite’.
At first it was a good idea, but since I imported more an more, the 125MB file becomes unhandy. Maybe I’ll need to switch to another DB.

For this analysis we only need type: parsed, so it is good enough to start:
Logic: Take all parsed buttons, filter by brands ‘Sony’ and ‘LG’, filer by button name ‘Power’ and count these.

SELECT DISTINCT
	irf.brand
	,irb.protocol
	,COUNT(btnt.button)
	
	FROM irfile irf
		JOIN irbutton irb ON (irf.md5hash = irb.md5hash)
		LEFT JOIN btntrans btnt ON (btnt.name = irb.name)
	
	WHERE irb.type = 'parsed' AND irf.brand IN ('Sony', 'LG')
		AND btnt.button = 'Power'
	GROUP BY irf.brand,irb.protocol,btnt.button
	ORDER BY brand,protocol

Result:

brand protocol COUNT(btnt.button)
LG NEC 21
LG NECext 44
LG Samsung32 11
Sony NEC 1
Sony NECext 79
Sony SIRC 28
Sony SIRC15 9
Sony SIRC20 2

Now we know, we can start for Sony and LG with Protocol NECext.

In the next step we could analyze the fields address: and command: to get a feeling of a pattern.

My project: Flipper-IRDB to SQLite3

2 Likes

This is absolutely fascinating, LupusE! I’ve been casually looking through the forum and you and jmr are prolific! Love your work!

2 Likes

Thanks for the nice words. it is good to hear that someone is reading my little notebook here :wink:

While walking the dog, I’ve made some further thinking. But I am not sure if I am still on track.

I wanted to know the most common address/command pairs for the both above mentioned brands:

SELECT DISTINCT
	 irf.brand
	,irb.protocol
	,substr(irb.address,1,2) as address
	,substr(irb.command,1,2) as command
	,COUNT(irb.address+irb.command) AS cnt_adrcmd

	FROM irfile irf
		JOIN irbutton irb ON (irf.md5hash = irb.md5hash)
		LEFT JOIN btntrans btnt ON (btnt.name = irb.name)
	
	WHERE irb.type = 'parsed' AND irf.brand IN ('Sony', 'LG')
		AND btnt.button = 'Power'
	GROUP BY irf.brand,irb.protocol,btnt.button
	ORDER BY brand,protocol

Result:

brand protocol address command cnt_adrcmd
LG NEC 04 08 21
LG NECext 34 87 44
LG Samsung32 10 1E 11
Sony NEC 01 02 1
Sony NECext 01 15 79
Sony SIRC 10 15 28
Sony SIRC15 10 15 9
Sony SIRC20 5A 15 2

Now I would be interested in nearer analysis of `Sony NEC 01 05’ and ‘Sony SIRC20 5A 15’. maybe these are different device types.

It is also interesting to take a independent look, if there are common values to see:

SELECT DISTINCT
	irf.brand
        ,irb.protocol
	,(SELECT DISTINCT GROUP_CONCAT(substr(irb.address,1,2))
		FROM irbutton irbi
		WHERE irbi.md5hash = irb.md5hash
	 ) AS iraddress
	 ,(SELECT DISTINCT GROUP_CONCAT(substr(irb.command,1,2))
		FROM irbutton irbi
		WHERE irbi.md5hash = irb.md5hash
	 ) AS ircommand
	
	
	FROM irfile irf
		JOIN irbutton irb ON (irf.md5hash = irb.md5hash)
		LEFT JOIN btntrans btnt ON (btnt.name = irb.name)
	
	WHERE irb.type = 'parsed' AND irf.brand IN ('Sony', 'LG')
		AND btnt.button = 'Power'
	GROUP BY irf.brand,irb.protocol,btnt.button
	ORDER BY brand,protocol

Result:

brand protocol iraddress ircommand
LG NEC 04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,04,6E 08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,08,14
LG NECext 34,B4,DF,B4,10,F0,00,6E,6E,04,2C,04,04,04,01,01,04,00,04,2D,2C,6E,6E,2D,2D,2D,04,04,2D,04,04,6E,01,01,04,04,00,6E,2D,2C,04,81,10,10 87,F3,EF,F3,FE,4A,0C,14,14,08,1E,08,08,08,1C,1C,08,0C,AD,30,1E,14,B8,30,75,76,08,08,30,08,08,7D,1C,1C,08,08,0C,B8,30,1E,08,81,00,00
LG Samsung32 10,2D,2C,2C,2C,2C,2C,2C,2C,2D,10 1E,30,1E,1E,1E,1E,1E,1E,1E,30,1E
Sony NEC 01 02
Sony NECext 01,11,39,51,06,01,1A,11,11,11,83,0F,B7,17,1A,1A,01,1A,10,1A,30,1C,1C,1C,1A,01,01,01,02,1A,04,0F,0F,0F,01,11,39,51,01,01,01,02,02,02,83,0B,1A,54,54,54,10,1A,83,04,1A,0B,1A,1A,B7,B7,B7,1A,1A,1A,54,54,19,02,02,0B,0B,07,07,1A,44,0F,17,1A,01 15,15,15,15,15,15,15,15,2E,2F,00,15,15,15,15,15,15,15,15,15,15,15,2E,2F,15,15,15,15,15,15,01,15,2E,2F,15,15,15,15,15,2E,2F,15,2E,2F,00,15,15,15,2E,2F,15,15,00,0C,15,15,2E,2F,15,2E,2F,03,15,15,15,2E,15,15,2E,15,2E,15,2E,15,15,15,15,15,15
Sony SIRC 10,10,10,01,10,10,0F,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,0B 15,15,15,15,15,15,15,15,15,15,2E,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
Sony SIRC15 10,30,30,30,30,30,10,30,54 15,15,15,15,15,15,15,15,15
Sony SIRC20 5A,5A 15,15

To be honest, I performed the analysis the other way around. As I’ve seen a lot of doubles, I just started to count them.

and while i write these lines, I remembered, I have hat the ‘category’ already in my database:

SELECT DISTINCT
	 irf.brand
	,irf.category  # Just add this line
	,irb.protocol
[...]
brand category protocol address command cnt_adrcmd
LG Miscellaneous NEC 04 08 21
LG NULL NECext 34 87 44
LG DVD_Players Samsung32 10 1E 11
Sony Audio_Receivers NEC 01 02 1
Sony Unknown_870 NECext 01 15 79
Sony Audio_Receivers SIRC 10 15 28
Sony Audio_Receivers SIRC15 10 15 9
Sony Blu-Ray SIRC20 5A 15 2

TV is a little underrepresented … maybe I need to start all over.