Skip to content

Instantly share code, notes, and snippets.

@boozeman
boozeman / esp32-p1reader.yaml
Last active March 29, 2024 15:45
ESP32C3 version of the P1Reader
# ESP32C3 (Seeed Studio XIAO) version of the P1 reader
# Look at https://github.com/psvanstrom/esphome-p1reader and get that p1reader.h from there
esphome:
includes:
- p1reader.h
name: esp32-p1reader
friendly_name: esp32-p1reader
platformio_options:
board_build.f_flash: 40000000L
@boozeman
boozeman / WIFIP121FWT.yaml
Last active February 19, 2024 11:33
ESPHome Configuration for Nedis WIFIP121FWT
esphome:
name: nedis-esp-004
substitutions:
device_name: nedis_esp_004
friendly_name: Nedis ESP 004
# Nedis WIFIPO121FWT with bk7231N
# Nedis WIFIPO120FWT with bk7231N chip has markings "10T40 and µ" on it's label
# Nedis WIFIPO120FWT with bk7231T chip has no those markings on it's label
@boozeman
boozeman / WIFIPO120FWT.yaml
Last active May 8, 2024 16:23
ESPHome configuration for Nedis WIFIPO120FWT
esphome:
name: nedis-esp-003
substitutions:
device_name: nedis_esp_003
friendly_name: Nedis ESP 003
# Nedis WIFIPO120FWT with bk7231N chip has markings "10T40 and µ" on it's label
# Nedis WIFIPO120FWT with bk7231T chip has no those markings on it's label (BL0937 pins CF=P7, CF1=P8 and sel=P24, Light=P6 other pins the same)
# Use Cloud Cutter profile: tuya-generic-fs-02we-1ch-16a-smart-switch-with-energy-monitoring
@boozeman
boozeman / windrose-card.yaml
Last active September 21, 2023 13:57
custom:windrose-card (install from HACS)
type: custom:windrose-card
title: Wind direction last 8hrs
data_period:
hours_to_show: 8
max_width: 400
refresh_interval: 300
windspeed_bar_location: bottom
windspeed_bar_full: false
wind_direction_entity:
entity: sensor.wind_direction_10min_avg
@boozeman
boozeman / configuration.yaml
Last active October 13, 2023 18:19
Sensors for FMIWeather.py iteration3 (You can choose Station and measurement)
command_line:
- sensor:
name: "Wind Direction 10min Avg"
unique_id: file_fmi_wind_direction
unit_of_measurement: "°"
scan_interval: 300
command: "python3 /config/FMIWeather.py Tampere winddirection"
value_template: "{{ value_json.result[-1].value |int }}"
json_attributes:
- time
@boozeman
boozeman / FMIWeather.py
Last active October 12, 2023 17:43
Weather Data using FMI open data iteration3. The rest of the sensors
# Copy this on root of config directory or any place you want
# Correct the file sensor paths for configuration.yaml if needed
# Usage: python3 FMIWeather.py station parameter
# Examples:
# FMIWeather.py Tampere windspeed
# FMIWeather.py Hämeenlinna rain1h
# NOTE! If you live place without FMI weather station, like Turenki, Renko or Lammi, It takes the readings for the closest station.
# You can find the stations here: https://www.tuulikartta.info/#lang=fi#latlon=61.04,24.29,9#parameter=ws_10min for example
# All data with 10 min resolution
# ws_10min = Wind Speed 10min avg (in m/s)
@boozeman
boozeman / ec-fan_wiper_control.yaml
Last active April 23, 2023 18:40
Home assistant automation Action to control DS3502 Digital Potentiometer with somekind of Map-Float-Function. There's 3 Helpers, Fan Min Temp, Max Temp and Fan max (0-127)
service: mqtt.publish
data:
topic: cmnd/Greenhouse1/wiper1
qos: "0"
retain: true
payload_template: >-
{% set greenhouse_temp = states('sensor.greenhouse1_ec_fan_control_temperature') |float %}
{% if greenhouse_temp <24.0 %} 0
{% else %}
{% set temp_min = states('input_number.ec_fan_temp_min') |float %}
@boozeman
boozeman / Home Assistant template.yaml
Last active April 9, 2023 17:20
Using Temperature, Humidity and Atmospheric Pressure for some Greenhouse Calculating Stuff
{# Some stuff for testing Home Assistant Template to make template sensors #}
{# This is equivalent to Tasmota Berry Script used on greenhouse automation #}
{# https://gist.github.com/boozeman/e191e01ef914e2651544a03a7acf32eb #}
{# Target_VPD set here by hand. Read some sensor data to variables #}
{% set Target_VPD = 1.4 |float %}
{% set T = states('sensor.your_sensor_sht3x_temperature') |float %}
{% set RH = states('sensor.your_sensor_sht3x_humidity') |float %}
{% set p = states('sensor.your_sensor_bme280_seapressure') |float %}
alias: ajastintesti
description: ""
trigger:
- platform: device
type: turned_on
device_id: <deviceid poistettu>
entity_id: switch.nedis6_relay1
domain: switch
id: relay2 on
- platform: event
@boozeman
boozeman / ADS1115Data.be
Last active March 31, 2022 15:29
Berry Driver - Convert ADS1115 values to volts
import json
import string
class ADS1115Data : Driver
var convert_to_mv
def ads1115()
# Read needed Sensor data
var sensors = json.load(tasmota.read_sensors())
var raw_adc0 = sensors['ADS1115']['A0']
var raw_adc1 = sensors['ADS1115']['A1']