Taming a terrible soundbar with the power of IoT
How to make the user experience of a soundbar less terrible than the producer intended. Starring: Google Home and some Chinese WiFi IR remote.
I don't like to spend more money than necessary, especially on things that do the job pretty decently. This was my mindset as well when we bought our TV, a 55' rectangle made somewhere in China and rebranded by Kogan.

One of the common issues with cheap TVs is the quality of the sound—it's not as rich as it should be, especially when contrasted how good the picture is on this device. Therefore the next immediate purchase was a soundbar—again, made somewhere in China and rebranded by Target.

The soundbar plays good enough music, but has a few "user experience" issues. Firstly, it's very hard to turn it in on. The remote has small, hard to press buttons, and sometimes the infrared light is not detected by the soundbar properly, so it takes a few attempts. Unfortunately, this model does not have the HDMI pass-through support, so it can't turn on automatically when the TV turns on. When turned on, it waits for an unspecified number of seconds (between 2 and 4) before becoming responsive. On top of that, it always turns on in the Bluetooth mode, and every time we have to switch it to the "RCA" mode (whatever that is) to play the sound coming over the cable. Last but not least, it doesn't remember the previous volume levels after being turned off.

All of these issues combined are too annoying to ignore them, but not major enough to spend a lot of dollars on a new soundbar, which this time would have HDMI pass through. And after it's turned on, the issues are gone. So for the past two years we didn't bother upgrading.
Google Home
I was gifted this bad boy for my birthday this year:

Powered by Google Assistant, it can react to simple prompts and commands (apparently majority of users use Google Home to learn about current weather). The interesting aspect, however, is its ability to automate devices in your home. In other words, being a smart home's hub.
On the same day I got it, we went to a nearby store and purchased these:

Smart plugs (electric plugs that are connected to the WiFi network and can be controlled over the Internet) can turn simple and dumb devices like floor lamps into… well, smart devices. We connected our lights in the apartment with these, and now we can turn all of them on and off with a voice command. What's more, when we say "good night" to our new roommate, it'll run a special routine, part of it being turning all the lights off. Last but not least, currently lights are also turning on automatically at sunset. Woohoo!
But let's get back to the soundbar.
Controlling the soundbar over the Internet
Our soundbar is a dumb device controlled with a infrared remote. If only there was something that could imitate a remote and worked with Google Home…
Turns out some smart people thought about this already, and you can get this black, round gadget for about $20 on eBay.

It can beam the infrared signals all over its surroundings and imitate quite a few remotes for a lot of devices. Mainly TVs, air conditioners and DVD sets. It also has the DIY mode, where it captures the signal sent from the remote and records it.

Now I can turn it on from this app. Great! But you don't simply turn out soundbar on: you need to turn it on, wait for a few seconds, turn on that RCA mode, and then increase the volume. So the next thing to do is to configure a scenario, in the same home automation app:

Now one button is pressed, and several seconds later the soundbar comes to life, in a state that can play sounds. But that's not the end: I don't want to use the app, I want to tell my Google Home to turn the soundbar on or off.
IFTTT to the rescue! It stands for "if this then that" and it's an online service that can invoke various triggers when various inputs happen. In my case, it's easy to connect the Google Home input (a voice command) with the Tuya Smart trigger (a scenario).

How does success look like?
Exactly like this:
The process is now slightly longer than before, because instead of simply pressing the button on the remote, We have to activate Google Home, say the phrase, wait for it to contact the Google servers, then wait for it to speak with the IR remote (through different servers), and then it's a few more seconds until the scenario is executed.
But the gain is that we don't need to find and interact with that unresponsive remote, and we don't need to buy new soundbar. Moreover, saying the voice command takes much less time than operation the remote, and after it's said we can focus on something entirely different.
And of course, it feels like living in the 21st century all those postcards imagined:
