Skip to content

Instantly share code, notes, and snippets.

View tcastberg's full-sized avatar

Tor Magnus tcastberg

  • Sopra Steria AS
  • Norge
View GitHub Profile
@tcastberg
tcastberg / set_climate_on_time.yaml
Last active December 23, 2020 12:06 — forked from quallenbezwinger/set_climate_on_time.yaml
Set thermostat temperature at specific time - homeassistant blueprint
blueprint:
name: Set thermostat temperature at specific time
description: Sets a climate entity to a specifc temperature at a set time everyday. If climate entity is off, it is normally not accepting temperature updated. This blueprints checks if climate entity is off and the temperature update will be set when thermostat is going back in heating mode.
domain: automation
source_url: https://gist.github.com/dirkk1980/d3a60a5ebc7c58b1c56024cb447bef3c
input:
time_to_set:
name: Time
description: When should the temperature be set
selector:
alias: test
description: ''
trigger:
- entity_id: weather.hjemme
platform: state
to: "cloudy"
- entity_id: weather.hjemme
platform: state
to: "rainy"
- entity_id: weather.hjemme
sensor:
- platform: template
sensors:
electricity_meter_consumption:
value_template: "{{ state_attr('sensor.real_time_consumption_my_road_1', 'lastMeterConsumption') }}"
unit_of_measurement: "kWh"
utility_meter:
electricity_yearly:
source: sensor.electricity_meter_consumption
sensor:
- platform: mqtt
state_topic: "your/topic"
name: "Power Active Import"
unit_of_measurement: "W"
value_template: "{{value_json['data']['power_active_import']['value']}}"
FROM alpine:latest AS build
RUN apk add --no-cache alpine-sdk
RUN git clone https://github.com/tcastberg/wmbusmeters.git
WORKDIR /wmbusmeters
RUN make
FROM alpine:latest as scratch
ENV QEMU_EXECVE=1
RUN apk add --no-cache mosquitto-clients libstdc++
WORKDIR /wmbusmeters
--[[
%% properties
228 value
--]]
-- Device 228 er en bevegelsessensor
-- Property value er verdien som sier om bevegelse er påbegynt (1) eller avsluttet (0)
if (fibaro:countScenes() > 1) then
fibaro:debug("Too many scenes");
@tcastberg
tcastberg / cc2hc2.py
Created August 16, 2017 08:33
Script to push chromecast playing state to Fibaro HC2/HCL
#!/usr/bin/env python
import pychromecast
import time
import requests
import logging
import sys
import daemon
# Delay between each search for new chromecasts
@tcastberg
tcastberg / Humidity Control.lua
Last active August 2, 2017 08:41
Control of extractor fan based on divergence from average humidity of wet-rooms.
--[[
%% properties
231 value
225 value
244 value
%% events
%% globals
--]]
--[[