From b2e5c11119a13a2fb6d548ac41b6bfc02486da66 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Sun, 19 Feb 2023 23:42:30 +0100 Subject: [PATCH] Added water leak sensors --- .storage/lovelace.lovelace_dispositivi | 699 ++++++++++++++++++++----- .storage/lovelace.lovelace_settings | 18 +- customizations/xiaomi.yaml | 52 +- 3 files changed, 630 insertions(+), 139 deletions(-) diff --git a/.storage/lovelace.lovelace_dispositivi b/.storage/lovelace.lovelace_dispositivi index def3c8e9..8b3a5630 100644 --- a/.storage/lovelace.lovelace_dispositivi +++ b/.storage/lovelace.lovelace_dispositivi @@ -352,6 +352,234 @@ } ] }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "FRITZ!Box 7590" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "/local/images/devices/fritzbox_7590.png", + "tap_action": { + "action": "url", + "url_path": "https://fritz.giorgioravera.it" + } + }, + { + "type": "vertical-stack", + "cards": [ + { + "type": "custom:button-card", + "layout": "icon_name_state", + "name": "Riavvia Dispositivo", + "tap_action": { + "action": "call-service", + "service": "shell_command.fritz_reboot" + }, + "show_icon": true, + "show_state": false, + "icon": "mdi:restart", + "styles": { + "grid": [ + { + "grid-template-columns": "50px auto" + } + ], + "icon": [ + { + "padding": "0px 0px" + }, + { + "height": "25px" + }, + { + "width": "25px" + }, + { + "color": "var(--state-icon-color)" + } + ], + "card": [ + { + "--ha-card-background": "rgba(0, 0, 0, 0)" + }, + { + "--ha-card-box-shadow": "none" + } + ], + "name": [ + { + "padding": "0px 10px" + }, + { + "justify-self": "start" + }, + { + "font-family": "Roboto, sans-serif" + }, + { + "font-size": "15px" + }, + { + "color": "var(--primary-text-color)" + } + ] + } + }, + { + "type": "custom:button-card", + "layout": "icon_name_state", + "name": "Ricollega a WAN", + "tap_action": { + "action": "call-service", + "service": "shell_command.fritz_reconnect" + }, + "show_icon": true, + "show_state": false, + "icon": "mdi:connection", + "styles": { + "grid": [ + { + "grid-template-columns": "50px auto" + } + ], + "icon": [ + { + "padding": "0px 0px" + }, + { + "height": "25px" + }, + { + "width": "25px" + }, + { + "color": "var(--state-icon-color)" + } + ], + "card": [ + { + "--ha-card-background": "rgba(0, 0, 0, 0)" + }, + { + "--ha-card-box-shadow": "none" + } + ], + "name": [ + { + "padding": "0px 10px" + }, + { + "justify-self": "start" + }, + { + "font-family": "Roboto, sans-serif" + }, + { + "font-size": "15px" + }, + { + "color": "var(--primary-text-color)" + } + ] + } + }, + { + "type": "custom:button-card", + "layout": "icon_name_state", + "entity": "switch.fritz_led", + "name": "LED", + "show_icon": true, + "show_state": false, + "styles": { + "grid": [ + { + "grid-template-columns": "50px auto" + } + ], + "icon": [ + { + "padding": "0px 0px" + }, + { + "height": "25px" + }, + { + "width": "25px" + }, + { + "color": "var(--state-icon-color)" + } + ], + "card": [ + { + "--ha-card-background": "rgba(0, 0, 0, 0)" + }, + { + "--ha-card-box-shadow": "none" + } + ], + "name": [ + { + "padding": "0px 10px" + }, + { + "justify-self": "start" + }, + { + "font-family": "Roboto, sans-serif" + }, + { + "font-size": "15px" + }, + { + "color": "var(--primary-text-color)" + } + ] + }, + "state": [ + { + "value": "on", + "styles": { + "icon": [ + { + "color": "lightgreen" + } + ] + } + }, + { + "value": "off", + "styles": { + "icon": [ + { + "color": "grey" + } + ] + } + } + ] + } + ] + } + ] + } + ] + } + ] + }, { "type": "entities", "show_header_toggle": "off", @@ -660,7 +888,7 @@ "entities": [ { "type": "section", - "label": "Canon PIXMA TR8550" + "label": "BTicino Classe 300EOS with Netatmo" }, { "type": "custom:hui-element", @@ -671,12 +899,8 @@ "cards": [ { "type": "picture", - "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0.0)\";\n --ha-card-box-shadow: 'none';\n}\n", - "image": "/local/images/devices/canon_tr8550.png", - "tap_action": { - "action": "url", - "url_path": "http://stampante.giorgioravera.it" - } + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "/local/images/devices/classe300eos.png" }, { "type": "vertical-stack", @@ -684,15 +908,12 @@ { "type": "custom:button-card", "layout": "icon_name_state", - "name": "Gestione", + "entity": "switch.portone", + "name": "Apertura Portone", "show_name": true, "show_icon": true, - "show_state": true, - "icon": "mdi:cogs", - "tap_action": { - "action": "url", - "url_path": "http://stampante.giorgioravera.it" - }, + "show_state": false, + "color-type": "card", "styles": { "grid": [ { @@ -708,9 +929,6 @@ }, { "width": "25px" - }, - { - "color": "var(--state-icon-color)" } ], "card": [ @@ -738,17 +956,78 @@ "color": "var(--primary-text-color)" } ] - } - }, + }, + "state": [ + { + "value": "on", + "styles": { + "icon": [ + { + "color": "grey" + } + ] + } + }, + { + "value": "off", + "styles": { + "icon": [ + { + "color": "lightgreen" + } + ] + } + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "Canon PIXMA TR8550" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0.0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "/local/images/devices/canon_tr8550.png", + "tap_action": { + "action": "url", + "url_path": "http://stampante.giorgioravera.it" + } + }, + { + "type": "vertical-stack", + "cards": [ { "type": "custom:button-card", "layout": "icon_name_state", - "entity": "sensor.canon_tr8500_series", - "name": "Stato", - "show_name": false, + "name": "Gestione", + "show_name": true, "show_icon": true, "show_state": true, - "icon": "[[[\n if (entity.state==\"idle\")\n return \"mdi:printer\"\n else\n return \"mdi:printer-settings\"\n]]]\n", + "icon": "mdi:cogs", + "tap_action": { + "action": "url", + "url_path": "http://stampante.giorgioravera.it" + }, "styles": { "grid": [ { @@ -794,105 +1073,17 @@ "color": "var(--primary-text-color)" } ] - }, - "state": [ - { - "value": "printing", - "styles": { - "icon": [ - { - "color": "yellow" - } - ] - } - } - ] - } - ] - } - ] - }, - { - "type": "custom:bar-card", - "show_header_toggle": false, - "state_color": false, - "positions": { - "indicator": "off", - "name": "outside", - "value": "outside", - "icon": "inside" - }, - "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\nbar-card-value {\n \n margin: 0px;\n font-size: 15px;\n text-shadow: 1px 1px #0005;\n}\nbar-card-name {\n margin: 0px;\n font-size: 15px;\n text-shadow: 1px 1px #0005;\n}\nha-icon {\n color: darkgrey;\n}", - "entities": [ - { - "entity": "sensor.canon_tr8500_series_black_bk", - "name": "BK", - "color": "black", - "width": "85%" - }, - { - "entity": "sensor.canon_tr8500_series_black_pgbk", - "name": "PGBK", - "color": "black", - "width": "85%" - }, - { - "entity": "sensor.canon_tr8500_series_cyan", - "name": "C", - "color": "cyan", - "width": "85%" - }, - { - "entity": "sensor.canon_tr8500_series_magenta", - "name": "M", - "color": "magenta", - "width": "85%" - }, - { - "entity": "sensor.canon_tr8500_series_yellow", - "name": "Y", - "color": "yellow", - "width": "85%" - } - ] - } - ] - } - ] - }, - { - "type": "entities", - "show_header_toggle": "off", - "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", - "entities": [ - { - "type": "section", - "label": "BTicino Classe 300EOS with Netatmo" - }, - { - "type": "custom:hui-element", - "card_type": "vertical-stack", - "cards": [ - { - "type": "horizontal-stack", - "cards": [ - { - "type": "picture", - "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", - "image": "/local/images/devices/classe300eos.png" - }, - { - "type": "vertical-stack", - "cards": [ + } + }, { - "type": "custom:button-card", - "layout": "icon_name_state", - "entity": "switch.portone", - "name": "Apertura Portone", - "show_name": true, + "type": "custom:button-card", + "layout": "icon_name_state", + "entity": "sensor.canon_tr8500_series", + "name": "Stato", + "show_name": false, "show_icon": true, - "show_state": false, - "color-type": "card", + "show_state": true, + "icon": "[[[\n if (entity.state==\"idle\")\n return \"mdi:printer\"\n else\n return \"mdi:printer-settings\"\n]]]\n", "styles": { "grid": [ { @@ -908,6 +1099,9 @@ }, { "width": "25px" + }, + { + "color": "var(--state-icon-color)" } ], "card": [ @@ -938,21 +1132,11 @@ }, "state": [ { - "value": "on", - "styles": { - "icon": [ - { - "color": "lightgreen" - } - ] - } - }, - { - "value": "off", + "value": "printing", "styles": { "icon": [ { - "color": "grey" + "color": "yellow" } ] } @@ -962,6 +1146,50 @@ ] } ] + }, + { + "type": "custom:bar-card", + "show_header_toggle": false, + "state_color": false, + "positions": { + "indicator": "off", + "name": "outside", + "value": "outside", + "icon": "inside" + }, + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\nbar-card-value {\n \n margin: 0px;\n font-size: 15px;\n text-shadow: 1px 1px #0005;\n}\nbar-card-name {\n margin: 0px;\n font-size: 15px;\n text-shadow: 1px 1px #0005;\n}\nha-icon {\n color: darkgrey;\n}", + "entities": [ + { + "entity": "sensor.canon_tr8500_series_black_bk", + "name": "BK", + "color": "black", + "width": "85%" + }, + { + "entity": "sensor.canon_tr8500_series_black_pgbk", + "name": "PGBK", + "color": "black", + "width": "85%" + }, + { + "entity": "sensor.canon_tr8500_series_cyan", + "name": "C", + "color": "cyan", + "width": "85%" + }, + { + "entity": "sensor.canon_tr8500_series_magenta", + "name": "M", + "color": "magenta", + "width": "85%" + }, + { + "entity": "sensor.canon_tr8500_series_yellow", + "name": "Y", + "color": "yellow", + "width": "85%" + } + ] } ] } @@ -1818,16 +2046,24 @@ "type": "vertical-stack", "cards": [ { - "type": "custom:button-card", + "type": "tile", "entity": "script.shelly_upgrade", "name": "Aggiorna Tutto", - "icon": "mdi:package-up" + "icon": "mdi:package-up", + "tap_action": { + "action": "call-service", + "service": "script.shelly_upgrade" + } }, { - "type": "custom:button-card", + "type": "tile", "entity": "script.shelly_reboot", "name": "Riavvia tutto", - "icon": "mdi:restart" + "icon": "mdi:restart", + "tap_action": { + "action": "call-service", + "service": "script.shelly_reboot" + } } ] } @@ -2453,6 +2689,197 @@ } ] }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "wireless_button - Xiaomi WXKG01LM" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "https://www.zigbee2mqtt.io/images/devices/WXKG01LM.jpg" + }, + { + "type": "vertical-stack", + "cards": [ + { + "type": "custom:button-card", + "template": "template_device_generic_battery_state", + "entity": "sensor.wireless_button_battery", + "name": "Batteria" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "Sensore Acqua 1 - Xiaomi SJCGQ11LM" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "https://www.zigbee2mqtt.io/images/devices/SJCGQ11LM.jpg" + }, + { + "type": "vertical-stack", + "cards": [ + { + "type": "custom:button-card", + "template": "template_device_generic_state", + "entity": "binary_sensor.sensore_acqua_1_water_leak", + "name": "Stato", + "styles": { + "icon": [ + { + "color": "var(--state-icon-color)" + } + ] + } + }, + { + "type": "custom:button-card", + "template": "template_device_generic_battery_state", + "entity": "sensor.sensore_acqua_1_battery", + "name": "Batteria" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "Sensore Acqua 2 - Xiaomi SJCGQ11LM" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "https://www.zigbee2mqtt.io/images/devices/SJCGQ11LM.jpg" + }, + { + "type": "vertical-stack", + "cards": [ + { + "type": "custom:button-card", + "template": "template_device_generic_state", + "entity": "binary_sensor.sensore_acqua_2_water_leak", + "name": "Stato", + "styles": { + "icon": [ + { + "color": "var(--state-icon-color)" + } + ] + } + }, + { + "type": "custom:button-card", + "template": "template_device_generic_battery_state", + "entity": "sensor.sensore_acqua_2_battery", + "name": "Batteria" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "entities", + "show_header_toggle": "off", + "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n", + "entities": [ + { + "type": "section", + "label": "Sensore Acqua 3 - Xiaomi SJCGQ11LM" + }, + { + "type": "custom:hui-element", + "card_type": "vertical-stack", + "cards": [ + { + "type": "horizontal-stack", + "cards": [ + { + "type": "picture", + "style": "ha-card { \n --paper-card-background-color: 'rgba(0, 0, 0, 0.0)';\n --ha-card-background: \"rgba(0, 0, 0, 0)\";\n --ha-card-box-shadow: 'none';\n}\n", + "image": "https://www.zigbee2mqtt.io/images/devices/SJCGQ11LM.jpg" + }, + { + "type": "vertical-stack", + "cards": [ + { + "type": "custom:button-card", + "template": "template_device_generic_state", + "entity": "binary_sensor.sensore_acqua_3_water_leak", + "name": "Stato", + "styles": { + "icon": [ + { + "color": "var(--state-icon-color)" + } + ] + } + }, + { + "type": "custom:button-card", + "template": "template_device_generic_battery_state", + "entity": "sensor.sensore_acqua_3_battery", + "name": "Batteria" + } + ] + } + ] + } + ] + } + ] + }, { "type": "vertical-stack", "title": "Mappa Dispositivi", diff --git a/.storage/lovelace.lovelace_settings b/.storage/lovelace.lovelace_settings index 4021d18a..0e271696 100644 --- a/.storage/lovelace.lovelace_settings +++ b/.storage/lovelace.lovelace_settings @@ -238,7 +238,23 @@ }, { "entity": "sensor.spare_door_battery", - "name": "Spare Door" + "name": "spare_door" + }, + { + "entity": "sensor.wireless_button_battery", + "name": "wireless_button" + }, + { + "entity": "sensor.sensore_acqua_1_battery", + "name": "Sensore Acqua 1" + }, + { + "entity": "sensor.sensore_acqua_2_battery", + "name": "Sensore Acqua 2" + }, + { + "entity": "sensor.sensore_acqua_3_battery", + "name": "Sensore Acqua 3" } ] }, diff --git a/customizations/xiaomi.yaml b/customizations/xiaomi.yaml index 0cfb4ec4..d5caf195 100644 --- a/customizations/xiaomi.yaml +++ b/customizations/xiaomi.yaml @@ -17,12 +17,12 @@ binary_sensor.spare_door_contact: friendly_name: 'Spare Door' sensor.spare_door_battery: friendly_name: 'Spare Door: Batteria' +sensor.spare_door_device_temperature: + friendly_name: 'Spare Door: Temperatura' sensor.spare_door_linkquality: friendly_name: 'Spare Door: Link' sensor.spare_door_voltage: friendly_name: 'Spare Door: Tensione' -sensor.spare_door_temperature: - friendly_name: 'Spare Door: Temperatura' # Front Balcony Temperature Sensor sensor.temperatura_balcone_temperature: @@ -55,3 +55,51 @@ sensor.wireless_button_linkquality: friendly_name: 'Wireless Switch: Link' sensor.wireless_button_voltage: friendly_name: 'Wireless Switch: Tensione' + +# Sensore Acqua 1 +binary_sensor.sensore_acqua_1_water_leak: + friendly_name: "Sensore Acqua 1" +sensor.sensore_acqua_1_power_outage_count: + friendly_name: "Sensore Acqua 1: Guasto Alimentazione" +sensor.sensore_acqua_1_battery: + friendly_name: "Sensore Acqua 1: Batteria" +binary_sensor.sensore_acqua_1_battery_low: + friendly_name: "Sensore Acqua 1: Batteria scarica" +sensor.sensore_acqua_1_device_temperature: + friendly_name: "Sensore Acqua 1: Temperatura" +sensor.sensore_acqua_1_linkquality: + friendly_name: "Sensore Acqua 1: Link" +sensor.sensore_acqua_1_voltage: + friendly_name: "Sensore Acqua 1: Tensione" + +# Sensore Acqua 2 +binary_sensor.sensore_acqua_2_water_leak: + friendly_name: "Sensore Acqua 2" +sensor.sensore_acqua_2_power_outage_count: + friendly_name: "Sensore Acqua 2: Guasto Alimentazione" +sensor.sensore_acqua_2_battery: + friendly_name: "Sensore Acqua 2: Batteria" +binary_sensor.sensore_acqua_2_battery_low: + friendly_name: "Sensore Acqua 2: Batteria scarica" +sensor.sensore_acqua_2_device_temperature: + friendly_name: "Sensore Acqua 2: Temperatura" +sensor.sensore_acqua_2_linkquality: + friendly_name: "Sensore Acqua 2: Link" +sensor.sensore_acqua_2_voltage: + friendly_name: "Sensore Acqua 2: Tensione" + +# Sensore Acqua 3 +binary_sensor.sensore_acqua_3_water_leak: + friendly_name: "Sensore Acqua 3" +sensor.sensore_acqua_3_power_outage_count: + friendly_name: "Sensore Acqua 3: Guasto Alimentazione" +sensor.sensore_acqua_3_battery: + friendly_name: "Sensore Acqua 3: Batteria" +binary_sensor.sensore_acqua_3_battery_low: + friendly_name: "Sensore Acqua 3: Batteria scarica" +sensor.sensore_acqua_3_device_temperature: + friendly_name: "Sensore Acqua 3: Temperatura" +sensor.sensore_acqua_3_linkquality: + friendly_name: "Sensore Acqua 3: Link" +sensor.sensore_acqua_3_voltage: + friendly_name: "Sensore Acqua 3: Tensione" -- 2.47.3