Outsource tileboard module, add tileboard config files

This commit is contained in:
Florian Brinker 2019-10-19 17:28:39 +02:00
parent 96a830b850
commit 109f5fae77
5 changed files with 349 additions and 6 deletions

6
.gitignore vendored
View File

@ -10,9 +10,10 @@
!*.skel
!/automations/
!/lovelace-views/
!/sensors/
!/www/
!/scripts/
!/sensors/
!/tileboard/
!/www/
# "Force" Disallow
.storage/
@ -21,4 +22,5 @@ ssh-key/
ip_bans.yaml
secrets.yaml
secrets.js
known_devices.yaml

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "www/tileboard"]
path = www/tileboard
url = https://github.com/resoai/TileBoard.git

342
tileboard/config.js Normal file
View File

@ -0,0 +1,342 @@
(function(url) {
var req = new XMLHttpRequest();
req.open('GET', url + '?cache=' + Math.random(), false);
req.onreadystatechange = function(){
if (req.readyState === 4) {
var s = document.createElement('script');
s.appendChild(document.createTextNode(req.responseText));
document.head.appendChild(s);
}
};
req.send(null);
})("includes/config/secrets.js" );
var CONFIG = {
customTheme: [CUSTOM_THEMES.TRANSPARENT],
transition: TRANSITIONS.ANIMATED_GPU,
entitySize: ENTITY_SIZES.SMALL,
serverUrl: "http://" + CONFIG_SECRETS.homeAssistantHost,
wsUrl: "ws://" + CONFIG_SECRETS.homeAssistantHost + "/api/websocket",
authToken: null, // nope, don't use that...
debug: false,
pingConnection: true,
tileSize: 150,
tileMargin: 10,
groupMarginCss: '20px 40px',
events: [],
timeFormat: 24,
menuPosition: MENU_POSITIONS.BOTTOM,
hideScrollbar: true,
groupsAlign: GROUP_ALIGNS.HORIZONTALLY,
// https://github.com/resoai/TileBoard/wiki/Header-configuration
header: {
styles: {
padding: '10px 20px 0',
fontSize: '22px'
},
right: [
{
type: HEADER_ITEMS.TIME,
}
],
},
// https://github.com/resoai/TileBoard/wiki/Screensaver-configuration
/*screensaver: {
timeout: 300, // after 5 mins of inactive
slidesTimeout: 10, // 10s for one slide
styles: { fontSize: '40px' },
leftBottom: [{ type: SCREENSAVER_ITEMS.DATETIME }], // put datetime to the left-bottom of screensaver
slides: [
{ bg: 'images/bg1.jpeg' },
{
bg: 'images/bg2.png',
rightTop: [ // put text to the 2nd slide
{
type: SCREENSAVER_ITEMS.CUSTOM_HTML,
html: 'Welcome to the <b>TileBoard</b>',
styles: { fontSize: '40px' }
}
]
},
{ bg: 'images/bg3.jpg' }
]
},*/
pages: [
// Page: Overview
{
title: 'Übersicht',
bg: 'images/bg1.jpeg',
icon: 'mdi-home-outline',
groups: [
{
title: 'Licht',
width: 2,
height: 2,
items: [
{
position: [0, 0],
title: 'Theke',
subtitle: 'Küche',
id: 'light.kuchen_theke',
type: TYPES.LIGHT,
states: {
on: "An",
off: "Aus"
},
icons: {
on: "mdi-lightbulb-on",
off: "mdi-lightbulb",
},
sliders: [
{
title: 'Helligkeit',
field: 'brightness',
max: 255,
min: 0,
step: 50,
request: {
type: "call_service",
domain: "light",
service: "turn_on",
field: "brightness"
}
},
],
},
{
position: [1, 0],
title: 'Esstisch',
subtitle: 'Wohnzimmer',
id: 'light.esstisch',
type: TYPES.LIGHT,
states: {
on: "An",
off: "Aus"
},
icons: {
on: "mdi-lightbulb-on",
off: "mdi-lightbulb",
},
sliders: [
{
title: 'Helligkeit',
field: 'brightness',
max: 255,
min: 0,
step: 50,
request: {
type: "call_service",
domain: "light",
service: "turn_on",
field: "brightness"
}
},
],
},
{
position: [0, 1],
title: 'Stimmungslicht',
subtitle: 'Wohnzimmer',
id: 'light.stimmungslicht',
type: TYPES.LIGHT,
states: {
on: "An",
off: "Aus"
},
icons: {
on: "mdi-lightbulb-on",
off: "mdi-lightbulb",
},
},
{
position: [1, 1],
title: 'Ambilight',
subtitle: 'Wohnzimmer',
id: 'light.ambilight',
type: TYPES.LIGHT,
states: {
on: "An",
off: "Aus"
},
icons: {
on: "mdi-lightbulb-on",
off: "mdi-lightbulb",
},
sliders: [
{
title: 'Farbe',
field: 'color_temp',
max: 588,
min: 153,
step: 15,
request: {
type: "call_service",
domain: "light",
service: "turn_on",
field: "color_temp"
}
}
],
colorpicker: true
}
]
},
{
title: 'Wohnzimmer',
width: 2,
height: 2,
items: [
{
position: [0, 0],
type: TYPES.SENSOR,
title: 'Temperatur',
id: 'sensor.temperature_3',
unit: 'C',
state: false,
filter: function (value) { // optional
var num = parseFloat(value);
return num && !isNaN(num) ? num.toFixed(1) : value;
}
},
{
position: [1, 0],
type: TYPES.SENSOR,
title: 'Luftfeuchtigkeit',
id: 'sensor.humidity_4',
unit: '%',
state: false,
filter: function (value) { // optional
var num = parseFloat(value);
return num && !isNaN(num) ? num.toFixed(1) : value;
}
},
{
position: [0, 1],
id: 'media_player.spotify',
type: TYPES.MEDIA_PLAYER,
width: 2,
hideSource: false,
hideMuteButton: false,
state: false,
subtitle: '@attributes.media_title',
bgSuffix: '@attributes.entity_picture',
},
]
},
{
title: 'Sonstige',
width: 1,
height: 2,
items: [
{
position: [0, 0],
height: 1,
classes: ['-compact'],
type: TYPES.WEATHER,
title: 'Wetter',
id: 'weather.openweathermap',
state: '&weather.openweathermap.state',
icon: '&weather.openweathermap.state',
icons: {
'sunny': 'sunny',
'clear-day': 'clear',
'clear-night': 'nt-clear',
'cloudy': 'cloudy',
'rain': 'rain',
'sleet': 'sleet',
'snow': 'snow',
'wind': 'hazy',
'fog': 'fog',
'partly-cloudy-day': 'partlycloudy',
'partly-cloudy-night': 'nt-partlycloudy'
},
fields: {
summary: '&weather.openweathermap.state',
temperature: '&weather.openweathermap.attributes.temperature',
temperatureUnit: '°C',
humidity: '&weather.openweathermap.attributes.humidity',
humidityUnit: '%',
windSpeed: '&weather.openweathermap.attributes.wind_speed',
windSpeedUnit: 'km/h',
}
},
{
position: [0, 1],
type: TYPES.ALARM,
id: "alarm_control_panel.home_alarm",
title: 'Alarm',
icons: {
disarmed: 'mdi-bell-off',
pending: 'mdi-bell',
armed_away: 'mdi-bell',
armed_night: 'mdi-bell',
triggered: 'mdi-bell-ring'
},
states: {
disarmed: 'Ausgeschaltet',
pending: 'Wartet...',
armed_away: 'Aktiviert',
armed_night: 'Nachtmodus',
triggered: 'Ausgelöst'
}
}
]
}
]
},
// Page: Humidity
{
title: 'Luftfeuchtigkeit',
bg: 'images/bg2.png',
icon: 'mdi-water-percent',
groups: [
]
},
// Page: CCTV
{
title: 'CCTV',
bg: 'images/bg2.png',
icon: 'mdi-cctv',
groups: [
{
title: 'Kameras',
width: 2,
height: 2,
items: [
{
position: [0, 0],
id: 'camera.office',
type: TYPES.CAMERA_THUMBNAIL,
bgSize: 'cover',
width: 2,
state: false,
fullscreen: {
type: TYPES.CAMERA,
refresh: 1500,
bgSize: 'contain'
},
}
]
}
]
},
// End
],
}

View File

@ -0,0 +1,3 @@
var CONFIG_SECRETS = {
homeAssistantHost: "...:8123"
}

@ -1 +0,0 @@
Subproject commit d48bdddac7399e70d1ffd7069aaf54cee38ae371