}
]
},
+ {
+ "type": "entities",
+ "show_header_toggle": "off",
+ "style": ".card-header {\n padding: 0px 0px 0px 0px !important;\n}\n",
+ "entities": [
+ {
+ "type": "section",
+ "label": "FRITZ!Box 7530 AX"
+ },
+ {
+ "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_7530_ax.png",
+ "tap_action": {
+ "action": "url",
+ "url_path": "https://ap1.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.ap1_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",
+ "entity": "switch.ap1_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",
--- /dev/null
+######################################################################
+# Fritz Package - Switch
+######################################################################
+
+switch:
+ - platform: template
+ switches:
+ fritz_led:
+ turn_on:
+ service: shell_command.fritz_led_on
+ turn_off:
+ service: shell_command.fritz_led_off
+# icon_template: >-
+# {% if is_state('cover.garage_door', 'open') %}
+# mdi:mdi:led-on
+# {% else %}
+# mdi:led-off
+# {% endif %}
+
+ - platform: template
+ switches:
+ ap1_led:
+ turn_on:
+ service: shell_command.ap1_led_on
+ turn_off:
+ service: shell_command.ap1_led_off
+# icon_template: >-
+# {% if is_state('cover.garage_door', 'open') %}
+# mdi:mdi:led-on
+# {% else %}
+# mdi:led-off
+# {% endif %}
+
+######################################################################
+# Fritz Package - Fritz Command
+######################################################################
+shell_command:
+ fritz_reboot: 'bash /config/shell_scripts/fritzBox.sh fritz REBOOT Box'
+ fritz_reconnect: 'bash /config/shell_scripts/fritzBox.sh fritz WAN RECONNECT'
+ fritz_led_on: 'bash /config/shell_scripts/fritzBox.sh fritz LED 1'
+ fritz_led_off: 'bash /config/shell_scripts/fritzBox.sh fritz LED 0'
+ ap1_reboot: 'bash /config/shell_scripts/fritzBox.sh ap1 REBOOT Box'
+ ap1_reconnect: 'bash /config/shell_scripts/fritzBox.sh ap1 WAN RECONNECT'
+ ap1_led_on: 'bash /config/shell_scripts/fritzBox.sh ap1 LED 1'
+ ap1_led_off: 'bash /config/shell_scripts/fritzBox.sh ap1 LED 0'
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+# Parameters
+if [ -f /.dockerenv ]; then
+ HASS_HOME="/config"
+else
+ HASS_HOME="../"
+fi
+
+if [[ $1 == fritz ]]; then # FRITZ!BOX 7590
+ HOST=$(awk '/fritz_host/ { print $2 }' $HASS_HOME/secrets.yaml)
+ USERNAME=$(awk '/fritz_user/ { print $2 }' $HASS_HOME/secrets.yaml)
+ PASSWORD=$(awk '/fritz_password/ { print $2 }' $HASS_HOME/secrets.yaml)
+elif [[ $1 == ap1 ]]; then # FRITZ!BOX 7530 AX
+ HOST=$(awk '/ap1_host/ { print $2 }' $HASS_HOME/secrets.yaml)
+ USERNAME=$(awk '/ap1_user/ { print $2 }' $HASS_HOME/secrets.yaml)
+ PASSWORD=$(awk '/ap1_password/ { print $2 }' $HASS_HOME/secrets.yaml)
+fi
+SCRIPT=$HASS_HOME/git_repos/FritzBoxShell/fritzBoxShell.sh
+
+$SCRIPT --boxip $HOST --boxuser $USERNAME --boxpw $PASSWORD ${@:2}