Skip to content

Instantly share code, notes, and snippets.

View Naesstrom's full-sized avatar

Erik Näsström Naesstrom

View GitHub Profile
@Naesstrom
Naesstrom / shelly.yaml
Created December 28, 2021 18:54
Shelly plug S config for home-assistant
shelly:
cloud_auth_key: !secret shelly
cloud_server: "https://shelly-28-eu.shelly.cloud"
discovery: true
additional_information: true
sensors:
- all
attributes:
- all
homeassistant:
customize:
sensor.house_power_usage:
last_reset: "2021-07-30T00:00:00+00:00"
sensor:
- platform: mqtt
state_topic: "EspSparsnasGateway/+/state"
[
{
"id": "a39f58b2.f48ca8",
"type": "tab",
"label": "Weather warnings",
"disabled": false,
"info": ""
},
{
"id": "fa47dc61.cf8ff",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bottle_diameter = 120; // [1:200]
outside_diameter = bottle_diameter+3;
//LEDBERG dimensions, d=43 h=13
// don't turn functions into params!
function BEZ03(u) = pow((1-u), 3);
$fn = 200;
difference(){
from math import radians, sin, cos, acos
"""
slat = Start Latitude
slon = Start Longitude
elat = End Latitude
elon = End Longitude
"""
slon,slat = 16.596265846848024,62.811484968080336
elat,elon = 56.8734129,14.7967102
- platform: history_stats
name: Working in the mine (week)
entity_id: device_tracker.google_maps_110812454925350234140
state: 'WorkZone'
type: time
start: '{{ as_timestamp( now().replace(hour=0).replace(minute=0).replace(second=0) ) - now().weekday() * 86400 }}'
end: '{{ now() }}'
sensor:
- platform: template
sensors:
erik_location:
friendly_name: "Erik's Location"
value_template: "{{ states.device_tracker.google_maps_110812454925350234140.attributes.address }}"
sussa_location:
friendly_name: "Sussas's Location"
value_template: "{{ states.device_tracker.google_maps_114557479077035215629.attributes.address }}"
#include <Stepper_28BYJ_48.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <PubSubClient.h>
#include <WiFiUdp.h>
#include <WiFiManager.h>
#include <ArduinoJson.h>
#include "FS.h"
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
Contents of ~/.node-red/settings.js
functionGlobalContext: {
// os:require('os'),
// octalbonescript:require('octalbonescript'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false}),
TelldusAPI:require("telldus-live"),
mqttModule:require("mqtt")
},