Skip to content

Instantly share code, notes, and snippets.

View Alexivia's full-sized avatar

Alexandre Vieira Alexivia

  • ASML
  • Portugal, Netherlands
View GitHub Profile
@Alexivia
Alexivia / dew_point.jinja
Last active January 16, 2024 21:21
Jinja macros to create dew point sensors in Home Assistant.
{% macro dew_point(i_temperature, i_humidity) %}
{# https://www.home-assistant.io/docs/configuration/templating/#reusing-templates #}
{# https://en.wikipedia.org/wiki/Dew_point #}
{# https://iridl.ldeo.columbia.edu/dochelp/QA/Basic/dewpoint.html #}
{# https://gasquip.com/dew-point-calculator-for-moisture/ #}
{% set temperature = i_temperature|float %}
{% set humidity = i_humidity|float %}
{% set a = 6.1121|float %}
@Alexivia
Alexivia / plot-water-well.py
Last active August 26, 2023 21:37
Calculate and Plot Reading of a Water Well Sensor
"""
Calculate and Plot Reading of a Water Well Sensor
Simple software made for aiding in calculating the values that an analog voltage sensor will read from a series resistor
in a water column height sensor with a constant current output. The analog sensor happened to provide its output value
in percentage to the web API.
Used for a particular setup where a Shelly 2PM + AddOn Plus was reading the voltage of the resistor.
Author: Alexandre Vieira, 2023
@Alexivia
Alexivia / utilities-meter.yaml
Last active May 17, 2023 08:32
Slimme Lezer + Water Meter reader joint ESPHome configuration.
---
# Based on:
# - Slimme Lezer for the Electricity Meter
# - https://github.com/zuidwijk/dsmr/blob/main/slimmelezer.yaml
# - @ 0f34e14 on Oct 10
# - Blog post for the Water Meter
# - https://www.pieterbrinkman.com/2022/02/02/build-a-cheap-water-usage-sensor-using-esphome-home-assistant-and-a-proximity-sensor/
# - Using the same pin for multiple sensor types is no longer supported:
# - https://github.com/esphome/issues/issues/3364#issuecomment-1179691203
# - Connect same input to 2 GPIOs to make them read the same sensor, but keep separate counts internally.