Skip to content

Commit

Permalink
updated ha and moved zig devices to lifo
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Sep 12, 2021
1 parent ce8e8c7 commit 8a0545b
Show file tree
Hide file tree
Showing 29 changed files with 539 additions and 102 deletions.
19 changes: 19 additions & 0 deletions containers/homeassistant/auto_config/temperature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"unit_of_measurement": "°C",
"device_class": "temperature",
"value_template": "{{ value_json.temperature }}",
"state_topic": "thread_tags/01",
"json_attributes_topic": "thread_tags/01",
"name": "01_temperature",
"unique_id": "7009D837C7BB557A_temperature_threadtag",
"device": {
"identifiers": [
"threadtag_7009D837C7BB557A"
],
"name": "thread tester tag",
"sw_version": "openthread v1.2",
"model": "produced version 1.2",
"manufacturer": "Home Smart Mesh"
},
"availability_topic": "thread_tags/state"
}
8 changes: 8 additions & 0 deletions containers/homeassistant/config/sensors/miflora.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- platform: miflora
mac: "C4:7C:8D:6A:B2:9D"
monitored_conditions:
- moisture
- light
- temperature
- conductivity
- battery
11 changes: 11 additions & 0 deletions containers/homeassistant/config/sensors/mvg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- platform: mvglive
nextdeparture:
- station: Unterschleißheim
name: "Go To City"
products: "S-Bahn"
timeoffset: 3
destinations: ['Marienplatz, München', 'Feldmoching']
- station: Hauptbahnhof
name: "Go Home"
products: "S-Bahn"
timeoffset: 2
147 changes: 147 additions & 0 deletions containers/homeassistant/config/www/custom_lovelace/mvg_card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
//https://gist.github.com/DavidMStraub/73bb87e41ca8da9ad3deebf06571989a
class MvgCard extends HTMLElement {
set hass(hass) {

const entityId = this.config.entity;
const state = hass.states[entityId];
const name = state.attributes['friendly_name']

if (!this.content) {
const card = document.createElement('ha-card');
card.header = name;
this.content = document.createElement('div');
const style = document.createElement('style');
style.textContent = `
table {
width: 100%;
padding: 6px 14px;
}
td {
padding: 3px 0px;
}
td.shrink {
white-space:nowrap;
}
td.expand {
width: 99%
}
span.line {
font-weight: bold;
font-size:0.9em;
padding:3px 8px 2px 8px;
color: #fff;
background-color: #888;
margin-right:0.7em;
}
span.S-Bahn {
border-radius:999px;
}
span.U-Bahn {
}
span.Tram {
background-color: #ee1c25;
}
span.Bus {
background-color: #005f5f;
}
span.U1 {
background-color: #3c7233;
}
span.U2 {
background-color: #c4022e;
}
span.U3 {
background-color: #ed6720;
}
span.U4 {
background-color: #00ab85;
}
span.U5 {
background-color: #be7b00;
}
span.U6 {
background-color: #0065af;
}
span.U7 {
background-color: #c4022e;
}
span.U8 {
background-color: #ed6720;
}
span.S1 {
background-color: #16c0e9;
}
span.S2 {
background-color: #71bf44;
}
span.S3 {
background-color: #7b107d;
}
span.S4 {
background-color: #ee1c25;
}
span.S5 {
background-color: #ffcc00;
color: black;
}
span.S6 {
background-color: #008a51;
}
span.S7 {
background-color: #963833;
}
span.S8 {
background-color: black;
color: #ffcb06;
}
span.S20 {
background-color: #f05a73;
}
`
card.appendChild(style);
card.appendChild(this.content);
this.appendChild(card);
}

var tablehtml = `
<table>
`
for (const attributes of state.attributes['departures']) {
const icon = attributes['icon']
const destination = attributes['destination']
const linename = attributes['linename']
const product = attributes['product']
const time = attributes['time']

const iconel = document.createElement('ha-icon');
iconel.setAttribute('icon', icon);
const iconHTML = iconel.outerHTML;

tablehtml += `
<tr>
<td class="shrink" style="text-align:center;"><span class="line ${product} ${linename}">${linename}</span></td>
<td class="expand">${destination}</td>
<td class="shrink" style="text-align:right;">${time}</td>
</tr>
`;
}
tablehtml += `
</table>
`

this.content.innerHTML = tablehtml
}

setConfig(config) {
if (!config.entity) {
throw new Error('You need to define an entity');
}
this.config = config;
}

getCardSize() {
return 1;
}
}

customElements.define('mvg-card', MvgCard);
1 change: 0 additions & 1 deletion containers/zigbee2mqtt/.gitignore

This file was deleted.

142 changes: 142 additions & 0 deletions containers/zigbee2mqtt/data/configuration-lifo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
homeassistant: true
permit_join: false
mqtt:
base_topic: lzig
server: 'mqtt://10.0.0.42'
serial:
port: /dev/ttyUSB1
advanced:
channel: 11
rtscts: false
log_level: debug
log_directory: /home/pi/share/zigbee/%TIMESTAMP%
last_seen: ISO_8601_local
devices:
'0x00124b0021b77899':
friendly_name: coord cc2652
'0x00124b001d4a014b':
friendly_name: power lifo
'0x00124b0018ed23a5':
friendly_name: old coord lifo
'0x00158d000192dd3e':
friendly_name: living heat
retain: true
'0x00158d0004240973':
friendly_name: office window right
retain: true
'0x00158d0004237aad':
friendly_name: office window left
retain: true
'0x00158d0002476b04':
friendly_name: fridge weather
retain: false
'0x00158d00028f7fb5':
friendly_name: office switch
retain: false
'0x00158d00041a3bfe':
friendly_name: bedroom window
retain: true
'0x00158d00041a3b31':
friendly_name: kitchen window
retain: true
'0x00124b001c2f1279':
friendly_name: power router
retain: false
'0x00158d0001922d10':
friendly_name: bathroom heat
retain: true
'0xccccccfffee20ebd':
friendly_name: tv button
'0x00158d0001922d4f':
friendly_name: bedroom heat
retain: true
'0x00158d000232c52c':
friendly_name: entrance door
'0x680ae2fffe3ebf5c':
friendly_name: bedroom roll
'0x680ae2fffeac9ea7':
friendly_name: roll button 1
'0x842e14fffe1be08a':
friendly_name: roll button 2
'0x00158d00024b3e45':
friendly_name: retro light switch
'0x00158d00028cad58':
friendly_name: bedroom switch
'0x04cf8cdf3c7b5bad':
friendly_name: day light
'0x00158d000543fc96':
friendly_name: freezer weather
'0x00158d00051e127b':
friendly_name: servers weather
'0x00158d0001922ce9':
friendly_name: kitchen heat
retain: true
'0x00124b001d49f6ac':
friendly_name: router office
'0x00158d00051e1276':
friendly_name: bedroom heat weather
'0x00158d00046514c5':
friendly_name: hallway living switch
'0x00158d000454de0a':
friendly_name: hallway entrance switch
'0x00158d00012a781d':
friendly_name: hallway corridor switch
'0x00158d000171876f':
friendly_name: toilet switch
'0x000d6ffffe09806c':
friendly_name: round dimmer
'0x00158d000255fb8b':
friendly_name: floody
'0x00124b001d4a012d':
friendly_name: mano power
'0x00158d0002a4f61e':
friendly_name: desk motion
retain: false
'0x00158d0001ef6374':
friendly_name: bed light button
retain: false
'0x00158d00026ecd6a':
friendly_name: office heat weather
retain: true
'0x00158d000237df83':
friendly_name: fridge weather
retain: false
'0x00158d000272623b':
friendly_name: balcony window left
retain: true
'0x00158d0002760208':
friendly_name: balcony window right
retain: true
'0x00158d0002518c83':
friendly_name: balcony door
retain: true
'0x00158d0001eb81c7':
friendly_name: tree button
retain: false
'0x00158d0002a2c21c':
friendly_name: bathroom fan button
retain: false
'0x00158d0001eb8fc9':
friendly_name: pc button
retain: false
'0x00158d0001e7a12b':
friendly_name: bed heat button
retain: false
'0x00158d0001922d22':
friendly_name: office heat
retain: true
'0x00158d0002a4f51d':
friendly_name: office chair vibration
'0x000d6ffffe9ccd6a':
friendly_name: cupboard light
'0x00158d0001eb9b32':
friendly_name: sonos button
'0x00158d0004570435':
friendly_name: living double switch
'0x00158d00029078a2':
friendly_name: bed nic button
'0x00158d0005484ec5':
friendly_name: living heat weather
retain: true
'0x00158d00028f8531':
friendly_name: '0x00158d00028f8531'
Loading

0 comments on commit 8a0545b

Please sign in to comment.