Need to be able to turn off HDMI via IR remote button

Hi,

I understand that the Vero 4K is designed to be left on 24/7. However, for me this poses a problem. I have multiple HDMI sources connected to an auto-sensing switch, and it works much better if the HDMI sources I am not using can be turned off. I’d like to be able to do this with an IR command (or a sequence of IR commands) so that I can control whole setup from my Harmony Elite, not by having to navigate a menu.

Thanks,
Dave

See Custom Script on custom remote key[Remote app]

You can toggle the HDMI PHY:

echo 0 > /sys/class/amhdmitx/amhdmitx0/phy (off)
echo 1 > /sys/class/amhdmitx/amhdmitx0/phy (on)

Sam

Thanks - there are no R/G/B/Y or unused keys on the Vero 4K device on the Harmony, so I’d need to have the hex codes for those R/G/B/Y keys to get Logitech to add them to the device in their database. Do you know where I can get those IR codes from?

You can use any profile with the Harmony, and select the remote from My OSMC. Most people use the Xbox 360 version for example as it has more buttons.

That sounds like a plan - I’ll have a play over the weekend! Thanks.

OK, so I can turn the HDMI op on and off using that command from an SSH terminal logged in as root (doesn’t work using sudo) and I’ve changed the remote type to Xbox-360. However, using irw show that all the buttons have a useful definition in one or more modes, and I need two unused codes so that I can use these buttons regardless of what mode I am in. The only spare buttons on the Xbox remote are “on” and “off”, which send IR signals but there is no corresponding output from irw.

I’ve been readin the kodi wiki on LIRC, but I can’t find anywhere that explains how to add these undefined buttons.The is no keymap or remote.xml file in ~/.kodi/userdata. There is a keymaps subdirectory but that is empty.

I’ve found lreferences to how to map remote buttons to kodi buttons, and how to map the kodi button to a function, but none of them seem to match the version i have. I’ve found Lircmap.xml in /usr/share/kpdi/system, which has a remote device definition for “Microsoft-Xbox”. I can’t find an “lircd.conf” anywhere, so I’m a bit stumped.

Any pointers would be very welcome,
Thanks

edit: I’ve just found /etc/lirc/xbox360-lircd.conf. If I can find the hex codes sent by those on and off buttons, can I add those definitions to that; alternatively, should a create a copy of that file with the additions in somewhere below osmc home directory and leave the original untouched?

Use sudo tee, not sudo echo and it will work.

If LIRC isn’t picking it up, then you’ll need to resolve that before the keys can be mapped in Kodi.

lircd.conf can be placed anywhere, but is usually under /home/osmc. Using irrecord you can record your own profile.

Sam

sudo tee doesn’t work either - permission denied.

I shutdown kodi (I tried to do it from the kodi Power->exit menu entry, but it just freezes and then reboots, I had to use systemctl on the command line) and tried to use irreccord but it complains that it cannot access the device (lirc0 i presume?). It suggests that lircd may be running - there seem to be several lirc related processes and some of them restart themselves if you kill them. How do I shut it all down so that I can use irrecord?

Thanks.

What command are you running? Try:

echo 1 | sudo tee /sys/class/amhdmitx/amhdmitx0/phy

When calling from Python, you don’t have a shell, so you need to be careful with pipes, i.e. /bin/sh -c "echo 1 | sudo tee /sys/class/amhdmitx/amhdmitx0/phy"

sudo systemctl stop lircd_helper@lirc0

Kodi is meant to relaunch itself if you exit it, unless you press ESC on a keyboard within a few seconds.

I was just replacing the echo with tee, i.e. sudo tee 0 > etc. Doing it your way works (why??).

Thanks for the correct command to shutdown lirc.

re exiting Kodi - and it didn’t occur to the developers to pop up a message to that effect? How are we supposed to know? We used to call that a COIN - Clear Only If kNown. Ye Gods!

It is in the manual :wink:

As you’ll see from OSMC’s splash screen etc, we try and avoid English / written text as we have a lot of international users. Maybe there is an elegant way we can depict this without using words.

Finding stuff in the manual is also COIN. Also, this doesn’t work - I just tried it.

I see nothing here about needing to press esc on a keyboard! I searched on many different terms and this is the only reference to shutting down kodi that was returned:

6 Shutdown menu

Pressing S on the keyboard, or by selecting the Shutdown icon in the lower left corner of the default Estuary skin the home screen brings up the shutdown menu.
Estuary-power-menu.jpg

The options on this menu are from top to bottom:

Exit
Exits Kodi to your operating system.
Power off system
Powers down your system
Custom Shutdown Timer
Kodi will shutdown your computer after you enter the countdown time.
Suspend
Suspends your computer.
Hibernate
Hibernates your computer.
Reboot
Restarts your computer.

See Accessing the command line - General - OSMC.

If you have command line access already (SSH), then you don’t need to connect a keyboard for local access.

Vero is down in the cinema, PC with SSH is in ithe office. I’ve taken the vero to the office and managed to get codes for the on and off buttons but they are nothing like the codes in the xbox_360lircd.conf - the two codes are 0x15 and 0x16, the codes in the .conf are in the form 0Bxx.

I think I’m going to give up, I want to spend my spare time watching my films, not fighting a piece of software, and the C200, 9 years old, just works.

If you use irrecord, it will create a complete button map for you.

it works for one or two buttons and then complains there is no toggle but it knows RC6 has toggle. It’s just more trouble than it’s worth.

Thanks for the help.