Sunday 23 February 2020

Kogan Smart Plugs

The Physical Device

These are piggyback plugs with a toggle button, on-off LED (ring around the button) and status LED. They plug into a wall, with the device you want to control plugged into the back, which can be switched on and off by the button, or you can use the smartphone app.

The Smarts

The Wi-Fi module for this device comes from Tuya, along with the app and server infrastructure.  In addition to off/on functionality, the app also provides you with power consumption information, and timer and more complex programming capabilities.   The smart automation gives you access to data from other Tuya based devices you own, Weather, Sunset/Sunrise, Location, so fairly complex automation is possible. Location is from the smartphone, which could be useful to turn things on when you are arriving home, and off when you are leaving, provided you live alone.  Anyone with a family or flatmates though probably needs a presence detection that covers multiple people, which this does not provide.  The app also interfaces with Alexa and Google Home, as well as IFTTT, to provide access to basic functionality and automation scenes.

The Details

To free yourself from the Tuya ecosystem, you first need to know more details about how the device is wired internally.  This applies whether you are using something like tuyapi to control the device without changing the firmware, or reflashing alternate firmware like Tasmota or ESPHome.

Saturday 1 February 2020

Tuya smart devices

Over the past year, I have collected a number of smart home devices, the majority of which are based on the Tuya platform.
Here is some of what I have learnt about these devices.
  1. The apps are all compatible.
    If you buy a new device, it is worth checking whether it works with the app you already have installed before installing yet another brand specific app on your phone.
  2. The features are defined by the device, not the app.
    I bought two heaters, the first branded by Kogan, the second by Goldair. The Kogan heater had full automation enabled, the Goldair heater app worked only as a remote control and for setting simple off/on timers. On seeing that the apps had identical UIs apart from color scheme and available features, i thought to try the Goldair heater with the Kogan app. It worked, but the Goldair heater was still unavailable in the automation UI, and interestingly, the Goldair color scheme was still used to display the Goldair heater.
  3. Tuya also publishes their own brand app.
    I ended up switching away from the brands own app on the assumption that Tuya's own app should have the full feature set (the Goldair one was missing the automation UI completely, though I never tried using the Kogan heater with it, so it may have just been hidden due to no paired devices supporting it). It also gets updates before the branded apps, but from what I saw during the few months I kept multiple apps installed, it is only a couple of weeks ahead at most.
  4. Local control is possible

Tuesday 2 September 2014

More remote control decoding

Astro have now retired their old decoders, which I spent some time a few years ago trying to control from my PC. It seems at least someone has found a use for that info, but from reading the thread, what they actually wanted was the remote codes for the latest generation Samsung decoders that Astro replaced all the old decoders with.
In the public interest then, here is an updated LIRC config, and additionally a kernel rc configuration file for the Samsung Astro Byond decoders. Be warned: the kernel rc configuration is using standard key codes, including KEY_POWER, which may cause your PC to shutdown in many default configurations of GNU/Linux desktops - where all available input devices are grabbed by X. Changing to KEY_POWER2 might help with that particular problem - but unless you configure X to ignore the remote control, you'll still see side effects from other keys.

Sunday 24 August 2014

Android Studio - a frustrating experience in usability

Lately Eclipse has become excessively slow and unstable. So I decided its time to take a look at Android Studio.
I downloaded, and installed with the default settings - mistake number one, as I found out later. Startup took forever, just like Eclipse. I created a new project, choosing the Settings Template, as I know I'm going to need a Settings page for this app, which also took forever. When it eventually finished, there was an error about gradle failing to sync...so basic operations like editing and compiling will not work. WTF! So about half an hour of poking around and searching the net later, I find that my proxy got set when I installed, but today I'm working from home. Apparently some of the other slowness is attributable to that too, as it seems much more responsive when I have disabled the proxy.
Advice #1: When designing software, use the system proxy settings, don't introduce your own. People move between networks, and they shouldn't have to reconfigure a dozen separate places when they do.

Friday 12 April 2013

Astro xmltv listings

For quite a while now, I've been pulling TV listings from the Astro website. At first this involved scraping some HTML and the scripts I had were pretty ugly and worked only for the channels I wanted. Then they added some RSS feeds, which made the scraping a bit easier and less prone to breaking every time they updated the look of the website (which was often). For a couple of years now, the RSS feed has been replaced with a JSON API, and I had a pretty good grabber written for that, but never got around to sharing it. Recently they switched to a dedicated server for the JSON API, and gave it an overhaul, so my script stopped working. Now that I've updated it to the new API, its a good time to share.

Thursday 29 July 2010

Remote Control

I eventually gave up on the idea of trying to prod the serial port on my Astro STB and bought a cheap IR transceiver from some guy in Hong Kong via ebay. My first attempts at learning the remote codes were frustrating - irrecord complained about something being wrong after incorrectly guessing the settings, and when I finally got some codes learned, I found that a lot of the buttons had the same code, so 2, 6 and 8 were all being detected as KEY_2. Eventually I started trying to manually configure the basic settings based on some of the standard protocols, and eventually hit on RCMM-32, which learned all the codes and can reliably detect them when I press the buttons on the remote.

So now the codes are learned, along with the codes for the extra buttons for controlling a Panasonic DVD player on the bottom of my TV remote, which have now found a use giving basic control of Freevo in case the wireless keyboard, bluetooth equipped mobile phone or one of many wifi equipped gadgets is not close at hand.

Next step is to go the other way and send the codes out to the STB. The transceiver doesn't seem to be sending anything out at all. I still haven't narrowed down the problem, it may be a faulty IR LED, or an incompatibility between the transceiver (MCEUSB gen 1) and the software driving it (LIRC 0.86). Now that I have the remote codes, it might also be a good time to go back to trying the serial link, but that'll have to wait for another night. For now, I'll just post up the Astro remote codes, in case anyone else is struggling to get them working with LIRC.

Thursday 18 March 2010

Controlling my STB

My latest experiment is to see if I can control my Astro decoder via the serial port on the back, so I can have Freevo record from different channels (currently I'm mostly recording the kids shows from NHK that are on in the middle of the night, so we have to remember to leave the decoder on channel 963 each evening). There is of course no documentation about the serial port anywhere on the net, but a few US set top boxes have been hacked, so there is some hope.

What I know after an hour of poking around: