Skip to content

Instantly share code, notes, and snippets.

Synology Docker Energy Monitoring with Shelly

What this does

This is a complete walk through in order to get energy monitoring with a Shelly em3 and InfluxDB with Grafana through mqtt up and running on DSM7. We will not use Node Red instead Telegraf directly subscribes the topics and pushes them into the database.

For now there are some hick ups and there seem to be some delays between some messages. This is early state though and I have to see how this develops.

Prequisites

@shyd
shyd / remove_diacritics.js
Last active May 6, 2021 06:16 — forked from yeah/remove_diacritics.js
Remove diacritics (Umlauts, Accents, Special characters) in JavaScript
const diacriticsMap = [
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
{'base':'AA','letters':/[\uA732]/g},
{'base':'AE','letters':/[\u00C4\u00C6\u01FC\u01E2]/g},
{'base':'AO','letters':/[\uA734]/g},
{'base':'AU','letters':/[\uA736]/g},
{'base':'AV','letters':/[\uA738\uA73A]/g},
{'base':'AY','letters':/[\uA73C]/g},
{'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
{'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
@shyd
shyd / avd-root-whatsapp.md
Last active November 3, 2020 07:32
Get root access and gapps in AVD emulator to extract WhatsApp Messages
@shyd
shyd / chrome-flags.md
Last active September 23, 2019 19:42
Chrome flags omnibar showprotocol

set both to disabled

chrome://flags/#omnibox-ui-hide-steady-state-url-scheme
chrome://flags/#omnibox-ui-hide-steady-state-url-trivial-subdomains
@shyd
shyd / InstagramScraper.md
Created January 15, 2018 17:41
How to get Instagram media and info

Instagram Scraper

Get users media

https://www.instagram.com/username/?__a=1

if user.media.page_info.has_next_page is true, continue with

https://www.instagram.com/username/?__a=1&max_id=<user.media.page_info.end_cursor>

# replace function `play_cd` with this one to play a playlist instead of folder `cd6`
# This assumes you have a playlist ready in `/var/lib/mpd/playlists/myAwesomePlaylist.m3u`
# load new cd-dir
def play_cd(cd_no):
if ser.read() == CDC_END_CMD and ser.read() == CDC_CDSET:
if str(cd_no) == "6":
os.popen("mpc clear")
os.popen("mpc load myAwesomePlaylist")
os.popen("mpc play")
@shyd
shyd / PRECALCULATE_WAVEFORMS.md
Last active September 22, 2017 07:28
How to precalculate sine with js.

Waveforms

precalculated sine with js

Run the following code on JSFiddle with the proper amplitude set:

var count = 0;
var max_amplitude=4095;
var amplitude=3800;
@shyd
shyd / Dockerfile
Last active January 21, 2024 01:56
install locales inside a docker image
FROM debian
RUN apt-get update && \
apt-get install -y \
locales && \
rm -r /var/lib/apt/lists/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales
@shyd
shyd / Dockerfile
Last active February 4, 2024 12:17
install php imap in dockerfile
FROM php:5-apache
RUN apt-get update && \
apt-get install -y \
libc-client-dev libkrb5-dev && \
rm -r /var/lib/apt/lists/*
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j$(nproc) imap