...
 
Commits (20)
.*
*.bin
*.log
*.db
!.gitignore
known_devices.yaml
secrets.h
secrets.yaml
No preview for this file type
Basement/Basement.png

156 KB | W: | H:

Basement/Basement.png

163 KB | W: | H:

Basement/Basement.png
Basement/Basement.png
Basement/Basement.png
Basement/Basement.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
binary_sensor.front_door:
device_class: door
binary_sensor.back_doors:
device_class: door
binary_sensor.laundry_room_door:
device_class: door
cover.garage_door:
icon: mdi:garage
proximity.home:
friendly_name: Distance from Home
device_tracker.google_maps_106661122982066747046:
friendly_name: Jason
device_tracker.google_maps_107724576626125395491:
friendly_name: Flo
climate.my_thermostat:
friendly_name: Main & Upper Floor
unit_of_measurement: °C
climate.thermostat759fb6:
friendly_name: Basement
unit_of_measurement: °C
sensor.hallway_temp:
friendly_name: Inside Temp
unit_of_measurement: °C
script.run_fan_on_timer:
friendly_name: Furnace Fan (Timed)
icon: mdi:fan
script.stop_all_media_players:
friendly_name: Turn Off All Chromecasts
icon: mdi:stop
sensor.basementtemp:
friendly_name: Furnace Room
sensor.garagetemp:
friendly_name: Garage
sensor.travel_time_to_work:
icon: mdi:timer
sensor.travel_time_from_work:
icon: mdi:timer
sensor.dark_sky_summary:
friendly_name: Summary
sensor.precipitation:
friendly_name: Precipitation
sensor.nearest_storm:
friendly_name: Nearest Storm
sensor.dark_sky_temperature:
friendly_name: Outside Temp
sensor.dark_sky_apparent_temperature:
friendly_name: Feels Like
sensor.dark_sky_hourly_summary:
friendly_name: Short-Term
sensor.dark_sky_daily_summary:
friendly_name: Long-Term
script.trigger_garage_door:
friendly_name: Open/Close Garage Door
icon: mdi:garage
weather.dark_sky:
friendly_name: Calgary Weather
- name: Away Lights
entities:
light.front_right:
state: on
rgb_color: [255, 255, 255]
brightness: 255
light.back_left:
state: on
rgb_color: [255, 255, 255]
brightness: 255
- name: Blue Green
entities:
light.front_left:
state: on
rgb_color: [255, 255, 255]
brightness: 80
light.front_right:
state: on
rgb_color: [0, 243, 88]
brightness: 255
light.back_left:
state: on
rgb_color: [0, 243, 88]
brightness: 255
- name: Christmas Lights
entities:
light.front_left:
state: on
rgb_color: [20, 241, 0]
brightness: 184
light.front_right:
state: on
rgb_color: [244, 0, 2]
brightness: 184
light.back_left:
state: on
rgb_color: [244, 0, 2]
brightness: 184
- name: Purple Accent
entities:
light.front_left:
state: on
rgb_color: [105, 1, 255]
brightness: 255
light.front_right:
state: on
rgb_color: [105, 1, 255]
brightness: 255
light.back_left:
state: on
rgb_color: [255, 255, 255]
brightness: 143
- name: Red Light District
entities:
light.front_left:
state: on
rgb_color: [244, 0, 2]
brightness: 255
light.front_right:
state: on
rgb_color: [244, 0, 2]
brightness: 112
light.back_left:
state: on
rgb_color: [244, 0, 2]
brightness: 112
- name: Bright White
entities:
light.front_left:
state: on
rgb_color: [255, 255, 255]
brightness: 255
light.front_right:
state: on
rgb_color: [255, 255, 255]
brightness: 255
light.back_left:
state: on
rgb_color: [255, 255, 255]
brightness: 255
run_fan_on_timer:
sequence:
- service: climate.set_fan_mode
data:
entity_id: climate.my_thermostat
fan_mode: 'on'
- delay: '00:{{ states.input_number.fan_timer.state | int }}:00'
- service: climate.set_fan_mode
data:
entity_id: climate.my_thermostat
fan_mode: 'auto'
- service: input_number.select_value
data:
entity_id: input_number.fan_timer
value: 15
stop_all_media_players:
sequence:
- service: media_player.turn_off
data:
entity_id: media_player.bedroom_home_mini,media_player.dining_room,media_player.family_room,media_player.guestroom_home_mini,media_player.kitchen_home,media_player.movie_room,media_player.office_home_mini
title: Our House
views:
- title: Home
id: home
cards:
- type: entities
title: Home Control
show_header_toggle: false
entities:
- input_select.master_mode
- input_boolean.timed_exterior_lights
- input_boolean.timed_interior_lights
- type: weather-forecast
title: Weather
entity: weather.dark_sky
- type: entities
title: Heating
entities:
- climate.my_thermostat
- climate.thermostat759fb6
- sensor.basementtemp
- sensor.garagetemp
- type: entities
title: Ventilation
show_header_toggle: false
entities:
- input_number.fan_timer
- script.run_fan_on_timer
- type: entities
title: Family Room Lighting Presets
entities:
- scene.bright_white
- scene.blue_green
- scene.christmas_lights
- scene.purple_accent
- scene.red_light_district
- type: entities
title: Family Room Lights
entities:
- light.front_left
- light.front_right
- light.back_left
- type: entities
title: Laundry Appliances
entities:
- binary_sensor.washer
- binary_sensor.dryer
- type: entities
title: Music
entities:
- script.stop_all_media_players
- title: Security
id: security
cards:
- type: entities
title: Burglar Alarm
entities:
- alarm_control_panel.home_alarm
- binary_sensor.front_door
- binary_sensor.back_doors
- binary_sensor.laundry_room_door
- binary_sensor.side_door
- binary_sensor.livingdining_room
- binary_sensor.kitchenfamily_room
- binary_sensor.basement
- type: entities
title: Entryway
show_header_toggle: false
entities:
- light.exterior_lights_3
- binary_sensor.doorbell
- cover.garage_door
- type: entities
title: Basement Flooding
entities:
- binary_sensor.water_tank_overflow
- binary_sensor.basement_drain_backup
- title: People
id: people
cards:
- type: entities
title: People
entities:
- device_tracker.google_maps_106661122982066747046
- device_tracker.google_maps_107724576626125395491
- proximity.home
- type: entities
title: Travel Times
entities:
- sensor.travel_time_to_work
- sensor.travel_time_from_work
- title: Systems
id: systems
cards:
- type: entities
title: Internet Speed
entities:
- sensor.speedtest_download
- sensor.speedtest_upload
- sensor.speedtest_ping
- type: entities
title: External Servers
entities:
- sensor.intrepid
- sensor.intrepid_uptime
- sensor.judicator
- sensor.judicator_uptime
- type: entities
title: External Links
entities:
- weblink.connect2go
- weblink.my_radiothermostat
- weblink.homeassistant_changelog
- weblink.veraedge
MIT License
Copyright (c) 2018 Jason Williams
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
<?php
if (isset($_GET["filelist"])) {
$output = array();
$files = scandir(".");
foreach ($files as $file) {
if (strpos($file, ".bin")) array_push($output, [
'filename' => $file,
'timestamp' => filemtime($file)
]);
}
header('Content-Type: application/json');
echo json_encode($output);
exit();
}
elseif (isset($_GET["data"])) {
header('Content-Type: application/json');
echo file_get_contents("updater.json");
exit();
}
elseif (isset($_GET["updatedevices"])) {
$data = json_decode(file_get_contents("updater.json"));
$data->devices = json_decode(file_get_contents("php://input"));
file_put_contents("updater.json", json_encode($data));
exit();
}
elseif (isset($_GET["redeploy"])) {
$data = json_decode(file_get_contents("updater.json"));
$data->deployments = array_diff($data->deployments, array(file_get_contents("php://input")));
file_put_contents("updater.json", json_encode($data));
exit();
}
elseif (isset($_SERVER['HTTP_X_ESP8266_STA_MAC'])) {
// Check for an available file
$mac = $_SERVER['HTTP_X_ESP8266_STA_MAC'];
$filename = strtolower(str_replace(':', '', $mac)).'.bin';
if (file_exists($filename)) {
$deployid = strtolower(str_replace(':', '', $mac)).filemtime($filename);
// Check if the deployment has already been made
$data = json_decode(file_get_contents("updater.json"));
if (isset($data->deployments) && in_array($deployid, $data->deployments)) header($_SERVER["SERVER_PROTOCOL"].' 304 Not Modified', true, 304);
else {
// We need to deploy the update
header($_SERVER["SERVER_PROTOCOL"].' 200 OK', true, 200);
header('Content-Type: application/octet-stream', true);
header('Content-Disposition: attachment; filename='.basename($filename));
header('Content-Length: '.filesize($filename), true);
header('x-MD5: '.md5_file($filename), true);
readfile($filename);
if (!isset($data->deployments)) $data->deployments = array();
array_push($data->deployments, $deployid);
file_put_contents("updater.json", json_encode($data));
exit();
}
} else header($_SERVER["SERVER_PROTOCOL"].' 304 Not Modified', true, 304);
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style type="text/css">
* {margin: 0; padding: 0; border: 0;}
html {min-height: 100%; overflow-y: scroll; overflow-x: hidden;}
body {background-color: #FFFFFF; font-family: 'Open Sans', sans-serif; color: #000000;}
header {background-color: #000; color: #FFF}
header h1 {padding: 20px; font-weight: normal; font-size: 40px; line-height: 40px;}
section {padding: 20px;}
section h2 {display: inline-block; margin-bottom: 10px; font-weight: normal; font-size: 30px; line-height: 30px;}
a {color: #034f84;}
a:hover {color: #c94c4c;}
table {border-collapse: collapse;}
th {background-color: #000; color: #FFF; font-weight: normal; text-align: left;}
table, th, td {border: 1px solid #333;}
th, td {padding: 2px 20px 2px 2px;}
textarea {border: 1px solid #333; width: 100%; height: 100px;}
.loaded {display: none;}
.editing {display: none;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
var alldata = false, loaded = 0;
$(function() {
loadData();
// Handler for edit link
$('a#editdevices').click(function(e) {
e.preventDefault();
$('.editing').show();
$('.display').hide();
});
// Handler for save link
$('a#savedevices').click(function(e) {
e.preventDefault();
// Check for valid JSON
try {
JSON.parse($('section#devices textarea').val());
} catch (e) {
alert('Invalid JSON, unable to save data.');
return;
}
$('.editing, .loaded').hide();
$('.display').show();
$.post("?updatedevices", $('section#devices textarea').val()).done(function() {
loadData();
});
});
// Handler for redeploy link
$('section#binaries table tbody').on('click', 'a.redeploy', function(e) {
e.preventDefault();
alert($(this).attr('data-did'));
$.post("?redeploy", $(this).attr('data-did')).done(function(d) {
loadData();
});
});
});
function loadData() {
loaded = 0;
// Remove existing data
$('tbody').html('');
// Load the list of files
$.getJSON("?filelist", function(data) {
loaded++;
$.each(data, function(i, v) {
row = $("<tr>");
row.append("<td>" + v.filename + "</td>");
row.append("<td>" + v.timestamp + "</td>");
row.append("<td>");
row.append("<td>");
$('section#binaries table tbody').append(row);
});
processData();
});
// Load stored JSON data
$.getJSON("?data", function(data) {
loaded++;
alldata = data;
$.each(data.devices, function(i, v) {
row = $("<tr>");
row.append("<td>" + v.name + "</td>");
row.append("<td>" + v.mac + "</td>");
row.append("<td>");
$('section#devices table tbody').append(row);
});
$('section#devices textarea').val(JSON.stringify(alldata.devices));
processData();
});
}
function processData() {
if (loaded == 2) {
$('.loaded').show();
$('section#devices table tbody tr').each(function() {
$(this).children('td:nth-of-type(3)').html($(this).children('td:nth-of-type(2)').html().replace(/:/g,"").toLowerCase() + ".bin");
});
$('section#binaries table tbody tr').each(function() {
filename = $(this).children('td:nth-of-type(1)').html();
device = $('section#devices table tbody td').filter(function() {
return $(this).text() == filename;
}).parent().children('td:nth-of-type(1)').html();
deploymentid = $(this).children('td:nth-of-type(1)').html().replace(".bin", "") + $(this).children('td:nth-of-type(2)').html();
if (typeof device !== 'undefined') {
$(this).children('td:nth-of-type(3)').html(device);
if (alldata.deployments.includes(deploymentid)) $(this).children('td:nth-of-type(4)').html("<a href='#' class='redeploy' data-did='" + deploymentid + "' title='Click to redeploy'>Deployed</a>");
else $(this).children('td:nth-of-type(4)').html("Not deployed");
} else {
$(this).children('td:nth-of-type(3)').html("Unknown");
$(this).children('td:nth-of-type(4)').html("No target found");
}
});
}
}
</script>
<title>Updater</title>
</head>
<body>
<header><h1>NodeMCU Updater</h1></header>
<section id="devices">
<h2>Devices</h2>
<a id="editdevices" href="#" class="loaded display">Edit</a><a id="savedevices" href="#" class="editing">Save</a>
<table class="display">
<thead>
<tr><th>Device Name</th><th>MAC Address</th><th>Expected Filename</th></tr>
</thead>
<tbody>
</tbody>
</table>
<textarea class="editing"></textarea>
</section>
<section id="binaries">
<h2>Compiled Binaries</h2>
<table>
<thead>
<tr><th>Filename</th><th>File Time</th><th>Target Device</th><th>Deployment Status</th></tr>
</thead>
<tbody>
</tbody>
</table>
</section>
</body>
</html>
{"devices":[{"name":"Basement","mac":"00:00:00:00:00:01"},{"name":"Garage","mac":"00:00:00:00:00:02"},{"name":"Laundry","mac":"00:00:00:00:00:03"},{"name":"Test Device","mac":"84:F3:EB:6F:93:45"}],"deployments":["84f3eb6f93451541987019"]}
\ No newline at end of file