updating configuration
This commit is contained in:
@@ -22,6 +22,8 @@ update_secrets_sample:
|
|||||||
@find . -name *.env | xargs -I{} cp {} {}.sample
|
@find . -name *.env | xargs -I{} cp {} {}.sample
|
||||||
@find . -name *.env.sample | xargs -I{} sed -i "s/\=.*/\=xxxxxxxxx/g" {}
|
@find . -name *.env.sample | xargs -I{} sed -i "s/\=.*/\=xxxxxxxxx/g" {}
|
||||||
|
|
||||||
|
@cat zigbee2mqtt/settings/configuration.yaml | sed "s/\:.*/\: xxxxxxxxx/g" > zigbee2mqtt/settings/configuration.yaml.sample #mask passwords
|
||||||
|
|
||||||
commit: update_secrets_sample
|
commit: update_secrets_sample
|
||||||
git add .
|
git add .
|
||||||
git commit -m "$(call ARGS,\"updating configuration\")"
|
git commit -m "$(call ARGS,\"updating configuration\")"
|
||||||
|
|||||||
@@ -4,15 +4,16 @@ import globals
|
|||||||
class KitchenLedController(hass.Hass):
|
class KitchenLedController(hass.Hass):
|
||||||
listen_event_handle_list = []
|
listen_event_handle_list = []
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
if not globals.check_args(self,['watch_entity', 'topic']):
|
if not globals.check_args(self,['watch_entity']):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.listen_event_handle_list.append(self.listen_state(self.entity_changed, self.args['watch_entity']))
|
self.listen_event_handle_list.append(self.listen_state(self.entity_changed, self.args['watch_entity']))
|
||||||
|
|
||||||
def entity_changed(self, entity, attribute, old, new, kwargs):
|
def entity_changed(self, entity, attribute, old, new, kwargs):
|
||||||
stete = "off"
|
if 'topic' in self.args:
|
||||||
if new == "off":
|
self.call_service("mqtt/publish", topic = self.args['topic'], payload = new)
|
||||||
stete = "off"
|
if 'control_entity' in self.args:
|
||||||
if new == "on":
|
if new == "on":
|
||||||
stete = "on"
|
self.turn_on(self.args['control_entity'])
|
||||||
self.call_service("mqtt/publish", topic = self.args['topic'], payload = stete)
|
if new == "off":
|
||||||
|
self.turn_off(self.args['control_entity'])
|
||||||
@@ -8,3 +8,11 @@ kitchen_led_controller:
|
|||||||
topic: home/kitchen-led/kitchen-led/state/set
|
topic: home/kitchen-led/kitchen-led/state/set
|
||||||
global_dependencies:
|
global_dependencies:
|
||||||
- globals
|
- globals
|
||||||
|
|
||||||
|
bath_led_controller:
|
||||||
|
module: kitchen_led_controller
|
||||||
|
class: KitchenLedController
|
||||||
|
watch_entity: light.bath
|
||||||
|
control_entity: light.philips_led
|
||||||
|
global_dependencies:
|
||||||
|
- globals
|
||||||
@@ -17,7 +17,7 @@ import datetime
|
|||||||
class AirFresher(hass.Hass):
|
class AirFresher(hass.Hass):
|
||||||
timers = []
|
timers = []
|
||||||
fresh_times = 0
|
fresh_times = 0
|
||||||
fresh_every_mins = 10
|
fresh_every_mins = 15
|
||||||
last_fresh_date = None
|
last_fresh_date = None
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
|
|||||||
@@ -123,6 +123,19 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-size: 50m
|
max-size: 50m
|
||||||
|
|
||||||
|
zigbee2mqtt:
|
||||||
|
image: koenkk/zigbee2mqtt:latest-dev
|
||||||
|
container_name: zigbee2mqtt
|
||||||
|
volumes:
|
||||||
|
- ./zigbee2mqtt/settings:/app/data
|
||||||
|
devices:
|
||||||
|
- /dev/zigbee:/dev/ttyACM0
|
||||||
|
privileged: true
|
||||||
|
restart: always
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: 50m
|
||||||
###########################
|
###########################
|
||||||
# GRAFANA #
|
# GRAFANA #
|
||||||
###########################
|
###########################
|
||||||
|
|||||||
@@ -3,4 +3,3 @@ bath_light:
|
|||||||
control: hidden
|
control: hidden
|
||||||
entities:
|
entities:
|
||||||
- light.bath
|
- light.bath
|
||||||
- light.philips_led
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee"
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sudo cp 100-zigbee.rules /etc/udev/rules.d/
|
||||||
|
sudo udevadm trigger
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Home Assistant integration (MQTT discovery)
|
||||||
|
homeassistant: xxxxxxxxx
|
||||||
|
|
||||||
|
# allow new devices to join
|
||||||
|
permit_join: xxxxxxxxx
|
||||||
|
|
||||||
|
# MQTT settings
|
||||||
|
mqtt: xxxxxxxxx
|
||||||
|
# MQTT base topic for zigbee2mqtt MQTT messages
|
||||||
|
base_topic: xxxxxxxxx
|
||||||
|
# MQTT server URL
|
||||||
|
server: xxxxxxxxx
|
||||||
|
# MQTT server authentication, uncomment if required: xxxxxxxxx
|
||||||
|
user: xxxxxxxxx
|
||||||
|
password: xxxxxxxxx
|
||||||
|
|
||||||
|
# Serial settings
|
||||||
|
serial: xxxxxxxxx
|
||||||
|
# Location of CC2531 USB sniffer
|
||||||
|
port: xxxxxxxxx
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
Reference in New Issue
Block a user