Skip to content

Instantly share code, notes, and snippets.

View JBoye's full-sized avatar

Jonas Boye JBoye

  • LINDBERG Eyewear
  • Aarhus, Denmark
View GitHub Profile
@JBoye
JBoye / Elpris V2.j2
Last active November 19, 2021 08:05
Elpris WIP
{% set battery_level = states("sensor.jenny_battery_level") | float %}
{% set departure_time = 16 %} {# could be calculated or another sensor #}
{% set current_time = now().hour %}
{% set departure_time = departure_time + 24 if departure_time <= current_time else departure_time %}
{{departure_time}}
{% set battery_capacity = 10 %} {# kWh #}
{% set charging_speed = 3.7 %} {# kW #}
@JBoye
JBoye / Metro.yaml
Last active September 20, 2021 15:01
KBH Metro Status
metro:
rest:
- resource: https://m.dk/umbraco/api/operationDataApi/GetOperationData
binary_sensor:
- name: "Metro M1-M2"
value_template: "{% for item in value_json.activeMessages if item.Type == 'M1-M2' %}{{item.isClearMessage == False}}{% endfor %}"
device_class: problem
- name: "Metro M3-M4"
value_template: "{% for item in value_json.activeMessages if item.Type == 'M3-M4' %}{{item.isClearMessage == False}}{% endfor %}"
@JBoye
JBoye / AlternativeLovelaceCard.yaml
Last active January 10, 2022 00:46
Home Assistant Corona Tracker i danske sogne
type: glance
entities:
- entity: sensor.corona_incidens_sabro
- entity: sensor.corona_positivprocent_sabro
- entity: sensor.corona_smittede_sabro
- entity: sensor.corona_vaccinerede_sabro
show_name: false
show_icon: true
title: Sabro
/*
*
* Commands recieved from HACKTANE Desktop
*
* 0 Handshake
*
* 10-19 Set digit 1
* 20-29 Set digit 2
* 30-39 Set digit 3
* 40-49 Set digit 4
@JBoye
JBoye / DictionaryExport.ashx
Last active August 29, 2015 14:20
Method of Exporting Umbraco dictionary items to Excel and back. Uses http://epplus.codeplex.com. Based on https://github.com/hfloyd/DictionaryDashboardForUmbraco
<%@ WebHandler Language="C#" Class="DictionaryExport" %>
using System;
using System.IO;
using System.Web;
using System.Collections.Generic;
using System.Linq;
using umbraco.cms.businesslogic;