Skip to content

Instantly share code, notes, and snippets.

View debsahu's full-sized avatar
🐺
meh

Debashish Sahu debsahu

🐺
meh
View GitHub Profile
@debsahu
debsahu / HAColorSensor.ino
Created April 7, 2018 04:32
ESP8266 reading from TCS34725 Color Sensor and changing RGB Colors in Home Assistant
#include <ColorName.h> // https://github.com/debsahu/ColorName
#include "Adafruit_TCS34725.h" // https://github.com/adafruit/Adafruit_TCS34725
#include <SSD1306.h> // https://github.com/ThingPulse/esp8266-oled-ssd1306
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <Bounce2.h> // https://github.com/thomasfredericks/Bounce2
//#include "secret.h"
#define BUTTON_PIN 0
#ifndef SECRET
@debsahu
debsahu / HA_RTLAMR.yaml
Last active February 14, 2024 00:58
RTLAMR: RTL-SDR to read electric/gas/water meters
shell_command:
rtlamr_start: 'python3.6 /home/pi/work/rtlamrmqtt.py'
kill_rtlamr: 'pkill -f rtlamr'
automation:
- action:
- data: {}
service: shell_command.rtlamr_start
alias: Start RTLAMR Script
condition: []
/*
* ATtiny85
* -------u-------
* RST - A0 - (D 5) --| 1 PB5 VCC 8 |-- +5V
* | |
* A3 - (D 3) --| 2 PB3 PB2 7 |-- (D 2) - A1 --> 10K Potentiometer
* | |
* A2 - (D 4) --| 3 PB4 PB1 6 |-- (D 1) - PWM --> Fan Blue wire
* | |
* Gnd ---| 4 GND PB0 5 |-- (D 0) - PWM --> Disabled
#include <SparkFun_APDS9960.h> // https://github.com/SteveQuinn1/SparkFun_APDS-9960_Sensor_Arduino_Library
#include <SSD1306.h> // https://github.com/ThingPulse/esp8266-oled-ssd1306
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <HARestAPI.h> // https://github.com/debsahu/HARestAPI
// Pins
#define SDA_PIN D2
#define SCL_PIN D1
#define APDS9960_INT D3
@debsahu
debsahu / miflora.yaml
Last active September 11, 2020 14:46
Example yaml file for HA when using https://github.com/sidddy/flora with mac address 11:22:33:44:55:66
sensor:
- platform: mqtt
state_topic: "flora/11:22:33:44:55:66/temperature"
name: "Basil Temperature"
unit_of_measurement: "°C"
- platform: mqtt
state_topic: "flora/11:22:33:44:55:66/moisture"
name: "Basil Moisture"
unit_of_measurement: "%"
#include <Adafruit_DotStar.h>
#include <SPI.h> // COMMENT OUT THIS LINE FOR GEMMA OR TRINKET
#define NUMPIXELS 30 // Number of LEDs in strip
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DOTSTAR_BRG);
void setup() {
Serial.print("Hardware SPI using DATA PIN: ");
Serial.println(MOSI);
Serial.print("Hardware SPI using CLOCK PIN: ");
@debsahu
debsahu / rpi-rf_receive_mqtt.py
Created March 26, 2020 16:42
Modify rpi-rf_receive.py to send data to MQTT server
#!/usr/bin/env python3
import paho.mqtt.client as mqtt
import argparse
import signal
import sys
import time
import logging
import json
@debsahu
debsahu / esphome_dotmatrix_display.yaml
Last active November 9, 2023 17:04
ESPHome config for connected ESP8266 to MAX7219 Dot-Matrix Display to show useful information from HomeAssistant
esphome:
name: veneer_display
platform: ESP8266
board: d1_mini
wifi:
networks:
- ssid: !secret esphome_wifi_ssid1
password: !secret esphome_wifi_pass1
# - ssid: !secret esphome_wifi_ssid2
esphome:
name: entryway_ceiling_light
platform: ESP8266
board: esp8285
#arduino_version: 2.4.2
esp8266_restore_from_flash: true
wifi:
networks:
- ssid: !secret esphome_wifi_ssid1
@debsahu
debsahu / deck_lights.yaml
Created November 30, 2020 06:58
ESPHome settings for ESP32 that controls Deck LEDs
esphome:
name: deck_lights
platform: ESP32
board: lolin32
wifi:
networks:
- ssid: !secret esphome_wifi_ssid1
password: !secret esphome_wifi_pass1
- ssid: !secret esphome_wifi_ssid2