Monday, September 30, 2019

An overview of Join

This is like a messaging app, by the same developer of Tasker. If you want to know more about Tasker click here. PushBullet comes close to what Join does.

Here are some of the things you can do between two join devices:

1. Paste clipboard from one device to another
2. Send text notes from one to the other
3. You can send a URL from one device to the other. If the latter device happens to be a phone/browser, it will open a new tab with the URL
4. Send voice messages. You can write text on one device. It will be played over at the other end.
5. Send files...

It is possible to run custom actions. Join actions are different from Tasker. They are limited to messaging. A good example is doing a broadcast message to all devices.

However, Join also registers as a Tasker plugin. Which means you can do all of the above from Tasker.

For e.g. I use a combination of Tasker & Join to control my music playing experience.

You can also make other devices talk to join devices. Almost all common APIs are exposed over HTTP. So for something running in a raspberry pi device, all it needs is to make a http request (cURL) to the http api to get a message across.

An overview of Tasker

These are two cool android apps. But they are paid apps. However, I think buying them would prove worthy - you won't regret it. They help in a lot of home automation use cases.

What is Tasker?

This android app helps us to automate many aspects of the android phone. For e.g.

1. Automatically turn down brightness from 9pm to 7am, and, put the phone in silent mode, and, also turn on dark mode on the phone.
2. You can program your phone to show you a popup message with the content from an SMS received from your loved one...
3. You can make tasker search your sms and report your latest bank balance!

How does tasker do this?

Sparing all the intricate details, there are three high-level concepts at work...

1. Actions
2. Tasks
3. Profiles

Tasker Actions

They are what they are - actions. An action is something tasker can do. It can be broadly classified into three categories:

1. Actions that change some system setting or state. For e.g. set volume level, reject call, running an app, writing to a file, setting the alarm, clearing notifications, etc...
2. Actions that can help in networking. For e.g. make http requests, or, mqtt, etc.
3. Actions meant for notifications or interactions - toast messages, creating notifications, vibrating the phone, popups, etc.

So actions in a way are basic - they do one thing.

Tasker Tasks

A task combines multiple actions.

Tasker allows you to run tasks standalone or via means of a profile which is explained in the next section.

When running standalone tasker allows you to make shortcuts (or widgets) that you can place in your home screen. This is powerful - imagine having a task that can for instance talk to your home automation system and toggle your living room light switch...now you are controlling your living room light with your phone!!!

Tasker Profiles

A profile is a context for a task to run. A profile could be a combination of an event (like SMS message received), phone gesture, time, battery level, etc...For e.g. if you wanted your phone to turn on darkmode everday after 9pm you'd use a profile with one such "time" constraint. The associated task is the one that does the corresponding action. So as far as this small example goes, the profile is what triggered the specific task.

Tasker Plugins

Tasker has a finite set of actions and profile events. They can be extended with something called Tasker Plugins. For e.g. mqtt is something tasker doesn't provide out-of-the-box. However, there are tasker plugins which enable that feature for you. Now if you needed to send a mqtt message to some other device, you can find that specific action...Similarly tasker can respond to mqtt messages as well. There are plugins that enable this specific feature alone.

AutoApps

This is another app by the same developer. There are a number of tasker (3-rd party) plugins available today. This is a one-stop interface to get all those official tasker plugins.

Conclusion

I do recommend you explore this app. You will get hooked on to it very quickly.

Friday, September 27, 2019

Are you home power supply conscious?

Ever wondered if there is electricity at your house while you are at work? We used to live in an area of frequent power cuts. Sometimes they would take hours to come back on. And sometimes, it was simply human error: the meter reader would simply remove the fuse for the wrong apartment. In either case, my poor mother, would wait, hours on end, for it to come back on...
Hence I built a small android app using Google spreadsheet, and, Google Scripts.
That solution involved posting a "heartbeat" at a regular interval from the app. They were logged in a spreadsheet. The app at some regular interval, would get the records and there was some code written to find out if the last recorded heartbeat was quite long ago (say 15 minutes). If so, notify...
The highlight of that solution though was about recycling your old android phone which could be lying around with no real purpose other than accumulate dust.

Tuesday, September 24, 2019

Controlling your breadboard LEDs through Alexa

I am so into IoT these days. But the rate of experiments I do are small. Mainly because of travel, being stuck with something, failed experiments, blah blah blah...

But so far the journey is enjoyable. Today I thought why not show-off a bit. So here is a small wifi chip (wemos d1 mini) which is flashed with something called tasmota. (An amazing software). There are two LEDs connected to a resistor (330 ohm) (in series).



In the interest of DIY and brevity I won't detail how I did this through long and many-step instructions. But here is a gist of what I did. You may follow the images and video shared at the end of post.

1. Downloaded the latest release of Tasmota binary called sonoff.bin from the github repo
2. Flashed it onto the d1 mini using software called esptool.py (Other alternatives available).
3. Configured tasmota to connect to my home wifi router
4. Selected the appropriate device tasmota has to emulate. (Generic module).
5. Configured two GPIO pins as "relays" (on tasmota)
6. Configured friendly names and,
6.1 Enabled hue emulation (important) on tasmota
7. Ask Alexa to "discover devices"
8. Had fun...

Checkout the video and images too. (end of post).

So whats cool here?

Most people are not seasoned enough to understand this much less appreciate it. This is why I encourage DIY. So I am going to just "dive in"...you should too...

1. I didn't have to use a raspberry pi...(on an earlier exercise - I did use one such device).
2. No coding or IDEs required. (Get started with a simple Arduino project. You'll know what I mean...).
3. Except for voice recognition (viz Alexa's job) everything is intra-network. (Try something on Google Home to see what I mean - I don't have a Google Home device yet ;) ). (It only matters if you are worried about data privacy).

Conclusions

I have demonstrated the principle of switch automation - automation of your house appliances or light switches...

"Alexa, turn on bed room light" or "Alexa, TURN OFF THE DAMN TV"...the possibilities are endless.

It may not be your cup of tea. But that still doesn't physically limit you from trying...

So...Learn...Ask about stuff...Get frustrated trying...Get things done...Have fun.

PS: Perhaps Google Home might evolve into something better...I am waiting for that day... :)