The holiday season is really what excites me whenever I am stressed due to work and studies. The holiday season is generally considered to run from late November to early January. Why not take a tour of the city or visit new places and see all the highlights that the town provides. Often we miss some famous destinations while exploring all places owing to the speed at which the tour goes, slowly detailing all landmarks on the track (sometimes unpredictable weather too). So what came to my mind was a simple solution to solve this problem. The Holidays Traveller device aims to get through the landmarks at your pace, just connect it to the network.

The device will automatically detect the location-based upon IP address, weather updates and nearby famous locations and brief summary and send those updates via email and SMS on our mobile to make sightseeing more interesting.


The device is built using Tuya Cloud SDK, this Tuya project use-case can help developers think and innovate for the tourism industry - especially in marketing your product or whatever. Imagine such innovative use cases - sending an alert to users when they arrive at a particular location and suggesting they visit famous parks, restaurants, buildings, etc.

What is Tuya, exactly?

Tuya Smart is a global IoT development platform that builds interconnectivity standards to bridge the intelligent needs of brands, OEMs, developers, and retail chains across a broad range of smart devices and industries.

Based on the global public cloud, Tuya connects different intelligent scenarios and smart devices by providing hardware development tools, integrating public cloud services, and offering an intelligent business development platform.


$ pip install tuya-iot-py-sdk

Setting up Tuya Cloud Account and Project:

After signing up, you will head over to the dashboard. From there, go to 'Cloud' and create a project inserting the following information.

Authorize the required APIs ( we are going to need weather, location, email and SMS API)

1 / 2

Tuya Cloud API

Most importantly you will need ACCESS_ID and ACCESS_KEY to work with APIs

from tuya_connector import (
ACCESS_ID = "*************123"
ACCESS_KEY = "*************56565"
API_ENDPOINT = "https://openapi.tuyain.com"

# Project configuration
USERNAME = 'youremail@mail.com'  # email address or phone number
PASSWORD = 'yourpassword'

# Initialization of tuya openapi
print(openapi.connect(USERNAME, PASSWORD))

If everything is correct you will get no error codes and good to proceed to other steps. We are going to need our location data in order to use Tuya Weather APIs, so we will first get our IP address and then find out our coordinates using Tuya LBS service APIs. After getting the geocoordinates we will use Wikipedia API to search for landmarks and summaries.

# Device IP
url = 'http://ipinfo.io/json'
response = urlopen(url)
data = json.load(response)
IP = data[ 'ip' ]

# Get location of device through IP
location = openapi.get(f'/v1.0/iot-03/locations/ip?ip={IP}')
location = location[ 'result' ]
latitude, longitude = location[ 'latitude' ], location[ 'longitude' ]

Now we will get the weather data for our location using weather API

weather_url = f'/v2.0/iot-03/weather/current?lat={latitude}&lon={longitude}'
weather = openapi.get(weather_url)
condition = weather['result']['current_weather']['condition']
air_quality = weather['result']['air_quality']['aqi']
print(condition, air_quality)

Now we will construct the message, but before that let's explore the Tuya SMS and Email APIs,

sent = openapi.post("/v1.0/iot-03/messages/mails/actions/push", dict({ "to_address": "hello@gmail.com", "template_id": "MAIL_1624531323", "reply_to_address": "hi@gmail.com"}))...
Read more »