Skip to content

Instantly share code, notes, and snippets.

@Bouni
Bouni / connectapi.py
Created May 1, 2018 09:04
Feuersoftware Connect API
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
import click
import requests
import json
from datetime import datetime as dt
import coloredlogs, logging
@Bouni
Bouni / connectapi.py
Last active June 1, 2018 07:02
Script that receives serial data from DME and sends it to connectapi
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
import sys
import requests
import re
import time
import serial
import json
@Bouni
Bouni / connectapi.service
Created May 31, 2018 10:34
systemd service file for connectapi.py script
[Unit]
Description=Script das Seriel Alarmdaten von einem DME empfängt und via API an Connect weiterleitet
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=10
ExecStart=/home/pi/connectapi/connectapi.py
User=pi
@Bouni
Bouni / swiss_hydrological_data.py
Created September 6, 2018 15:03
swiss_hydrological_data regex
location = re.findall(r"<option selected=\"selected\" value=\"\d+\">(.*)\s\(\s\d+\s\)</option>", response.text)
location = [s.strip() for s in location[0].split("-")]
captions = re.findall(r"<th class=\"text-center\" scope=\"col\">(\w+)<br>", response.text)
data = re.findall(r"<td class=\"text-center\">([\d\.]+)</td>", response.text)
['Rhein', 'Rekingen']
['Abfluss', 'Wasserstand', 'Temperatur']
['261', '322.28', '21.1', '250', '322.25', '21.1', '264', '322.29', '21.2']
@Bouni
Bouni / .vimrc
Created October 2, 2018 19:13
.vimrc
" decide wether we use vim or neovim
if has('nvim')
let $VIMHOME = '~/.config/nvim'
else
let $VIMHOME = '~/.vim'
endif
" set the plugvim path
let $PLUGVIM = expand($VIMHOME . '/autoload/plug.vim')
@Bouni
Bouni / configuration.yaml
Created November 7, 2018 07:39
Home-Assistant Luxtronik example config
luxtronik:
host: "192.168.88.11"
port: 8889
sensor:
- platform: luxtronik
sensors:
- 'ID_WEB_Temperatur_TVL'
- 'ID_WEB_Temperatur_TRL'
- 'ID_WEB_Sollwert_TRL_HZ'
@Bouni
Bouni / ui-lovelace.yaml
Created December 14, 2018 09:00
Lovelace Home Assistant Config
title: Wasenweg
# Include external resources
#resources:
# - url: /local/my-custom-card.js
# type: js
# - url: /local/my-webfont.css
# type: css
# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
#background: center / cover no-repeat url("/background.png") fixed
uname -a
Linux mill 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux
LINUXCNC - 2.7.14-67-g66b42c137
Machine configuration directory is '/home/miller/linuxcnc'
Machine configuration file is '7i96-1k.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 768: can't load tool table.
Found file(REL): ./hm2-pidstepper.hal
# PID loop signals
setp pid.0.Pgain [JOINT_0]P
setp pid.0.Igain [JOINT_0]I
setp pid.0.Dgain [JOINT_0]D
setp pid.0.bias [JOINT_0]BIAS
setp pid.0.FF0 [JOINT_0]FF0
setp pid.0.FF1 [JOINT_0]FF1
setp pid.0.FF2 [JOINT_0]FF2
setp pid.0.deadband [JOINT_0]DEADBAND
# This config file was created 2016-08-12 11:49:56.526085 by the update_ini script
# The original config files may be found in the /home/pcw/linuxcnc/configs/7i76es1.old directory
[EMC]
# The version string for this INI file.
VERSION = 1.1
# Name of machine, for use with display, etc.
MACHINE = Reaktor-Mill