mathz.nu Asterisk Blacklist Hobby webbhotell

2017/11/16

Tvinga en diskcheck vid nästa start av Linux

Filed under: Ubuntu — Mathz @ 19:47

touch /forcefsck

Detta är veriferat på Unbuntu 14.x och 16.x

2017/11/11

Trådfri Home assistant

Filed under: Home Automation — Mathz @ 11:38

I replased tradfri.py3
in /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components with following file:
https://raw.githubusercontent.com/NovapaX/home-assistant/29dca16253f9146cafe8dbca4926a116f3d17a3e/homeassistant/components/tradfri.py

Change log for file: https://github.com/home-assistant/home-assistant/pull/10414

 

sudo apt-get install build-essential libssl-dev libffi-dev python3-dev autoconf

sudo pip3 install DTLSSocket

 

git clone https://github.com/ggravlingen/pytradfri.git

cd pytradfri

pip3 install -r requirements.txt

cd ..

git clone –depth 1 –recursive -b dtls https://github.com/home-assistant/libcoap.git

sudo apt-get install libtool

cd libcoap

./autogen.sh

./configure –disable-documentation –disable-shared –without-debug CFLAGS=”-D COAP_DEBUG_FD=stderr”

make

make install

cd pytradfri

python3 setup.py build

sudo python3 setup.py install

2017/11/07

Run Tellstick on Debian Stretch

Filed under: Home Automation — Mathz @ 21:00

Link to source code: link

sudo apt-get install libftdi-dev libftdi1-dev doxygen
sudo apt-get install libconfuse-dev libconfuse-common libconfuse1
cp /home/pi/libcoap/doc/Doxyfile.in .

tar xvfz telldus-core-{version}.tar.gz

cd telldus-core-{version}
cmake .
make
sudo make install
sudo ldconfig

2017/11/05

Telldus på Raspberry

Filed under: Home Automation — Mathz @ 21:21

sudo sh -c ‘echo “deb http://download.telldus.com/debian/ stable main” >> /etc/apt/sources.list’
sudo apt-key adv –fetch-keys http://download.telldus.se/debian/telldus-public.key

sudo apt-get update
sudo apt-get install -y telldus-core libftdi1

/etc/init.d/telldusd status
[ ok ] Checking status of the Telldus TellStick daemon: telldusd running.

lsmod | grep ftdi_sio
ftdi_sio 31878 0
usbserial 30821 1 ftdi_sio

2017/11/03

Home Assistant update

Filed under: Home Automation — Mathz @ 20:29

$ sudo systemctl stop home-assistant@homeassistant.service
$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit
$ sudo systemctl start home-assistant@homeassistant.service

Scsi Autoloader commands

Filed under: Backup,Server — Mathz @ 17:24

mtx -f /dev/sg5 status
mtx -f /dev/sg5 unload

Ladda band från slot 4
mtx -f /dev/sg5 load 4

Listar scsi devices med sg namn
lsscsi -g

2017/08/26

Check config Hass

Filed under: Config — Mathz @ 22:54

hass –script check_config

Hassbian update

Filed under: Hobby — Mathz @ 15:59

$ sudo systemctl stop home-assistant@homeassistant.service
$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit
$ sudo systemctl start home-assistant@homeassistant.service

2016/11/07

MAC adress mapping in Ubuntu

Filed under: Ubuntu — Mathz @ 00:08

/etc/udev/rules.d/70-persistent-net.rules

2016/11/01

Micropyhton esp8266 JSON client

Filed under: esp8266 — Mathz @ 13:55

# Sample code to request the state fron JSON service.


API_PASSWORD = 'YOUR_PASSWORD'
URL = 'http://x.x.x.x:xxxx/api/states/'
ENTITY = 'sensor'
TIMEOUT = 30
PIN = 5

def get_data():
import urequests
url = '{}{}'.format(URL, ENTITY)
headers = {'x-ha-access': API_PASSWORD,
'content-type': 'application/json'}
resp = urequests.get(URL, headers=headers)
return resp.json()['state']

def main():
import machine
import time

pin = machine.Pin(PIN, machine.Pin.OUT)
while True:
try:
if int(get_data()) >= 20:
pin.high()
else:
pin.low()
except TypeError:
pass
time.sleep(TIMEOUT)

if __name__ == '__main__':
print('Get the state of {}'.format(ENTITY))
main()

« Newer PostsOlder Posts »

Powered by WordPress