Skip to content

Instantly share code, notes, and snippets.

View gist:aa8b45465e488bd75adcc834461954d5
commit 0a729b3acb0cb2f110002bef49ec43be20060c27
Author: Ivan Bessarabov <ivan@bessarabov.ru>
Date: Fri Apr 22 23:24:15 2022 +0300
Fixing telegram bot multiline commands
https://t.me/modernperl/206743
Alexander P, [22 Apr 2022, 22:44:37]:
@PerlBanjoBot
View bw_shp8_boiler.yaml
# Based on https://community.home-assistant.io/t/esphome-blitzwolf-bw-shp6-configuration/113938/13?u=bessarabov
substitutions:
device_name: bw_shp8_boiler
upper_devicename: "BW-SHP8 Boiler"
# Higher value gives lower watt readout
current_res: '0.00221'
View gist:afff0c47df50e9ef1faaf2dbac64595d
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
View configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
script: !include scripts.yaml
View configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
View gist:ec4abf6c63e4150d12cc954a4253552f
sensor:
- platform: template
sensors:
pzem_kwh:
unit_of_measurement: kWh
value_template: "{{ states('sensor.pzem_004t_v3_energy') | float / 1000 }}"
utility_meter:
daily_energy_pzem:
@bessarabov
bessarabov / fridge.yaml
Created Apr 30, 2021
Датчики температуры в холодильнике для Home Assistant
View fridge.yaml
binary_sensor:
- platform: template
sensors:
fridge_top_temperature_is_ok:
value_template: >-
{{ (states('sensor.0x00158d00045f5f93_temperature') | float > 5)
and (states('sensor.0x00158d00045f5f93_temperature') | float < 12) }}
fridge_bottom_temperature_is_ok:
View show_github_repos.pl
#!/usr/bin/perl
=encoding UTF-8
=cut
=head1 DESCRIPTION
=cut
# common modules
View gist:840045383ab4ab0bd5a1eb266c5b1219
$ curl -s 'https://www.artlebedev.ru/country-list/tab/' > countries.tsv; curl -s 'https://analytics.home-assistant.io/data.json' |perl -MJSON::PP -MData::Dumper -nalE '$c .= $_; }{ $d = decode_json $c; foreach (keys %{$d}) { if ($d->{$_}->{countries}) { foreach $id (keys %{$d->{$_}->{countries}}) { say $id, " ", $d->{$_}->{countries}->{$id}} } }'|sort -k2 -nr|head -30|perl -C -nalE '$tsv = `cat countries.tsv`; @lines = split/\n/, $tsv; foreach (@lines) { @f = split /\t/,$_; $id2name{$f[3]} = $f[0] }; $i++; say sprintf "%2s %2s %-25s %10s", $i, $F[0], $id2name{$F[0]}, $F[1]'
1 US Соединенные Штаты 1613
2 NL Нидерланды 974
3 DE Германия 790
4 GB Соединенное Королевство 655
5 PL Польша 490
6 IT Италия 414
7 SE Швеция 365
8 FR Франция 316
9 AU Австралия 303
View configuration.yaml
default_config:
input_number:
n1:
min: 0
max: 100
step: 1
input_boolean:
b1: