Joseph-Ladino / geeni-mqtt

Control geeni devices through mqtt topics (with optional home assistant discovery)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Geeni Mqtt

This library(?) uses TuyAPI and mntt to control certain Geeni/Merkury devices (and probably other Tuya products but I only own walmart smart products) I currently only support these Smart Plugs, Smart Light Switches, Smart 3 Way Light Switches, and Smart Bulbs

Why'd you make this, surely there are other libraries?

Well, in my very brief research I didn't find one that I liked, and I had a week off of school and also just felt like making something so here we are

So why should I use it?

You probably shouldn't, but if you just want questionable boilerplate code that can be somewhat easily extended, this might be the least wrong repo for you

Alright but how do I use it?

(An example of setting up different devices can be found in index.js)

  1. Follow TuyAPI setup to get the ID and Localkey of a device
  2. (if using mqtt) rename mqtt_broker.conf.template to mqtt_broker.conf and fill in the info
  3. Import a class from one of the folders (mqttDevices for controlling through scripts and mqtt, or tuyaDevices for just controlling through scripts)
  4. Create an instance, passing the ID and Key in as arguments
  5. Call the connect method

Note: When using mqtt, call connect after the mqtt client has connected to the broker, see index.js

About

Control geeni devices through mqtt topics (with optional home assistant discovery)


Languages

Language:JavaScript 100.0%