From 58de4f38210a9c48f141ec2d93dde4eaeeed45bf Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Tue, 14 Sep 2021 14:38:05 +0200 Subject: [PATCH] Fixed zigbee2mqtt map, added path to lovelace pages --- .gitignore | 2 +- .storage/lovelace | 138 +++++++++++++++++-------- .storage/lovelace.lovelace_dispositivi | 15 +-- .storage/lovelace.lovelace_settings | 42 +++++--- .storage/lovelace_resources | 12 +-- packages/zigbee2mqtt.yaml | 11 +- 6 files changed, 144 insertions(+), 76 deletions(-) diff --git a/.gitignore b/.gitignore index c4734515..d794f791 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .storage .uuid deps/ -home-assistant.log +home-assistant.log* home-assistant_v2.db* image/ tts/ diff --git a/.storage/lovelace b/.storage/lovelace index 9dee909f..b50f2ea2 100644 --- a/.storage/lovelace +++ b/.storage/lovelace @@ -9,6 +9,7 @@ "icon": "mdi:home", "id": "main", "title": "Principale", + "path": "main", "badges": [ { "entity": "person.giorgio" @@ -365,16 +366,38 @@ ] }, { + "icon": "mdi:lightbulb", + "id": "lights", + "title": "Luci", + "path": "lights", "badges": [ - "light.luce_cucina", - "light.luce_corridoio", - "light.luce_sala", - "light.luce_divano", - "light.luce_bagno", - "light.luce_specchio", - "light.luce_studio", - "light.luce_camera", - "light.luce_balcone" + { + "entity": "light.luce_cucina" + }, + { + "entity": "light.luce_corridoio" + }, + { + "entity": "light.luce_sala" + }, + { + "entity": "light.luce_divano" + }, + { + "entity": "light.luce_bagno" + }, + { + "entity": "light.luce_specchio" + }, + { + "entity": "light.luce_studio" + }, + { + "entity": "light.luce_camera" + }, + { + "entity": "light.luce_balcone" + } ], "cards": [ { @@ -451,17 +474,26 @@ "name": "Luce Balcone", "type": "light" } - ], - "icon": "mdi:lightbulb", - "id": "light", - "title": "Luci" + ] }, { + "icon": "mdi:window-shutter", + "id": "covers", + "title": "Tapparelle", + "path": "covers", "badges": [ - "sensor.tapparella_cucina", - "sensor.tapparella_sala", - "sensor.tapparella_studio", - "sensor.tapparella_camera" + { + "entity": "sensor.tapparella_cucina" + }, + { + "entity": "sensor.tapparella_sala" + }, + { + "entity": "sensor.tapparella_studio" + }, + { + "entity": "sensor.tapparella_camera" + } ], "cards": [ { @@ -508,15 +540,13 @@ ], "type": "custom:shutter-card" } - ], - "icon": "mdi:window-shutter", - "id": "covers", - "title": "Tapparelle" + ] }, { "icon": "mdi:thermometer", "id": "climate", "title": "Termostato", + "path": "climate", "badges": [ { "entity": "sensor.valve_cucina_temperature" @@ -737,11 +767,23 @@ ] }, { + "icon": "mdi:account-multiple", + "id": "people", + "title": "People", + "path": "people", "badges": [ - "person.giorgio", - "person.laura", - "person.anna", - "person.assunta" + { + "entity": "person.giorgio" + }, + { + "entity": "person.laura" + }, + { + "entity": "person.anna" + }, + { + "entity": "person.assunta" + } ], "cards": [ { @@ -776,10 +818,7 @@ "hours_to_show": 24, "type": "map" } - ], - "icon": "mdi:account-multiple", - "id": "people", - "title": "People" + ] }, { "title": "Auto", @@ -796,6 +835,8 @@ } }, "icon": "mdi:car", + "id": "car", + "path": "car", "badges": [], "cards": [ { @@ -1290,9 +1331,10 @@ }, { "icon": "mdi:flash", - "id": "power", + "id": "energy", "title": "Monitoraggio Energetico", "type": "sidebar", + "path": "energy", "badges": [ { "entity": "sensor.shelly_em_channel_1_power" @@ -1330,7 +1372,7 @@ "unit": "kWh", "severity": { "green": 0, - "yellow": 3, + "yellow": 4, "red": 5 }, "needle": true, @@ -1385,29 +1427,42 @@ ] }, { + "icon": "mdi:alarm-light-outline", + "id": "alarms", + "title": "Allarmi", + "path": "alarms", "badges": [ - "binary_sensor.alarms" + { + "entity": "binary_sensor.alarms" + } ], "cards": [ { "entities": [ - "group.alarms", - "input_boolean.generic_alarm", - "input_boolean.door_alarm" + { + "entity": "group.alarms" + }, + { + "entity": "input_boolean.generic_alarm" + }, + { + "entity": "input_boolean.door_alarm" + }, + { + "entity": "input_boolean.car_alarm" + } ], "show_header_toggle": false, "title": "Allarmi Casa", "type": "entities" } - ], - "icon": "mdi:alarm-light-outline", - "id": "allarmi", - "title": "Allarmi" + ] }, { + "icon": "mdi:home-thermometer", + "id": "temperature", "title": "Temperature", "path": "temperature", - "icon": "mdi:home-thermometer", "badges": [], "cards": [ { @@ -1876,8 +1931,9 @@ }, { "icon": "mdi:weather-sunny", - "id": "meteo", + "id": "weather", "title": "Meteo", + "path": "weather", "badges": [ { "entity": "sun.sun" diff --git a/.storage/lovelace.lovelace_dispositivi b/.storage/lovelace.lovelace_dispositivi index 4ef301df..4a5eeb50 100644 --- a/.storage/lovelace.lovelace_dispositivi +++ b/.storage/lovelace.lovelace_dispositivi @@ -170,16 +170,16 @@ "layout": "vertical", "cards": [ { - "css": ":host {\n --zigbee2mqtt-networkmap-node-color: rgba(18, 120, 98, .7);\n --zigbee2mqtt-networkmap-node-fill-color: #dcfaf3;\n --zigbee2mqtt-networkmap-node-pinned-color: rgba(190, 56, 93, .6);\n --zigbee2mqtt-networkmap-link-color: rgba(18, 120, 98, .5);\n --zigbee2mqtt-networkmap-hover-color: #be385d;\n --zigbee2mqtt-networkmap-link-selected-color: rgba(202, 164, 85, .6);\n --zigbee2mqtt-networkmap-label-color: #127862;\n --zigbee2mqtt-networkmap-arrow-color: rgba(18, 120, 98, 0.7);\n --zigbee2mqtt-networkmap-node-coordinator-color: rgba(224, 78, 93, .7);\n --zigbee2mqtt-networkmap-node-router-color: rgba(0, 165, 255, .7);\n}\n", + "title": "Zigbee2mqtt Network Map", + "type": "custom:zigbee2mqtt-networkmap", "entity": "sensor.zigbee2mqtt_networkmap", - "font_size": 12, - "force": 3000, - "height": 400, - "link_width": 2, "mqtt_base_topic": "zigbee2mqtt", + "force": 3000, "node_size": 16, - "title": "Zigbee2mqtt Network Map", - "type": "custom:zigbee2mqtt-networkmap" + "font_size": 12, + "link_width": 2, + "height": 400, + "css": ":host {\n --zigbee2mqtt-networkmap-node-color: rgba(18, 120, 98, .7);\n --zigbee2mqtt-networkmap-node-fill-color: #dcfaf3;\n --zigbee2mqtt-networkmap-node-pinned-color: rgba(190, 56, 93, .6);\n --zigbee2mqtt-networkmap-link-color: rgba(18, 120, 98, .5);\n --zigbee2mqtt-networkmap-hover-color: #be385d;\n --zigbee2mqtt-networkmap-link-selected-color: rgba(202, 164, 85, .6);\n --zigbee2mqtt-networkmap-label-color: #127862;\n --zigbee2mqtt-networkmap-arrow-color: rgba(18, 120, 98, 0.7);\n --zigbee2mqtt-networkmap-node-coordinator-color: rgba(224, 78, 93, .7);\n --zigbee2mqtt-networkmap-node-router-color: rgba(0, 165, 255, .7);\n}\n" } ] } @@ -280,6 +280,7 @@ } }, "icon": "mdi:alpha-s-box", + "path": "shelly", "badges": [], "cards": [ { diff --git a/.storage/lovelace.lovelace_settings b/.storage/lovelace.lovelace_settings index c750a773..ce08f6f8 100644 --- a/.storage/lovelace.lovelace_settings +++ b/.storage/lovelace.lovelace_settings @@ -6,6 +6,9 @@ "title": "Sistema Home Assistant", "views": [ { + "icon": "mdi:cog", + "title": "Configurazione", + "path": "config", "badges": [ { "entity": "binary_sensor.home_mode" @@ -93,14 +96,13 @@ ], "type": "vertical-stack" } - ], - "icon": "mdi:cog", - "title": "Configurazione" + ] }, { "icon": "mdi:lan", "title": "Dispositivi di Rete", "type": "sidebar", + "path": "network", "badges": [], "cards": [ { @@ -165,6 +167,9 @@ ] }, { + "icon": "mdi:zigbee", + "title": "Zigbee", + "path": "zigbee", "badges": [], "cards": [ { @@ -293,20 +298,25 @@ ] }, { - "css": ":host {\n --zigbee2mqtt-networkmap-node-color: rgba(18, 120, 98, .7);\n --zigbee2mqtt-networkmap-node-fill-color: #dcfaf3;\n --zigbee2mqtt-networkmap-node-pinned-color: rgba(190, 56, 93, .6);\n --zigbee2mqtt-networkmap-link-color: rgba(18, 120, 98, .5);\n --zigbee2mqtt-networkmap-hover-color: #be385d;\n --zigbee2mqtt-networkmap-link-selected-color: rgba(202, 164, 85, .6);\n --zigbee2mqtt-networkmap-label-color: #127862;\n --zigbee2mqtt-networkmap-arrow-color: rgba(18, 120, 98, 0.7);\n --zigbee2mqtt-networkmap-node-coordinator-color: rgba(224, 78, 93, .7);\n --zigbee2mqtt-networkmap-node-router-color: rgba(0, 165, 255, .7);\n}\n", - "entity": "sensor.zigbee2mqtt_networkmap", - "font_size": 12, - "force": 3000, - "height": 400, - "link_width": 2, - "mqtt_base_topic": "zigbee2mqtt", - "node_size": 16, - "title": "Zigbee2mqtt Network Map", - "type": "custom:zigbee2mqtt-networkmap" + "type": "vertical-stack", + "title": "Mappa Dispositivi", + "layout": "vertical", + "cards": [ + { + "title": "Zigbee2mqtt Network Map", + "type": "custom:zigbee2mqtt-networkmap", + "entity": "sensor.zigbee2mqtt_networkmap", + "mqtt_base_topic": "zigbee2mqtt", + "force": 3000, + "node_size": 16, + "font_size": 12, + "link_width": 2, + "height": 400, + "css": ":host {\n --zigbee2mqtt-networkmap-node-color: rgba(18, 120, 98, .7);\n --zigbee2mqtt-networkmap-node-fill-color: #dcfaf3;\n --zigbee2mqtt-networkmap-node-pinned-color: rgba(190, 56, 93, .6);\n --zigbee2mqtt-networkmap-link-color: rgba(18, 120, 98, .5);\n --zigbee2mqtt-networkmap-hover-color: #be385d;\n --zigbee2mqtt-networkmap-link-selected-color: rgba(202, 164, 85, .6);\n --zigbee2mqtt-networkmap-label-color: #127862;\n --zigbee2mqtt-networkmap-arrow-color: rgba(18, 120, 98, 0.7);\n --zigbee2mqtt-networkmap-node-coordinator-color: rgba(224, 78, 93, .7);\n --zigbee2mqtt-networkmap-node-router-color: rgba(0, 165, 255, .7);\n}\n" + } + ] } - ], - "icon": "mdi:zigbee", - "title": "Zigbee" + ] } ] } diff --git a/.storage/lovelace_resources b/.storage/lovelace_resources index 4e6aeae3..df007902 100644 --- a/.storage/lovelace_resources +++ b/.storage/lovelace_resources @@ -18,15 +18,10 @@ "type": "module", "url": "/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js" }, - { - "id": "30e56555d1eb432abe3fcc5b9cb16be1", - "type": "module", - "url": "/hacsfiles/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js" - }, { "id": "6c8988516c824aa99cbd556a0b4ff39c", "type": "module", - "url": "/hacsfiles/lovelace-layout-card/layout-card.js?hacstag=156434866230" + "url": "/hacsfiles/lovelace-layout-card/layout-card.js?hacstag=156434866231" }, { "id": "b28e5c5a648145f0828a10f89b1b7770", @@ -52,6 +47,11 @@ "url": "/hacsfiles/mini-graph-card/mini-graph-card-bundle.js", "type": "module", "id": "e4685ccd929f4e71a561d0d397f8ae80" + }, + { + "url": "/hacsfiles/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js?hacstag=201292040070", + "type": "module", + "id": "746f4aa8840a4986b284e7ac56c83789" } ] } diff --git a/packages/zigbee2mqtt.yaml b/packages/zigbee2mqtt.yaml index 3a19d3e5..f9780569 100644 --- a/packages/zigbee2mqtt.yaml +++ b/packages/zigbee2mqtt.yaml @@ -19,7 +19,7 @@ sensor: state_topic: "zigbee2mqtt/bridge/config" value_template: "{{ value_json.permit_join }}" icon: mdi:link-lock - + ###################################################################### # Sensor for monitoring the log_level state ###################################################################### @@ -78,18 +78,19 @@ sensor: # Zigbee2mqtt Networkmap ###################################################################### - platform: mqtt - name: "Zigbee2mqtt: Networkmap" - state_topic: zigbee2mqtt/bridge/networkmap/raw + name: Zigbee2mqtt Networkmap + state_topic: zigbee2mqtt/bridge/response/networkmap value_template: >- {{ now().strftime('%Y-%m-%d %H:%M:%S') }} - json_attributes_topic: zigbee2mqtt/bridge/networkmap/raw + json_attributes_topic: zigbee2mqtt/bridge/response/networkmap + json_attributes_template: "{{ value_json.data.value | tojson }}" ###################################################################### # Zigbee2mqtt Package - Switch ###################################################################### switch: - # Switch for enabling joining + # Switch for enabling joining - platform: mqtt name: "Zigbee2mqtt: Abilita join" state_topic: "zigbee2mqtt/bridge/config/permit_join" -- 2.47.3