diff --git a/.gitignore b/.gitignore index 6a6b7cc..6f0c461 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +**.db *.swp *.swo .HA_VERSION @@ -15,4 +16,9 @@ shell_commands/__pycache__/ __pycache__/ ip_bans.yaml custom_components/ -.ssh/* +.ssh/ +node-red/ +**/log/* +**.bk + + diff --git a/configuration.yaml b/configuration.yaml index a8ebb2b..193e769 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -9,6 +9,7 @@ group: !include groups.yaml automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml +template: !include template.yaml http: use_x_forwarded_for: true @@ -18,3 +19,23 @@ http: - ::1 #ip_ban_enabled: true #login_attempts_threshold: 5 + +influxdb: + host: a0d7b954-influxdb + port: 8086 + database: homeassistant + username: homeassistant + password: QVT5eqCgCXDxpSu4b7Rl + max_retries: 3 + default_measurement: state + + +# Obývák / hlavní světlo +light: + - platform: group + name: Obývák + entities: + - light.0xb4e3f9fffe102c1f + - light.0xb4e3f9fffe102c12 + - light.0x84fd27fffe80415b + - light.0x84fd27fffed7b8a4 \ No newline at end of file diff --git a/image/1fa111d474f1d2a5e466a4de055673f3/512x512 b/image/1fa111d474f1d2a5e466a4de055673f3/512x512 new file mode 100644 index 0000000..b877874 Binary files /dev/null and b/image/1fa111d474f1d2a5e466a4de055673f3/512x512 differ diff --git a/image/1fa111d474f1d2a5e466a4de055673f3/original b/image/1fa111d474f1d2a5e466a4de055673f3/original new file mode 100644 index 0000000..149f7b7 Binary files /dev/null and b/image/1fa111d474f1d2a5e466a4de055673f3/original differ diff --git a/scenes.yaml b/scenes.yaml index e69de29..febec5a 100644 --- a/scenes.yaml +++ b/scenes.yaml @@ -0,0 +1,49 @@ +- id: '1643423451315' + name: Nová scéna + entities: + sensor.livingroom_scene_switch_action: + action: '' + battery: 100 + device: + applicationVersion: 65 + dateCode: '' + friendlyName: livingroom/scene_switch + hardwareVersion: 1 + ieeeAddr: '0x60a423fffefc9539' + manufacturerID: 4098 + manufacturerName: _TZ3000_xabckq1v + model: TS004F + networkAddress: 63306 + powerSource: Battery + stackVersion: 0 + type: EndDevice + zclVersion: 3 + linkquality: 65 + voltage: 3000 + icon: mdi:gesture-double-tap + friendly_name: livingroom/scene_switch_action + state: '' + sensor.livingroom_scene_switch_battery: + state_class: measurement + action: '' + battery: 100 + device: + applicationVersion: 65 + dateCode: '' + friendlyName: livingroom/scene_switch + hardwareVersion: 1 + ieeeAddr: '0x60a423fffefc9539' + manufacturerID: 4098 + manufacturerName: _TZ3000_xabckq1v + model: TS004F + networkAddress: 63306 + powerSource: Battery + stackVersion: 0 + type: EndDevice + zclVersion: 3 + linkquality: 65 + voltage: 3000 + unit_of_measurement: '%' + device_class: battery + friendly_name: livingroom/scene_switch_battery + state: '100' diff --git a/template.yaml b/template.yaml new file mode 100644 index 0000000..a37ce6b --- /dev/null +++ b/template.yaml @@ -0,0 +1,32 @@ +- sensor: + - name: "Energy Total" + unique_id: energy_total + state: >- + {{ states('sensor.phase_a_energy')|float + + states('sensor.phase_b_energy')|float + + states('sensor.phase_c_energy')|float }} + unit_of_measurement: kWh + device_class: energy + state_class: measurement + attributes: + last_reset: "1970-01-01T00:00:00+00:00" + - name: "Power Total" + unique_id: power_total + state: >- + {{ (states('sensor.phase_a_power')|float + + states('sensor.phase_b_power')|float + + states('sensor.phase_c_power')|float) }} + unit_of_measurement: W + device_class: power + state_class: measurement + - name: "Power Factor Total" + unique_id: power_factor_total + state: >- + {{ (((states('sensor.phase_a_power')|float) * (states('sensor.phase_a_power_factor')|float) + + (states('sensor.phase_b_power')|float) * (states('sensor.phase_b_power_factor')|float) + + (states('sensor.phase_c_power')|float) * (states('sensor.phase_c_power_factor')|float)) / + (states('sensor.phase_a_power')|float + states('sensor.phase_b_power')|float + states('sensor.phase_c_power')|float)) + |int }} + unit_of_measurement: "%" + device_class: power_factor + state_class: measurement \ No newline at end of file diff --git a/zigbee2mqtt/configuration.yaml b/zigbee2mqtt/configuration.yaml new file mode 100644 index 0000000..d4c27d4 --- /dev/null +++ b/zigbee2mqtt/configuration.yaml @@ -0,0 +1,57 @@ +{ + "external_converters": [], + "devices": [ + "devices.yaml" + ], + "groups": [ + "groups.yaml" + ], + "homeassistant": true, + "permit_join": false, + "mqtt": { + "base_topic": "zigbee2mqtt", + "user": "mqtt", + "password": "aqCQhMrTqDzpTxlpqTEg", + "client_id": "zigbee2mqtt", + "include_device_information": true, + "server": "mqtt://core-mosquitto:1883" + }, + "serial": { + "port": "/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0", + "disable_led": false + }, + "advanced": { + "log_level": "debug", + "pan_id": 6754, + "channel": 25, + "network_key": [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 0, + 2, + 4, + 6, + 8, + 10, + 12, + 13 + ], + "availability_blocklist": [], + "availability_passlist": [] + }, + "device_options": {}, + "blocklist": [], + "passlist": [], + "queue": {}, + "frontend": { + "port": 8099 + }, + "experimental": {}, + "availability": false +} diff --git a/zigbee2mqtt/coordinator_backup.json b/zigbee2mqtt/coordinator_backup.json new file mode 100644 index 0000000..6b41f69 --- /dev/null +++ b/zigbee2mqtt/coordinator_backup.json @@ -0,0 +1,82 @@ +{ + "metadata": { + "format": "zigpy/open-coordinator-backup", + "version": 1, + "source": "zigbee-herdsman@0.14.53", + "internal": { + "date": "2022-09-17T10:02:21.950Z", + "znpVersion": 1 + } + }, + "stack_specific": { + "zstack": { + "tclk_seed": "d21792f5fee85dadff59310ae054f2a8" + } + }, + "coordinator_ieee": "00124b0024c0e91d", + "pan_id": "1a62", + "extended_pan_id": "00124b0024c0e91d", + "nwk_update_id": 0, + "security_level": 5, + "channel": 25, + "channel_mask": [ + 25 + ], + "network_key": { + "key": "01030507090b0d0f00020406080a0c0d", + "sequence_number": 0, + "frame_counter": 1538779 + }, + "devices": [ + { + "nwk_address": "9064", + "ieee_address": "60a423fffefc9539", + "is_child": false, + "link_key": { + "key": "eb826e0b01cbf9cdc6cccdf41f7756c8", + "rx_counter": 0, + "tx_counter": 99 + } + }, + { + "nwk_address": "2b37", + "ieee_address": "b4e3f9fffe102c12", + "is_child": false, + "link_key": { + "key": "4b1d1a1eab0b4b6605bee50017a44e4b", + "rx_counter": 0, + "tx_counter": 110 + } + }, + { + "nwk_address": "ae41", + "ieee_address": "84fd27fffed7b8a4", + "is_child": false, + "link_key": { + "key": "5a508a53007ecc8e44ec25562d306f71", + "rx_counter": 17, + "tx_counter": 129 + } + }, + { + "nwk_address": "7aa5", + "ieee_address": "84fd27fffe80415b", + "is_child": false, + "link_key": { + "key": "06ec7fa7ce2d1dd0a9e952e96dd2036c", + "rx_counter": 15, + "tx_counter": 129 + } + }, + { + "nwk_address": "d878", + "ieee_address": "b4e3f9fffe102c1f", + "is_child": false, + "link_key": { + "key": "b2d349cff519b746b7fe076c0a070be9", + "rx_counter": 0, + "tx_counter": 99 + } + } + ] +} \ No newline at end of file diff --git a/zigbee2mqtt/devices.yaml b/zigbee2mqtt/devices.yaml new file mode 100644 index 0000000..05ff874 --- /dev/null +++ b/zigbee2mqtt/devices.yaml @@ -0,0 +1,10 @@ +'0xb4e3f9fffe102c12': + friendly_name: livingroom/main_light_2 +'0x84fd27fffed7b8a4': + friendly_name: livingroom/main_light_4 +'0x84fd27fffe80415b': + friendly_name: livingroom/main_light_3 +'0xb4e3f9fffe102c1f': + friendly_name: livingroom/main_light_1 +'0x60a423fffefc9539': + friendly_name: livingroom/scene_switch diff --git a/zigbee2mqtt/groups.yaml b/zigbee2mqtt/groups.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/zigbee2mqtt/groups.yaml @@ -0,0 +1 @@ +{} diff --git a/zigbee2mqtt/state.json b/zigbee2mqtt/state.json new file mode 100644 index 0000000..00e290e --- /dev/null +++ b/zigbee2mqtt/state.json @@ -0,0 +1,51 @@ +{ + "0xb4e3f9fffe102c12": { + "color_mode": "color_temp", + "state": "OFF", + "color_temp": 413, + "brightness": 254, + "color": { + "x": 0.4843, + "y": 0.4145 + }, + "linkquality": 32 + }, + "0x84fd27fffed7b8a4": { + "color_mode": "color_temp", + "state": "OFF", + "color_temp": 413, + "brightness": 254, + "color": { + "x": 0.4843, + "y": 0.4145 + }, + "linkquality": 40 + }, + "0x84fd27fffe80415b": { + "color_mode": "color_temp", + "state": "ON", + "brightness": 254, + "color_temp": 413, + "color": { + "x": 0.4843, + "y": 0.4145 + }, + "linkquality": 29 + }, + "0xb4e3f9fffe102c1f": { + "color_mode": "color_temp", + "state": "OFF", + "brightness": 254, + "color_temp": 413, + "color": { + "x": 0.4843, + "y": 0.4145 + }, + "linkquality": 14 + }, + "0x60a423fffefc9539": { + "battery": 78, + "voltage": 2800, + "linkquality": 76 + } +} \ No newline at end of file