This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, select, socket, time | |
bufferSize = 1024 # whatever you need | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.bind(('', 0)) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |
sock_recv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock_recv.bind(('', 22081)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: template | |
sensors: | |
hydro_rate: | |
# TODO account for holidays | |
value_template: >- | |
{% if now().weekday() > 4 or now().hour < 7 or now().hour >= 19 %} | |
off_peak | |
{% elif now().hour >= 7 and now().hour < 11 %} | |
{% if now().month >= 5 and now().month <= 10 %} | |
mid_peak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binary_sensor: | |
- platform: command_line | |
name: "Front Door Motion Sensor" | |
command: 'curl -k --silent "https://192.168.1.XXX:443/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXX&pwd=XXXX" | grep -oP "(?<=motionDetectAlarm>).*?(?=</motionDetectAlarm>)"' | |
device_class: motion | |
payload_on: "2" | |
payload_off: "1" | |
scan_interval: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure OPT_TRIGGERS is enabled in ZoneMinder, and the camera is set to Nodect | |
switch: | |
- platform: telnet | |
switches: | |
front_door_camera_trigger: | |
resource: 'localhost' | |
port: 6802 | |
command_on: '1|on|123|MotionOn|on' | |
command_off: '1|off|123|MotionOff|off' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor: | |
- platform: template | |
sensors: | |
sunrise: | |
value_template: '{% set timestamp = as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom("%I:%M %p") %} {{ timestamp.lstrip("0") }}' | |
friendly_name: "Sunrise" | |
sunset: | |
value_template: '{% set timestamp = as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom("%I:%M %p") %} {{ timestamp.lstrip("0") }}' | |
friendly_name: "Sunset" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch: | |
- platform: command_line | |
switches: | |
front_door_camera_ir: | |
command_on: 'curl -k "https://192.168.1.XXX:443/cgi-bin/CGIProxy.fcgi?cmd=openInfraLed&usr=XXX&pwd=XXX"' | |
command_off: 'curl -k "https://192.168.1.XXX:443/cgi-bin/CGIProxy.fcgi?cmd=closeInfraLed&usr=XXX&pwd=XXX"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import smbus | |
import time | |
bus = smbus.SMBus(1) | |
class HT1635B(): | |
DEVICE_ADDRESS = 0x68 | |
CMD_RAM_W = 0b10000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM homeassistant/home-assistant:stable | |
# Install dev tools | |
RUN apk add --update alpine-sdk | |
# Grab heyu | |
RUN wget -O heyu.zip https://codeload.github.com/HeyuX10Automation/heyu/zip/v2.10.1 | |
RUN unzip heyu.zip | |
# Build it (the 'darwin' configuration seems to work on Alpine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkTime = datetime.datetime.now() - datetime.timedelta(hours=24) | |
for entity_id in hass.states.get('group.zwave').attributes['entity_id']: | |
entity = hass.states.get(entity_id) | |
if entity is not None: | |
lastSeen = datetime.datetime.strptime(entity.attributes['receivedTS'][:-5], '%Y-%m-%d %H:%M:%S') | |
if entity.attributes['is_failed'] or lastSeen < checkTime: | |
msg = entity.attributes['friendly_name'] + ' is AWOL' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Frigate Notification | |
description: | | |
## Frigate Mobile App Notification | |
This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but will update to include actionable notifications allowing you to view the saved clip/snapshot when available, or silence the notification for a configurable amount of time. | |
With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1]. | |
### Required entities: |