Skip to content

Instantly share code, notes, and snippets.

@rufik
rufik / 1_README.MD
Last active January 13, 2024 09:24
Template sensors dla ESPAltherma w Home Assistant

ESPAltherma info

Źródło oprogramowania: https://raomin.github.io/ESPAltherma/

Informacje o urządzeniu w HA: ESP32 - LT EHVH D6V producent: espressif / Raomin oprogramowanie: 2021.12.06 Użyty został plik ALTHERMA(LT_EHVH-D6V_04-08KW).h dla mojej pompy, zoptymalizowany do niezbędnych i działających sensorów.

HA templates

-- This is Postgresql 11 procedure to fix spikes generated by Huawei Solar integration in Home Assistant
-- https://github.com/Emilv2/huawei_solar/issues/80
-- Usage: save this proc in HA DB. Then use query like that:
-- CALL fix_spikes('sensor.total_yield_bt2160214111', '2022-03-10 00:00:00')
-- DROP PROCEDURE IF EXISTS public.fix_spikes(character varying, timestamp with time zone);
CREATE OR REPLACE PROCEDURE public.fix_spikes(
sensor_name character varying,
date_from timestamp with time zone)
@rufik
rufik / smartdgm_pp-w162_outlet.yaml
Last active February 7, 2020 20:12
SmartDGM PP-W162 smart outlet configuration for ESPHome 1.4.x
esphome:
name: smartdgm_outlet
platform: ESP8266
board: esp01_1m
wifi:
ssid: .....
password: .....
logger:
@rufik
rufik / sdm630_to_mqtt.py
Created June 12, 2019 20:14
Python script to read SDM630 power meter and publish to mqtt
#!/usr/bin/python
import minimalmodbus
import paho.mqtt.client as mqtt
import paho.mqtt.publish as pub
# RS485 serial settings
DEVICE="/dev/ttyUSB0"
SLAVE=2
DEBUG=False
FUNCODE=4
#!/usr/bin/python
import os
import socket
import sys
def encode_packet(data):
output = bytearray()
for i in range(0, len(data)):
tmpoutput = bytearray([0, data[i]])
@rufik
rufik / designer.html
Last active August 29, 2015 14:13
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: relative;
width: 100%;