Open-source project inspired by the idea of "Long Distance Lamp"

Overview

Twin Lamps

Open-source project inspired by the idea of "Long Distance Lamp" (e.g. Friendship Lamps).
This makes two (or even more) bulbs blink at the same time using MQTT. Bulbs can be on different networks, they just have to be connected to the same MQTT broker.

Two Lamps Demo

What do you need?

You only need at least two Shelly bulbs. You don't need any soldering skills as the Shelly web-panel already provides a good interface for MQTT configuration.
You also need a MQTT broker to make the bulbs and the server communicate. I already configured Mosquitto for docker in this guide but you can also use other solutions (even cloud brokers).

How does it work?

The bulbs connect to the MQTT broker and subscribe to their topics. Also the server connects to the MQTT broker and publish on those topics.
The server also provides a web-interface to login and make the lamp blink at different light intensities.

Configuration .env

WEBSITENAME=Website name
HOST=Website url
PORT=Internal port of the web-interface
DOCKERPORT=External port of the web-interface (e.g. 8080)
LAMPS=Device ID list comma separated (e.g. xxxxx,xxxxx)
LAMPSTYPE=Shelly bulb type list comma separated (e.g. ShellyVintage,ShellyBulbDuo)
MQTT_HOST=MQTT broker address (e.g. test.mosquitto.org)
USERN=MQTT broker username (also used for the web-interface)
PASSWORD=MQTT broker password (also used for the web-interface)

How to use it?

Create a .env file as described above then do the following commands:

# Install typescript
npm install -g typescript
# Install dependencies
npm install --include=dev
# Run the server
npm run start

Now navigate to the web-interface on localhost:3000 (or the port in .env file) and login.

How to dockerize it?

You can use the Dockerfile to create a docker image or you can use davegabe/twin-lamps.
You can directly use the docker-compose.yml file in the root of the repository, it's configured to run davegabe/twin-lamps, the MQTT broker eclipse-mosquitto and use HTTPS protcol (by traefik configuration).
Mosquitto needs to be configured to allow authentication. Use the following command:

mosquitto_passwd -c mosquitto/config/mosquitto.passwd <username>

Now you're ready to run the docker image:

docker-compose --env-file .env up -d

TODO:

  • Add option to change duration of blink
  • Add option to set permanent status on/off
  • Add label count connected device or warning if not all devices are connected
  • Better authentication system for multiple users
  • Websocket to sync the lamp status on the web-interface
  • Multi-stage docker image

Screenshots

Here are some screenshots of the web-interface:

Example view on desktop

Computer - Home Computer - Login

Example view on mobile

Phone - Home Phone - Login

You might also like...

Participate in Hacktoberfest by contributing to any GitHub Open Source project! Here's a project for first-time contributors. #hacktoberfest

🎃 HacktoberFest Starter Project This project can be used to make your first contribution to an open source project on GitHub. Before you do the real

Nov 6, 2022

A recreation of a startpage posted on Reddit without the source, so I rewrote it in Next.js + Tailwind for the open source community.

Startpage "Figma Balls" Rewrite Why Did I Make This I saw a startpage posted on the subreddit r/startpages that I thought looked nice, but when I look

Mar 29, 2022

Let's participate in Hacktoberfest and contribute to open-source. Star the repo and open a PR to get accepted.

Let's participate in Hacktoberfest and contribute to open-source. Star the repo and open a PR to get accepted.

Let's Contribute To Open-source First Contributions This project aims to simplify and guide the way, beginners can make their first contribution towar

Dec 3, 2022

A Weather API project inspired by The Ultimate API Challenge / Weather API.

Weather API Project A Weather API project inspired by The Ultimate API Challenge / Weather API. Tech Stack: React.js Tailwind Axios Inspiration The Pr

Dec 29, 2021

Inspired by https://github.com/woochanleee/project-tree-generator

Project tree workflow Introduction Project tree workflow is automatically changes the project directory structure in your README.md or any text file.

Jan 2, 2023

In this project, I built a to-do list app, which is inspired by the minimalist website. Build withHTML/CSS & JavaScript best practices: Correct use of tags, elements, properties and syntax.

Webpack Exercise In this project, I built a to-do list app, which is inspired by the minimalist website. Built With HTML/CSS & JavaScript best practic

Oct 11, 2022

Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

It is a project I am trying to list the repos that have received thousands of stars on Github and deemed useful by the JavaScript community. It's a gi

Aug 14, 2022

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Sep 24, 2022
Owner
Davide Gabrielli
Davide Gabrielli
Shikhar 4 Oct 9, 2022
This is a project for open source enthusiast who want to contribute to open source in this hacktoberfest 2022. 💻 🎯🚀

HACKTOBERFEST-2022-GDSC-IET-LUCKNOW Beginner-Hacktoberfest Need Your first pr for hacktoberfest 2k22 ? come on in About Participate in Hacktoberfest b

null 8 Oct 29, 2022
It's a repository to studies. Its idea is to learn about Nx and its plugins.

StudyingNx This project was generated using Nx. ?? Smart, Fast and Extensible Build System Adding capabilities to your workspace Nx supports many plug

Open-ish 4 May 13, 2022
And idea that never worked but was fun while it lasted

THIS IDEA WAS FUN BUT IS DEAD NOW AND SHOULD NOT BE TRUSTED FOR ANYTHING!!! Authsio Core Core authsio web application for identity & access management

authsio 13 Oct 20, 2022
The idea is build an app that make me consult uber ride prices through my mi band or a smart watch.

CanIGetHome? - Get uber prices The main idea is the possibility to me to get the estimate uber rides prices through my mi band 6. Get my current local

Emerson 174 Nov 23, 2022
Moject is a IoC container and an app factory built around the modules idea of Angular and NestJs.

Moject Moject is an IoC container and an app factory package built around the modules idea of Angular and NestJs. Usage npm install moject Use @Mo

Alexander 4 Dec 4, 2022
GitHub and Markdown-Based CMS for Blogs. EXPERIMENTAL and in the "Idea" stage. I have no clue if this is feasible.

Turborepo starter This is an official pnpm starter turborepo. What's inside? This turborepo uses pnpm as a package manager. It includes the following

David Taing 2 Oct 13, 2022
Reference for How to Write an Open Source JavaScript Library - https://egghead.io/series/how-to-write-an-open-source-javascript-library

Reference for How to Write an Open Source JavaScript Library The purpose of this document is to serve as a reference for: How to Write an Open Source

Sarbbottam Bandyopadhyay 175 Dec 24, 2022
An Open-Source Platform to certify open-source projects.

OC-Frontend This includes the frontend for Open-Certs. ?? After seeing so many open-source projects being monetized ?? without giving any recognition

Open Certs 15 Oct 23, 2022
I built a full-stack project using Node, Express, Mongo, webRTC, socket.io, and of course React JS. This project is inspired by the awesome Clubhouse 😊

codershouse-mern - This Project is Under Development. Below are some of the implemented interface and the remaining features will be updated in future

Bishal Das 35 Nov 18, 2022