Skip to content

Instantly share code, notes, and snippets.

View ronnyandre's full-sized avatar

Ronny-André Bendiksen ronnyandre

View GitHub Profile
@ronnyandre
ronnyandre / Shield_Intents.MD
Created August 24, 2022 19:34 — forked from mcfrojd/Shield_Intents.MD
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
blueprint:
name: Fibaro Dimmer 2 S2
description: |
Use this blueprint to create automations based on button presses for the Fibaro Dimmer 2
domain: automation
input:
fibaro_entity:
name: Fibaro Dimmer
description: The Fibaro Dimmer that will trigger the scenes
selector:
@ronnyandre
ronnyandre / batteryStatus.ino
Created February 13, 2017 09:54
Get Arduino Battery Status
// Function created to obtain chip's actual Vcc voltage value, using internal bandgap reference
// This demonstrates ability to read processors Vcc voltage and the ability to maintain A/D calibration with changing Vcc
// Now works for 168/328 and mega boards.
// Thanks to "Coding Badly" for direct register control for A/D mux
// 1/9/10 "retrolefty"
int battVolts; // made global for wider avaliblity throughout a sketch if needed, example a low voltage alarm, etc
void setup(void)
{
// This #include statement was automatically added by the Particle IDE.
#include <MQTT.h>
int led = D7;
int drippBryter = D1;
int sprederBryter = D2;
String ipString;
SYSTEM_MODE(MANUAL)
STARTUP(WiFi.selectAntenna(ANT_INTERNAL))
@ronnyandre
ronnyandre / main.py
Created February 15, 2021 19:27 — forked from enlavin/main.py
KMK circuitpython macropad firmware
import board
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.keys import KC
keyboard = KMKKeyboard()
keyboard.col_pins = (board.GP2, board.GP3, board.GP4, board.GP5)
keyboard.row_pins = (
board.GP21,
board.GP20,
@ronnyandre
ronnyandre / fluks-jumping-logo-2.markdown
Created February 11, 2021 12:37
fluks jumping logo 2
@ronnyandre
ronnyandre / flow.json
Created March 10, 2020 10:22
Example deConz event flow in Home Assistant
[{"id":"4cb2d8d4.f1ff18","type":"tab","label":"deCONZ Events","disabled":false,"info":""},{"id":"cfeb8db3.53c14","type":"server-events","z":"4cb2d8d4.f1ff18","name":"Event","server":"3e887f6c.e8ac3","event_type":"deconz_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":150,"y":140,"wires":[["425b6f10.008f3"]]},{"id":"425b6f10.008f3","type":"switch","z":"4cb2d8d4.f1ff18","name":"Get Device ID","property":"payload.event.unique_id","propertyType":"msg","rules":[{"t":"eq","v":"00:15:8d:00:01:e7:94:de","vt":"str"},{"t":"eq","v":"00:15:8d:00:02:9a:93:e4","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":140,"wires":[["2b31e17a.901bfe"],["73e0606f.383dc"]]},{"id":"2b31e17a.901bfe","type":"switch","z":"4cb2d8d4.f1ff18","name":"Event Type","property":"payload.event.event","propertyType":"msg","rules":[{"t":"eq","v":"1002","vt":"str"},{"t":"eq","v":"1004","vt":"str"},{"t":"eq","v":"1001","vt":"str"},{"t":"eq","v":"1003","vt":"str"}],"
@ronnyandre
ronnyandre / gist:8351604
Created January 10, 2014 13:04
Resize PDF with WP_Image_Editor to square JPEG thumbnail.
<?php
// Load PDF
$img = wp_get_image_editor( 'my/temp/uploads/path/mypdf.pdf' );
// Resize PDF
$img->resize( 50, 50, TRUE );
// Generate filename
$filename = $img->generate_filename( 'thumb', 'wp/wp-content/uploads/thumbs/', 'jpg' );
@ronnyandre
ronnyandre / A-Pen-by-Stoyan-Miladinov.markdown
Created October 26, 2013 09:36
A Pen by Stoyan Miladinov.
@ronnyandre
ronnyandre / download.php
Created August 14, 2013 11:39
Simultaneously download websites using PHP and Guzzle
<?php
use Guzzle\Http\Client,
Guzzle\Common\Exception\MultiTransferException;
$client = new Client('http://graph.facebook.com');
try {
$responses = $client->send(array(
$client->get('/' . urlencode('http://tech.vg.no')),
$client->get('/' . urlencode('http://www.vg.no')),