Skip to content

Instantly share code, notes, and snippets.

@cgtobi
cgtobi / remote_debugging_ha_vscode.md
Last active April 23, 2019 18:30
Remote debugging Home Assistant with VSCode

Prerequisits

Local machine

  • Python 3 environment
  • VSCode 1.33.1 with Python 2019.3.6558
  • sshfs

Remote machine

  • Full development environment for Home Assistant
  • ptvsd
@cgtobi
cgtobi / HASS_data_science.md
Last active December 28, 2018 10:44
Getting HASS data science lab up and running on Ubuntu 18.10.

Installation

Starting with a fresh Ubuntu 18.10.

sudo apt update
sudo apt upgrade
sudo apt install python3-pip
sudo pip3 install jupyterlab
sudo pip3 install HASS-data-detective
sudo pip3 install homeassistant
[Unit]
Description=Jupyter Lab
[Service]
User=ubuntu
Type=simple
ExecStart=/usr/local/bin/jupyter lab --port 8888 --ip=0.0.0.0
WorkingDirectory=/home/ubuntu/Notebook
[Install]
@cgtobi
cgtobi / netatmo2.py
Last active November 22, 2018 09:28 — forked from gieljnssns/netatmo2.py
Custom climate component for testing new Netatmo Energy API on HA +0.72
"""
Support for Netatmo Smart Thermostat.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.netatmo/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE
@cgtobi
cgtobi / modbus.py
Created October 31, 2018 14:49
Modbus Climate
"""
Platform for a Generic Modbus Thermostat.
This uses a setpoint and process
value within the controller, so both the current temperature register and the
target temperature register need to be configured.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.modbus/
"""
@cgtobi
cgtobi / rmv-card.js
Last active August 20, 2018 20:28
Custom card for lovelace ui
class RmvCard extends HTMLElement {
set hass (hass) {
const entityId = this.config.entity
const state = hass.states[entityId]
const name = state.attributes['friendly_name']
if (!this.content) {
const card = document.createElement('ha-card')
card.header = name
this.content = document.createElement('div')