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