Skip to content

Instantly share code, notes, and snippets.

@boozeman
boozeman / automation.yaml
Created October 13, 2024 14:18
Chilien talvivalojen ohjaus käyttäen time-tyyppisiä helpereitä
alias: Chilien talvivalojen ohjaus
description: Chilien talvivalojen ohjaus. Päälle 2h ennen hämärää
triggers:
- at: input_datetime.chilien_talvivalot_paalle
id: chilien talvivalot päälle
trigger: time
- at: input_datetime.chilien_talvivalot_pois
id: chilien talvivalot pois
trigger: time
conditions: []
@boozeman
boozeman / automation.yaml
Created October 13, 2024 14:16
Chilien talvivalojen ohjaus hämärän mukaan
alias: Chilien talvivalojen ajastusautomaatio
description: "Asettaa time-tyyppisen helperin arvot klo 00:10 syttymään 2h ennen auringonlaskua ja sammumaan auringonlaskun hetkellä"
triggers:
- trigger: time
at: "00:10:00"
conditions: []
actions:
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.chilien_talvivalot_paalle
@boozeman
boozeman / notify_example.yaml
Created August 26, 2024 06:48
Home Assistant Companion notify example
data:
title: Title
message: >-
Tuulen suunta 10min Avg: {{ states('sensor.wind_direction_10min_avg')}} ° (
180-220°)<br> Tuulen nopeus 10min Avg: {{
states('sensor.wind_speed_10min_avg') }} m/s<br> Tuulen puuskat 10min Avg:
{{ states('sensor.wind_gusts_10min_avg') }} m/s<br>
data:
sticky: false
notification_icon: mdi:slope-uphill
@boozeman
boozeman / esp32-p1reader.yaml
Last active September 15, 2024 10:55
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 September 15, 2024 10:38
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 September 15, 2024 10:37
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 August 26, 2024 08:27
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: >-
{% 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 %}