Hi all, this discussion helped me a lot during the last few days in getting this device almost completely working and integrated with HA. Thanks everybody, but in particular all the people who made all of this possible in the first place. Just sharing my experience here. I took off using tuya-cloudcutter, which now supports this device without opening it. I had it opened before, since when I started, it was not yet even mentioned, thus I actually also produced a dump of the original firmware. However, when trying to generate a profile the bktools then still complain about missing data, which is a bit annoying, since I was not able to find how to get that as well. Anyway, since it is now supported, I was able to skip that step and upload version 1.15.272, which first did not work, but after a bit of fiddling and actually uploading it through the serial USB dongle it was all fine. Next step was then to check what to do to get it integrated with HA. I ended up playing around with the custom component SmartIR, which does provide sub-classes of media-player, climate and fan devices. That's neat, but for some things not really required. What I wanted to achieve was the following:
- Control at least on/off and potentially volume of our really old Samsung TV, which only has IR.
- Synchronize state with the connected Googlecast device already on HA as a media device.
- Synchronize state with an Amp which is switched on/off by a WIFI controlled power switch and already on HA.
- Allow switching using the HA web I/F, but also using a really simple IR remote. This allows people to switch on the setup without touching HA and start streaming content from their phones. The remote I ended up using was an old Apple Front-Row, which only has two buttons and a four way cursor and a centre button.
Using the logs tab of the flashed IR blaster OpenBK7231T_app web page I decoded all the relevant IR codes for the Samsung TV and the Apple remote and mapped them to MQTT commands of the TV using SmartIR with the provided MQTT integration. I just had to provide the IR codes in a JSON file and change the SmartIR config to read that. After that I had a new media-player representing the TV. Here is the JSON file for the Samsung TV:
{"manufacturer":"Samsung",
"supportedModels":[
"HomeTV"
],
"supportedController":"MQTT",
"commandsEncoding":"Raw",
"commands":{
"off":"Samsung 0x707 0x2 2",
"on":"Samsung 0x707 0x2 2",
"previousChannel":"Samsung-707-10",
"nextChannel":"Samsung-707-12",
"volumeDown":"Samsung-707-B",
"volumeUp":"Samsung-707-7",
"mute":"Samsung-707-F",
"source":"Samsung-707-1",
"sources": {
"Input":"Samsung-707-1",
"Channel 0":"Samsung-707-61",
"Channel 1":["Samsung-707-61","Samsung-707-61"],
"Channel 2":["Samsung-707-61","Samsung-707-61","Samsung-707-61"],
"Channel 3":["Samsung-707-61","Samsung-707-61","Samsung-707-61","Samsung-707-61"],
"Channel 4":["Samsung-707-61","Samsung-707-61","Samsung-707-61","Samsung-707-61","Samsung-707-61"]
},
"up":"Samsung-707-60",
"down":"Samsung-707-61",
"right":"Samsung-707-62",
"left":"Samsung-707-65",
"exit":"Samsung-707-2D",
"return":"Samsung-707-58",
"menu":"Samsung-707-1A"
}
}
The channel part is a bit of a trick, because the TV does only allows toggling through the sources. I also have the code for the HA automations, but I'm still experimenting with those. Quite happy already with the result.
Also tried to add a DAIKIN aircon, but for some reason the irblaster does not recognize the codes sent by the remote. Will have a look at that later.