Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: Reminder to water a plant
description: 'Sends a daily notification with a water reminder for plants, until the plants have been watered. An optional image can be attached to help identify the plant.'
domain: automation
input:
plant_date:
name: Date sensor
description: "This entity will hold the date of the next time a plant needs watering. It needs to be an input_datetime helper entity set to 'Date'."
selector:
entity:
if (!e131.isEmpty()) {
e131_packet_t packet;
e131.pull(&packet); // Pull packet from ring buffer
if (htons(packet.universe) == UNIVERSE) {
for (int i = 0; i < NUM_PIXELS; i++) {
int j = i * 3 + 1;
pixels.setPixelColor(i, packet.property_values[j], packet.property_values[j+1], packet.property_values[j+2]);
}
pixels.show();
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the Serial Monitor
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/DigitalReadSerial
*/
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the Serial Monitor
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/DigitalReadSerial
*/
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
/* FreqMeasureMulti - Example with serial output
* http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
*
* This example code is in the public domain.
*
* I connected PIN 4 to PIN 6, PIN 4 to PIN 10 and PIN 3 to PIN 9
* Results for Serial Output "n, 1463.99, 50.0000000000, 341520.84"
*
* Uncomment line 95 to see last value change
*
#!/bin/bash
# chkconfig: 2345 90 90
# description: inetmon
### BEGIN INIT INFO
# Provides: inetmon
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program
#!/usr/bin/python
import json
import requests
# Note: Change localhost to the correct IP if needed.
r = requests.get('http://10.22.22.154/admin/api.php')
rstats = json.loads(r.text)
stats = {}
for x in rstats: