New scenes for HA standalone setup on raspi

- KNX buttons
- long click custom component
This commit is contained in:
Martin Bauer
2020-04-28 18:38:45 +00:00
parent c9c9c35561
commit 250556adc2
14 changed files with 1388 additions and 25 deletions

View File

@@ -4,7 +4,6 @@ from ruamel.yaml import YAML
yaml = YAML()
# -------------------------------------- put the config here -----------------------------------------------------------
def get_config():
@@ -263,7 +262,7 @@ def create_rules(folder):
rules += default_light_controls(data['group'], data['ir_host'])
rules += default_music_controls(data['media_player'], data['ir_host'])
rules += default_shutter_controls(data['group'], data['ir_host'])
file_name = os.path.join(folder, name + '.yaml')
file_name = os.path.join(folder, "ir_" + name + '.yaml')
with open(file_name, 'w') as f:
f.write("# Dont' edit manually! this is generated!\n\n")
yaml.dump(rules, f)

View File

@@ -70,7 +70,7 @@ def add_knx_devices(devices, groups):
# Bells
DeviceInfo("KlingelOben", "Klingel Oben", 'first_floor'),
DeviceInfo("Klingel Innen", "Klingel Innentür", 'other'),
DeviceInfo("Klingel Aussen", "Klingen Außentür", 'other'),
DeviceInfo("Klingel Aussen", "Klingel Außentür", 'other'),
]
scene_button_names = ['ObenLinks', 'ObenRechts', 'MitteLinks', 'MitteRechts', 'UntenLinks', 'UntenRechts']
scene_button_names = [(i, e) for i, e in enumerate(scene_button_names)]
@@ -101,7 +101,7 @@ def add_knx_devices(devices, groups):
DeviceInfo("HerdP2", "Herd Phase 2", 'living_area'),
DeviceInfo("HerdP3", "Herd Phase 3", 'living_area'),
# Rest
DeviceInfo("ArbeitszimmerSteckdose", "Arbeitszimmer Steckdose", 'office_martin'),
DeviceInfo("ArbeitszimmerSteckdose", "Arbeitszimmer Steckdose", 'office'),
DeviceInfo("WohnzimmerSteckdose1", "Wohnzimmer Steckdose 1", 'living_area'),
DeviceInfo("WohnzimmerSteckdose2", "Wohnzimmer Steckdose 2", 'living_area'),
]
@@ -163,7 +163,7 @@ def add_knx_devices(devices, groups):
def add_fhem_devices(devices, groups):
fhem_yaml_path = os.path.join(script_path, 'fhem.yaml')
fhem_yaml = yaml.load(open(fhem_yaml_path))
fhem_yaml = yaml.load(open(fhem_yaml_path, encoding="utf-8"))
for device_type, device_list in fhem_yaml.items():
if device_type not in devices:
devices[device_type] = []
@@ -258,14 +258,14 @@ def recorder_config(all_devices):
def create_config(target_directory, development=False):
groups_yaml_path = os.path.join(script_path, 'groups.yaml')
manual_config_path = os.path.join(script_path, 'manual_config.yaml')
group_dict = yaml.load(open(groups_yaml_path))
manual_config_dict = yaml.load(open(manual_config_path))
group_dict = yaml.load(open(groups_yaml_path, encoding="utf-8"))
manual_config_dict = yaml.load(open(manual_config_path, encoding="utf-8"))
all_devices = {}
add_knx_devices(all_devices, group_dict)
add_fhem_devices(all_devices, group_dict)
with open(os.path.join(target_directory, 'configuration.yaml'), 'w') as output:
with open(os.path.join(target_directory, 'configuration.yaml'), 'w', encoding="utf-8") as output:
output.write("# Dont' edit manually! this is generated!\n\n")
for key in ['sensor', 'switch', 'light', 'cover', 'binary_sensor']:
if key in manual_config_dict:

View File

@@ -1,12 +1,25 @@
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
#default_config:
frontend:
mobile_app:
person:
sun:
system_health:
updater:
#input_boolean:
#input_datetime:
#input_number:
#input_select:
#input_text:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
base_url: https://ha.bauer.tech
# Discover some devices automatically
# Di over some devices automatically
#discovery:
homeassistant:
@@ -100,7 +113,7 @@ dimmer:
cover_half:
long_click:
duration: 1.0
duration: 0.6
switches:
- switch.esszimmer_szene_0
- switch.esszimmer_szene_1
@@ -108,6 +121,12 @@ long_click:
- switch.esszimmer_szene_3
- switch.esszimmer_szene_4
- switch.esszimmer_szene_5
- switch.wohnzimmer_szene_0
- switch.wohnzimmer_szene_1
- switch.wohnzimmer_szene_2
- switch.wohnzimmer_szene_3
- switch.wohnzimmer_szene_4
- switch.wohnzimmer_szene_5
- switch.eingang_szene_2
- switch.eingang_szene_3
- switch.eingang_szene_4
@@ -137,29 +156,27 @@ tts:
knx:
rate_limit: 20
tunneling:
host: !secret knxd_host
host: 192.168.178.65
port: 3671
local_ip: !secret local_ip
fhem:
host: server
host: localhost
port: 7072
cul_device_name: CUL_HM
zwave:
usb_path: /dev/zwave-stick
usb_path: /dev/serial/by-id/usb-0658_0200-if00
network_key: "0xE0, 0x64, 0x50, 0x55, 0x20, 0x63, 0xC7, 0x05, 0x62, 0xD3, 0xEA, 0x91, 0x87, 0xE0, 0x1E, 0x74"
lirc_network:
- host: kitchenpi
- host: kitchenpi.fritz.box
port: 2222
- host: bedroompi
- host: bedroompi.fritz.box
port: 2222
- host: esszimmerradio
- host: esszimmerradio.fritz.box
port: 8765
- host: musikserverWohnzimmerOben
- host: musikserverWohnzimmerOben.fritz.box
port: 8765
binary_sensor:
@@ -167,14 +184,16 @@ binary_sensor:
media_player:
- platform: squeezebox_telnet
host: server
host: server.fritz.box
- platform: squeezebox_telnet
host: musikserverWohnzimmerOben.fritz.box
- platform: denonavr
host: avreceiver
host: avreceiver.fritz.box
vacuum:
- platform: xiaomi_miio
host: rockrobo
host: rockrobo.fritz.box
token: !secret vacuum_token
@@ -221,4 +240,35 @@ sensor:
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
scene: !include_dir_merge_list scenes
# Light groups
light:
- platform: group
name: Küche & Esszimmer Lichter
entities:
- light.kuche_deckenlampe
- light.esszimmer_deckenlampe_west
- light.esszimmer_deckenlampe_mitte
- light.kuche_links
- light.kuche_rechts
- light.kuche_vorne
- platform: group
name: Wohnzimmer Lichter
entities:
- light.wohnzimmer_deckenlampe
- light.wohnzimmer_kugel
- light.wohnzimmer_stehlampe
- light.wohnzimmer_stehlampe_oben
- light.wohnzimmer_regal_rechts
- light.wohnzimmer_regal_links
- platform: group
name: Garten Lichter
entities:
- light.garten_spot_birke
- light.garten_spot_magnolie
- light.garten_spot_beet
- light.garten_stehleuchte
- light.aussen_terassenlicht