Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw(cmpthese);
my @indexes;
foreach (1..1000) {
my $r = int(rand(10_000));
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw(cmpthese);
my @indexes;
foreach (1..1000) {
my $r = int(rand(10_000));
push @indexes, $r;
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw(cmpthese);
my @arr;
foreach my $i (1..500) {
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw(cmpthese);
cmpthese(
-5,
{
sqlite> select state, created from states where entity_id = 'sensor.0x00158d000309a2c3_temperature' order by created desc limit 100;
state|created
25.75|2020-11-26 09:34:15.002952
25.75|2020-11-26 09:34:14.980620
25.87|2020-11-26 09:34:14.977223
25.87|2020-11-26 09:22:00.327637
25.87|2020-11-26 09:22:00.302111
25.82|2020-11-26 09:22:00.299691
25.82|2020-11-26 09:18:59.082958
25.82|2020-11-26 09:18:59.041144
# https://community.home-assistant.io/t/blitzwolf-bw-lt11-mqtt-set-up-help/110256/19
esphome:
name: bw_lt11
platform: ESP8266
board: esp8285
wifi:
ssid: !secret wifi_ssid
light:
- platform: mqtt
name: "BW-LT11"
state_topic: "stat/BW-LT11/RESULT"
state_value_template: "{{value_json.POWER}}"
command_topic: "cmnd/BW-LT11/POWER"
brightness_state_topic: "stat/BW-LT11/RESULT"
brightness_value_template: "{{value_json.Dimmer}}"
timer:
toilet:
automation:
- alias: Turn on light in the toilet by aqara sensor motion
trigger:
platform: mqtt
topic: zigbee2mqtt/0x00158d0004518e15
condition:
input_boolean:
alarm:
input_datetime:
alarm:
has_date: false
has_time: true
automation:
- alias: set alarm
20-10-29 11:41:49 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
20-10-29 11:55:29 INFO (MainThread) [supervisor.host.info] Updating local host information
20-10-29 11:55:30 INFO (MainThread) [supervisor.host.services] Updating service information
20-10-29 11:55:30 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information