diff --git a/authelia/configuration.yml b/authelia/configuration.yml index 9596143..df0eff7 100644 --- a/authelia/configuration.yml +++ b/authelia/configuration.yml @@ -12,14 +12,26 @@ log: #jwt_secret: SECRET_GOES_HERE # use docker secret file instead AUTHELIA_JWT_SECRET_FILE # https://docs.authelia.com/configuration/miscellaneous.html#default-redirection-url -default_redirection_url: https://authelia.milvert.com +# default_redirection_url: https://authelia.milvert.com webauthn: #FIDO2 Authentication disable: false + enable_passkey_login: true display_name: Authelia attestation_conveyance_preference: direct - user_verification: required timeout: 60s + filtering: + prohibit_backup_eligibility: false + selection_criteria: + attachment: '' + discoverability: 'preferred' + user_verification: 'preferred' + metadata: + enabled: false + validate_trust_anchor: true + validate_entry: true + validate_status: true + validate_entry_permit_zero_aaguid: false totp: issuer: authelia.com @@ -63,10 +75,10 @@ access_control: policy: two_factor - domain: "milvert.com" policy: two_factor - - domain: - - 'uptime.example.com' - subject: 'oauth2:client:uptime-kuma' - policy: 'one_factor' + #- domain: + #- 'uptime.example.com' + #subject: 'oauth2:client:uptime-kuma' + #policy: 'one_factor' session: name: authelia_session @@ -75,7 +87,9 @@ session: # secret: SECRET_GOES_HERE # use docker secret file instead AUTHELIA_SESSION_SECRET_FILE expiration: 3600 # 1 hour inactivity: 1800 # 30 min - domain: milvert.com # Should match whatever your root protected domain is + cookies: + - domain: 'milvert.com' + authelia_url: https://authelia.milvert.com # Optional. Can improve performance on a busy system. If not enabled, session info is stored in memory. # redis: diff --git a/carconnectivity/carconnectivity.json b/carconnectivity/carconnectivity.json new file mode 100644 index 0000000..33dd20e --- /dev/null +++ b/carconnectivity/carconnectivity.json @@ -0,0 +1,31 @@ +{ + "carConnectivity": { + "log_level": "info", + "connectors": [ + { + "type": "skoda", + "config": { + "netrc": "/root/.netrc", + "api_log_level": "warning", + "interval": 600, + "max_age": 300 + } + } + ], + "plugins": [ + { + "type": "mqtt", + "config": { + "broker": "mqtt", + "username": "simon", + "password": "bajsa123" + } + }, + { + "type": "mqtt_homeassistant", + "config": {} + } + ] + } +} + diff --git a/carconnectivity/entrypoint.sh b/carconnectivity/entrypoint.sh new file mode 100755 index 0000000..5a00022 --- /dev/null +++ b/carconnectivity/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +# Läs secrets +PW=$(cat /run/secrets/skoda_password) +SPIN=$(cat /run/secrets/skoda_spin) + +cat > /root/.netrc < %.3f", step, id(local_vol), target); + id(set_vol_and_flash)->execute(target); + + - id: volume_down_trigger + then: + - lambda: |- + float step = 0.02f; + float target = id(local_vol) - step; + ESP_LOGI("vol", "volume_down_trigger step=%.2f from=%.3f -> %.3f", step, id(local_vol), target); + id(set_vol_and_flash)->execute(target); + + +rc522_spi: + spi_id: spi_bus_rc522 + cs_pin: 12 + reset_pin: 11 + update_interval: 3s + on_tag: + then: + - homeassistant.tag_scanned: !lambda 'return x;' + - lambda: |- + std::string uid = x; + ESP_LOGI("nfc", "Tag scanned: %s", uid.c_str()); + // + if (uid == "04-A1-4E-94-2E-02-89") { // spellista_dolly + id(current_image) = 1; + } else if (uid == "04-01-BA-52-2E-02-89") { // spellista_godnattstund + id(current_image) = 2; + } else if (uid == "04-51-0C-91-2E-02-89") { // spellista_disco + id(current_image) = 3; + } else if (uid == "04-01-DF-98-2E-02-89") { // spellista_rosahelikopter + id(current_image) = 4; + } else { + id(current_image) = 0; + } + ESP_LOGI("nfc", "current_image set to %d", id(current_image)); + - component.update: display_main + +output: + - platform: ledc + pin: 1 + id: lcd_bl \ No newline at end of file diff --git a/esphome/nfc-playbox/ui.yaml b/esphome/nfc-playbox/ui.yaml new file mode 100644 index 0000000..c78e792 --- /dev/null +++ b/esphome/nfc-playbox/ui.yaml @@ -0,0 +1,151 @@ +touchscreen: + - platform: cst816 + id: tp + i2c_id: i2c_bus + interrupt_pin: 46 # TP_INT + reset_pin: 21 # TP_RESET + transform: + mirror_x: false + mirror_y: true + swap_xy: true + calibration: + x_min: 0 + x_max: 320 + y_min: 30 + y_max: 240 + on_touch: + then: + - lambda: |- + int px = touch.x; + int py = touch.y; + ESP_LOGI("touch", "Pixel (%d,%d)", px, py); + + const int SCREEN_W = ${SCREEN_W}; + const int SCREEN_H = ${SCREEN_H}; + const int RIGHT_COL_W= ${RIGHT_COL_W}; + const int X_SPLIT = SCREEN_W - RIGHT_COL_W; + const int Y_MID = SCREEN_H / 2; + const int CX_RIGHT = X_SPLIT + RIGHT_COL_W / 2; + const int CY_UP = Y_MID / 2; + const int CY_DOWN = Y_MID + (Y_MID / 2); + const int RING_R = 45; + + auto hit = [&](int cx, int cy) { + int dx = px - cx; + int dy = py - cy; + return dx*dx + dy*dy <= RING_R*RING_R; + }; + + if (hit(CX_RIGHT, CY_UP)) { + ESP_LOGI("touch", "VOLUME UP pressed"); + id(volume_up_trigger).execute(); + } else if (hit(CX_RIGHT, CY_DOWN)) { + id(volume_down_trigger).execute(); + ESP_LOGI("touch", "VOLUME DOWN pressed"); + } + - script.execute: wake_screen + +display: + - platform: ili9xxx + id: display_main + model: ST7789V + cs_pin: 45 # LCD_CS + dc_pin: 42 # LCD_DC + reset_pin: 0 # LCD_RST + spi_id: spi_bus + dimensions: + width: 240 + height: 320 + rotation: 90 # matchar Waveshares exempel (~EXAMPLE_LCD_ROTATION=1) + invert_colors: true + update_interval: never + lambda: |- + const int SCREEN_W = ${SCREEN_W}; + const int SCREEN_H = ${SCREEN_H}; + const int RIGHT_COL_W = ${RIGHT_COL_W}; + const int X_SPLIT = SCREEN_W - RIGHT_COL_W; + const int Y_MID = SCREEN_H / 2; + + const int CX_RIGHT = X_SPLIT + RIGHT_COL_W / 2; + const int CY_UP = Y_MID / 2; + const int CY_DOWN = Y_MID + (Y_MID / 2); + switch (id(current_image)) { + case 1: + it.image(0, 0, id(spellista_dolly)); + break; + case 2: + it.image(0, 0, id(spellista_godnattstund)); + break; + case 3: + it.image(0, 0, id(spellista_disco)); + break; + case 4: + it.image(0, 0, id(spellista_rosahelikopter)); + break; + default: + // valfri default-bild/blank + it.image(0, 0, id(background)); // behåll din gamla default om du vill + break; + } + // Svart background till höger + it.filled_rectangle(X_SPLIT, 0, SCREEN_W - 1, SCREEN_H - 1, id(my_black)); + + it.line(X_SPLIT, 0, X_SPLIT, SCREEN_H - 1); + it.line(X_SPLIT, Y_MID, SCREEN_W - 1, Y_MID); + + + // Rita minus-cirkel (volym up) + it.print(CX_RIGHT, CY_UP, id(font_icon_spotify), id(my_white), TextAlign::CENTER, "\U000F0417"); + // Rita minus-cirkel (volym ned) + it.print(CX_RIGHT, CY_DOWN, id(font_icon_spotify), id(my_white), TextAlign::CENTER, "\U000F0376"); + + + if (id(show_volume)) { + ESP_LOGI("display", "VOLUME is %f", id(local_vol)); + it.filled_circle(230, 122, 35, id(my_green)); + it.printf(230, 145, id(font40), id(my_black), TextAlign::BOTTOM_CENTER, "%.0f", id(local_vol) * 100.0f); + + // HA_value-> to slow? + // it.printf(230, 145, id(font40), id(my_black), TextAlign::BOTTOM_CENTER, "%.0f", id(spotvol).state); + } + +color: + - id: my_red + red: 100% + green: 0% + - id: my_green + red: 11.76% + green: 84.31% + blue: 37.65% + - id: my_white + red: 1.0000 + green: 1.0000 + blue: 1.0000 + - id: my_grey + red: 0.6000 + green: 0.6000 + blue: 0.6000 + - id: my_black + red: 0.0000 + green: 0.0000 + blue: 0.0000 + +font: + - file: "gfonts://Roboto" + id: font_small + size: 16 + + - file: 'gfonts://Roboto' + id: font40 + size: 40 + glyphs: °.0123456789-%d + + - file: 'fonts/materialdesignicons-webfont.ttf' + id: font_icon_spotify + size: 75 + glyphs: + - "\U000F040C" # play-circle + - "\U000F03E5" # pause-circle + - "\U000F0661" # skip-next-circle + - "\U000F0376" # minus-circle + - "\U000F0417" # plus-circle diff --git a/esphome/test/nfc-playbox_display+nfc.yaml b/esphome/test/nfc-playbox_display+nfc.yaml new file mode 100644 index 0000000..d76607f --- /dev/null +++ b/esphome/test/nfc-playbox_display+nfc.yaml @@ -0,0 +1,216 @@ +esphome: + name: nfc-playbox-1 + friendly_name: NFC Playbox_1 + +esp32: + board: esp32-s3-devkitc-1 + flash_size: 16MB + framework: + type: esp-idf + +psram: + mode: octal + speed: 80MHz + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "OQlmeshTtUZg/iavLExjuNt1H7ywTohWAYozqNym+9M=" + +ota: + - platform: esphome + password: "14106c281b3e5b1ac1da204b7ff99728" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + power_save_mode: none # stabilare link + output_power: 17dB # maxa sändarnivån + use_address: 10.0.3.29 + domain: .milvert.com + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Nfc-Playbox-1 Fallback Hotspot" + password: "kQAdTCPYabwd" + +captive_portal: + +sensor: + - platform: wifi_signal + name: "NFC Playbox WiFi RSSI" + update_interval: 30s + + - platform: uptime + name: "NFC Playbox Uptime" + +script: + - id: wake_screen + mode: restart + then: + - light.turn_on: + id: backlight + brightness: 100% + # - delay: 60s + # - light.turn_off: backlight + +image: + - file: "images/play.png" + id: img_playpause + type: BINARY + + - file: "images/low-volume.png" + id: img_voldown + type: BINARY + + - file: "images/high-volume.png" + id: img_volup + type: BINARY + + +globals: + - id: touch_x + type: int + initial_value: "0" + + - id: touch_y + type: int + initial_value: "0" + +# ---- SPI-buss till LCD +spi: + - id: spi_bus + clk_pin: 39 # LCD_SCLK + mosi_pin: 38 # LCD_MOSI + miso_pin: 40 # (MISO finns men används ej av LCD) + + - id: spi_bus_rc522 + clk_pin: 13 + mosi_pin: 14 + miso_pin: 9 + +rc522_spi: + spi_id: spi_bus_rc522 + cs_pin: 12 + reset_pin: 11 + update_interval: 1s + on_tag: + then: + - logger.log: + format: "RFID Tag UID: %s" + args: [ 'x.c_str()' ] + - homeassistant.tag_scanned: !lambda 'return x;' + +# ---- Bakgrundsbelysning (GPIO1 via PWM) +output: + - platform: ledc + pin: 1 + id: lcd_bl + +light: + - platform: monochromatic + name: "LCD Backlight" + id: backlight + output: lcd_bl + restore_mode: ALWAYS_ON + +# ---- I2C för touch (CST816D) +i2c: + sda: 48 # TP_SDA + scl: 47 # TP_SCL + id: i2c_bus + scan: true + frequency: 400kHz + +touchscreen: + - platform: cst816 + id: tp + interrupt_pin: 46 # TP_INT + reset_pin: 21 # TP_RESET + transform: + mirror_x: false + mirror_y: true + swap_xy: true + calibration: + x_min: 0 + x_max: 320 + y_min: 30 # offset för min display + y_max: 240 + on_touch: + then: + - lambda: |- + const int CELL_SIZE = 40; + const int ICON_R = 22; // radie på cirkeln runt ikonen + + // Hjälpfunktion för att kolla träff + auto hit_circle = [&](int col, int row, int px, int py) { + int cx = (col + 1) * CELL_SIZE; + int cy = (row + 1) * CELL_SIZE; + int dx = px - cx; + int dy = py - cy; + return (dx*dx + dy*dy) <= (ICON_R * ICON_R); + }; + - script.execute: wake_screen + - logger.log: + format: "Touch coordinates: (%d, %d)" + args: ["touch.x", "touch.y"] + +substitutions: + SCREEN_W: "320" # från loggen: ili9xxx Dimensions: 320 x 240 + SCREEN_H: "240" + ICON_W: "32" + ICON_H: "32" + MARGIN: "8" + HIT_PAD: "6" + +# ---- Display (ST7789T3/ ST7789V 240x320) via moderna 'ili9xxx' +display: + - platform: ili9xxx + id: display_main + model: ST7789V + cs_pin: 45 # LCD_CS + dc_pin: 42 # LCD_DC + reset_pin: 0 # LCD_RST + spi_id: spi_bus + dimensions: + width: 240 + height: 320 + rotation: 90 # matchar Waveshares exempel (~EXAMPLE_LCD_ROTATION=1) + invert_colors: false + update_interval: 500ms + lambda: |- + const int CELL_SIZE = 40; + + auto draw_centered_2x2 = [&](int col, int row, const esphome::display::BaseImage *img) { + const int center_x = (col + 1) * CELL_SIZE; + const int center_y = (row + 1) * CELL_SIZE; + + // cirkel runt ikonen + it.circle(center_x, center_y, 22); + + // rita ikonen (32x32 → offset 16) + it.image(center_x - 16, center_y - 16, + const_cast(img)); + }; + + // PLAY i blocket (1,2)-(2,3) + draw_centered_2x2(1, 2, id(img_playpause)); + + // VOL UP i blocket (3,2)-(4,3) + draw_centered_2x2(3, 2, id(img_volup)); + + // VOL DOWN i blocket (5,2)-(6,3) + draw_centered_2x2(5, 2, id(img_voldown)); + +# ---- Klocka och font (för att visa något) +time: + - platform: sntp + id: esptime + timezone: "Europe/Stockholm" + +font: + - file: "gfonts://Roboto" + id: font_small + size: 16 diff --git a/esphome/test/spotiyfy_ha.yaml b/esphome/test/spotiyfy_ha.yaml new file mode 100644 index 0000000..cfb2283 --- /dev/null +++ b/esphome/test/spotiyfy_ha.yaml @@ -0,0 +1,634 @@ +# https://community.home-assistant.io/t/awesome-spotify-touch-control-via-ili9341-screen/406328 + +logger: + +ota: + +api: + +captive_portal: + +time: + platform: homeassistant + id: esptime + +spi: + clk_pin: GPIO18 + mosi_pin: GPIO23 + miso_pin: GPIO19 + +font: + - file: 'fonts/verdana.ttf' + id: font40 + size: 40 + glyphs: °.0123456789-%d + - file: 'fonts/verdana.ttf' + id: font_spot_time + size: 12 + glyphs: :0123456789 + - file: 'fonts/verdana.ttf' + id: font21 + size: 21 + glyphs: ['&', '@', '<', '>', '$', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0', + '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', + 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/', '\', '\xab', '\xc3', '\xaf', '''', 'ß' ] + - file: 'fonts/verdana.ttf' + id: font18 + size: 18 + glyphs: ['&', '@', '<', '>', '$', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0', + '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', + 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/', '\', '''', 'ß' ] + - file: 'fonts/verdana.ttf' + id: font16 + size: 16 + glyphs: ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0', + '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', + 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/', '\', '''', 'ß' ] + - file: 'fonts/materialdesignicons-webfont.ttf' + id: font_icon_spotify + size: 75 + glyphs: + - "\U000F040C" # play-circle + - "\U000F03E5" # pause-circle + - "\U000F0661" # skip-next-circle + - "\U000F0376" # minus-circle + - "\U000F0417" # plus-circle + - file: 'fonts/materialdesignicons-webfont.ttf' + id: font_icon_spotify_big + size: 80 + glyphs: + - "\U000F04C7" # Spotify Icon + - file: 'fonts/materialdesignicons-webfont.ttf' + id: font_icon_spotify_infobar + size: 30 + glyphs: + - "\U000F04C7" # Spotify Icon + - "\U000F0595" # Wetter Icon + - file: 'fonts/materialdesignicons-webfont.ttf' + id: font_icon_spotify_infobar_s + size: 24 + glyphs: + - "\U000F049D" # Shuffle on Icon + - "\U000F049E" # Shuffle off Icon + +color: + - id: my_red + red: 100% + green: 0% + - id: my_green + red: 0% + green: 100% + blue: 30% + - id: my_white + red: 1.0000 + green: 1.0000 + blue: 1.0000 + - id: my_grey + red: 0.6000 + green: 0.6000 + blue: 0.6000 + - id: my_black + red: 0.0000 + green: 0.0000 + blue: 0.0000 +output: + # backlight + - platform: ledc + pin: 15 + id: gpio_15_backlight_pwm_touch + inverted: false + +light: + - platform: monochromatic + output: gpio_15_backlight_pwm_touch + name: "ILI9341 Display Backlight Touch" + id: back_light_touch + restore_mode: RESTORE_DEFAULT_ON + +text_sensor: + - platform: homeassistant + id: current_title + entity_id: sensor.esp32_media_player_current_title + - platform: homeassistant + id: current_artist + entity_id: sensor.esp32_media_player_current_artist + - platform: homeassistant + id: current_playlist + entity_id: sensor.esp32_media_player_current_playlist + - platform: homeassistant + id: spotify + entity_id: sensor.esp32_media_player_status + - platform: homeassistant + id: spotpostime + entity_id: sensor.esp32_spotify_position_time + - platform: homeassistant + id: spotdur + entity_id: sensor.esp32_spotify_duration +sensor: + - platform: homeassistant + id: spotvol + entity_id: sensor.esp32_spotify_volume + filters: + - multiply: 10 + - platform: homeassistant + id: spotpos + entity_id: sensor.esp32_spotify_position + - platform: homeassistant + id: spotpos2 + entity_id: sensor.esp32_spotify_position + filters: + - offset: 78 +binary_sensor: + - platform: homeassistant + entity_id: input_boolean.esp32_wetter_screen + id: display_wetter + - platform: homeassistant + entity_id: input_boolean.esp32_spotify_volume + id: display_volume + - platform: homeassistant + entity_id: binary_sensor.esp32_spotify_shuffle + id: spotify_shuffle + - platform: homeassistant + entity_id: input_boolean.esp32_spotify_playlist_menu + id: playlist + - platform: xpt2046 + xpt2046_id: touchscreen # Start Play/Pause + id: touch_play + x_min: 35 + x_max: 110 + y_min: 2 + y_max: 77 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: script.esp32_spotify_play_pause + - platform: xpt2046 + xpt2046_id: touchscreen # Next Track + id: touch_next + x_min: 35 + x_max: 110 + y_min: 78 + y_max: 154 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: media_player.media_next_track + data: + entity_id: media_player.spotify_xxx + - platform: xpt2046 + xpt2046_id: touchscreen # Volume - + id: touch_minus + x_min: 35 + x_max: 110 + y_min: 155 + y_max: 230 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: script.esp32_spotify_volume_down + - platform: xpt2046 + xpt2046_id: touchscreen # Volume + + id: touch_plus + x_min: 35 + x_max: 110 + y_min: 232 + y_max: 295 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: script.esp32_spotify_volume_up + - platform: xpt2046 + xpt2046_id: touchscreen # Start Spotify + id: touch_info_spot + x_min: 195 + x_max: 239 + y_min: 275 + y_max: 319 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state != "playing";' + - lambda: 'return id(spotify).state != "paused";' + - and: + - lambda: 'return id(display_wetter).state;' + then: + - homeassistant.service: + service: script.esp32_open_spotify + - platform: xpt2046 + xpt2046_id: touchscreen # Turn on Display Wetter + id: touch_info_wetter + x_min: 195 + x_max: 239 + y_min: 275 + y_max: 319 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: script.esp32_open_display_wetter + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_info_spot_shuffle_off # Touch Shuffle off + x_min: 205 + x_max: 239 + y_min: 75 + y_max: 120 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - lambda: 'return id(spotify_shuffle).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - lambda: 'return id(spotify_shuffle).state == false;' + then: + - homeassistant.service: + service: media_player.shuffle_set + data: + shuffle: 'true' + entity_id: media_player.spotify_xxx + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_info_spot_shuffle_on # Touch Shuffle on + x_min: 205 + x_max: 239 + y_min: 75 + y_max: 120 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - lambda: 'return id(spotify_shuffle).state;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - lambda: 'return id(spotify_shuffle).state;' + then: + - homeassistant.service: + service: media_player.shuffle_set + data: + shuffle: 'false' + entity_id: media_player.spotify_xxx +#START SPOTIFY PLAYLIST TOUCH + - platform: xpt2046 + xpt2046_id: touchscreen # Spotify Icon Playlist + id: touch_playlist + x_max: 180 + y_min: 3 + x_min: 105 + y_max: 75 + on_press: + if: + condition: + or: + - and: + - lambda: 'return id(spotify).state == "playing";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + - and: + - lambda: 'return id(spotify).state == "paused";' + - lambda: 'return id(playlist).state;' + - lambda: 'return id(display_wetter).state == false;' + then: + - homeassistant.service: + service: input_boolean.toggle + data: + entity_id: input_boolean.esp32_spotify_playlist_menu + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B1 + x_max: 239 + y_min: 200 + x_min: 201 + y_max: 319 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b1 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A1 + x_max: 239 + y_min: 75 + x_min: 201 + y_max: 199 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a1 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B2 + x_max: 200 + y_min: 200 + x_min: 161 + y_max: 319 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b2 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A2 + x_max: 200 + y_min: 75 + x_min: 161 + y_max: 199 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a2 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B3 + x_max: 160 + y_min: 200 + x_min: 121 + y_max: 319 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b3 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A3 + x_max: 160 + y_min: 75 + x_min: 121 + y_max: 199 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a3 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B4 + x_max: 120 + y_min: 200 + x_min: 81 + y_max: 319 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b4 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A4 + x_max: 120 + y_min: 75 + x_min: 81 + y_max: 199 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a4 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B5 + x_max: 80 + y_min: 200 + x_min: 41 + y_max: 319 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b5 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A5 + x_max: 80 + y_min: 75 + x_min: 41 + y_max: 199 + on_press: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a5 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_B6 + x_max: 40 + y_min: 200 + x_min: 2 + y_max: 319 + on_state: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_b6 + - platform: xpt2046 + xpt2046_id: touchscreen + id: touch_A6 + x_max: 40 + y_min: 75 + x_min: 2 + y_max: 199 + on_state: + if: + condition: + binary_sensor.is_off: playlist + then: + - homeassistant.service: + service: script.esp32_spotify_playlist_a6 +xpt2046: + id: touchscreen + cs_pin: 14 + irq_pin: 27 + update_interval: 50ms + report_interval: 1s + threshold: 400 + dimension_x: 240 + dimension_y: 320 + calibration_x_min: 3860 + calibration_x_max: 280 + calibration_y_min: 340 + calibration_y_max: 3860 + swap_x_y: false + +display: + - platform: ili9341 + model: TFT 2.4 + id: touch_display + cs_pin: GPIO5 + dc_pin: GPIO4 + reset_pin: GPIO22 + rotation: 270 + lambda: |- + auto black = Color(0, 0, 0); + it.fill(black); + // WENN SPOTIFY SPIELT BUTTONS + if ((id(spotify).state == "playing" or id(spotify).state == "paused") and id(display_wetter).state == false) { + if (id(spotify).state == "playing") + { it.print(0, 155, id(font_icon_spotify), id(my_green), TextAlign::TOP_LEFT, "\U000F03E5"); } // Pause Icon + else + { it.print(0, 155, id(font_icon_spotify), id(my_white), TextAlign::TOP_LEFT, "\U000F040C"); } // Play Icon + it.print(-5, 43, id(font_icon_spotify_big), id(my_green), TextAlign::TOP_LEFT, "\U000F04C7"); // Spotify Icon gross + // WENN SPOTIFY SPIELT UND PLAYLIST GESCHLOSSEN + if (id(playlist).state) { + if (id(spotify_shuffle).state) { + it.print(98, 3, id(font_icon_spotify_infobar_s), id(my_green), TextAlign::TOP_RIGHT, "\U000F049D"); // Shuffle on + } + else { + it.print(98, 3, id(font_icon_spotify_infobar_s), id(my_white), TextAlign::TOP_RIGHT, "\U000F049E"); // Shuffle off + } + it.strftime(4, 0, id(font21), id(my_white), TextAlign::TOP_LEFT, "%H:%M", id(esptime).now()); + it.filled_circle(319, 0, 40, id(my_white)); + it.print(319, 1, id(font_icon_spotify_infobar), id(my_black), TextAlign::TOP_RIGHT, "\U000F0595"); // Wetter Display + it.print(78, 66, id(font21), id(my_white), TextAlign::TOP_LEFT, id(current_title).state.c_str()); // Track Infos + it.print(78, 91, id(font21), id(my_white), TextAlign::TOP_LEFT, id(current_artist).state.c_str()); + it.print(78, 46, id(font18), id(my_green), TextAlign::TOP_LEFT, id(current_playlist).state.c_str()); + // it.printf(78, 35, id(font18), id(my_green), TextAlign::TOP_LEFT, "%.0f", id(spotpos).state); + + it.filled_rectangle(78, 130, 222, 2, id(my_grey)); // Progress Back + it.filled_rectangle(78, 130, id(spotpos).state, 2, id(my_green)); // Progress Bar + it.filled_circle(id(spotpos2).state, 130, 4, id(my_green)); // Progress Circle + it.print(78, 133, id(font_spot_time), id(my_green), TextAlign::TOP_LEFT, id(spotpostime).state.c_str()); // Position Song + it.print(300, 133, id(font_spot_time), id(my_green), TextAlign::TOP_RIGHT, id(spotdur).state.c_str()); // Duration Song + + it.print(78, 155, id(font_icon_spotify), id(my_white), TextAlign::TOP_LEFT, "\U000F0661"); // Next Track + it.print(155, 155, id(font_icon_spotify), id(my_white), TextAlign::TOP_LEFT, "\U000F0376"); // Volume- + it.print(232, 155, id(font_icon_spotify), id(my_white), TextAlign::TOP_LEFT, "\U000F0417"); // Volume+ + if (id(display_volume).state) { // Volume State + it.filled_circle(230, 122, 35, id(my_green)); + it.printf(230, 145, id(font40), id(my_black), TextAlign::BOTTOM_CENTER, "%.0f", id(spotvol).state); + } + } + // WENN SPOTIFY SPIELT UND PLAYLIST OFFEN + else if ((id(spotify).state == "playing" or id(spotify).state == "paused") and id(playlist).state == false) { + it.line(76, 0, 76, 240); + it.line(200, 0, 200, 240); + it.line(319, 0, 319, 240); + it.line(76, 0, 319, 0); + it.line(76, 40, 319, 40); + it.line(76, 80, 319, 80); + it.line(76, 120, 319, 120); + it.line(76, 160, 319, 160); + it.line(76, 200, 319, 200); + it.line(76, 239, 319, 239); + it.print(85, 20, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Mix d.Woche"); + it.print(85, 60, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Playlist W"); + it.print(85, 100, id(font18), id(my_white), TextAlign::CENTER_LEFT, "me right no"); + it.print(85, 140, id(font18), id(my_white), TextAlign::CENTER_LEFT, "House Party"); + it.print(85, 180, id(font18), id(my_white), TextAlign::CENTER_LEFT, "News"); + it.print(85, 220, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Playlist Z"); + it.print(209, 20, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Playlist X"); + it.print(209, 60, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Playlist Y"); + it.print(209, 100, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Pool Electro"); + it.print(209, 140, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Hot Hits"); + it.print(209, 180, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Kaffeehaus"); + it.print(209, 220, id(font18), id(my_white), TextAlign::CENTER_LEFT, "Chilled Dan"); + }} + else { + // STATUSLEISTE ZEIT ODER WETTERWARNUNG + it.strftime(4, 3, id(font21), id(my_white), TextAlign::TOP_LEFT, "%H:%M", id(esptime).now()); + it.filled_circle(319, 0, 40, id(my_white)); + it.print(319, 1, id(font_icon_spotify_infobar), id(my_black), TextAlign::TOP_RIGHT, "\U000F04C7"); // Spotify Icon Infobar + } \ No newline at end of file diff --git a/evcc/evcc.yaml b/evcc/evcc.yaml index d2bd980..8699907 100644 --- a/evcc/evcc.yaml +++ b/evcc/evcc.yaml @@ -1,37 +1,59 @@ sponsortoken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJldmNjLmlvIiwic3ViIjoibWlsdmVydCIsImV4cCI6MTgzMDE5MzIwMCwiaWF0IjoxNzM1NTg1MjAwLCJzcmMiOiJnaCJ9._K23QsA15DIHRjujwH8rnFZyloSw1RPIeIS4W5WLFGE -log: error +log: info levels: tariff: trace interval: 30s vehicles: - - name: car + # - name: car + # type: custom + # title: id4 + # capacity: 79 # kWh + # soc: + # source: mqtt + # topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/charging/batteryStatus/currentSOC_pct + # range: + # source: mqtt + # topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/fuelStatus/rangeStatus/primaryEngine/remainingRange_km + # odometer: + # source: mqtt + # topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/measurements/odometerStatus/odometer + # climater: + # source: go + # vm: shared + # script: | + # remoteClimateState != "off" + # in: + # - name: remoteClimateState + # type: string + # config: + # source: mqtt + # topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/climatisation/climatisationStatus/climatisationState + + - name: skoda_car type: custom - title: id4 - capacity: 79 # kWh + title: elroq + capacity: 64 # kWh soc: source: mqtt - topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/charging/batteryStatus/currentSOC_pct + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/drives/primary/level range: source: mqtt - topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/fuelStatus/rangeStatus/primaryEngine/remainingRange_km + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/drives/primary/range odometer: source: mqtt - topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/measurements/odometerStatus/odometer + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/odometer climater: - source: go - vm: shared - script: | - remoteClimateState != "off" - in: - - name: remoteClimateState - type: string - config: - source: mqtt - topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/climatisation/climatisationStatus/climatisationState - + source: mqtt + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/climatization/binarystate + limitsoc: + source: mqtt + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/charging/settings/target_level + status: + source: mqtt + topic: carconnectivity/0/garage/TMBNC7NY8SF105227/charging/state chargers: - name: wallbox @@ -50,10 +72,9 @@ circuits: loadpoints: - title: Garage charger: wallbox - vehicle: car + vehicle: skoda_car circuit: main mode: pv - phases: 3 enable: threshold: 0 delay: 15s diff --git a/gitea/app.ini b/gitea/app.ini new file mode 100644 index 0000000..e24c558 --- /dev/null +++ b/gitea/app.ini @@ -0,0 +1,87 @@ +APP_NAME = Gitea: Git with a cup of simon +RUN_MODE = prod +RUN_USER = git +WORK_PATH = /data/gitea + +[repository] +ROOT = /data/git/repositories + +[repository.local] +LOCAL_COPY_PATH = /data/gitea/tmp/local-repo + +[repository.upload] +TEMP_PATH = /data/gitea/uploads + +[server] +APP_DATA_PATH = /data/gitea +SSH_DOMAIN = milvert.com +HTTP_PORT = 3000 +ROOT_URL = https://gitea.milvert.com/ +# ROOT_URL = http://localhost:3000/ +DISABLE_SSH = false +SSH_PORT = 22 +LFS_START_SERVER = true +LFS = /data/git/lfs +DOMAIN = gitea.milvert.com +LFS_JWT_SECRET = k0fQxO-UgL1dT55DxBy7ylQpj4A7HDjXiZQs-VxSs6E +OFFLINE_MODE = false + +[database] +PATH = /data/gitea/gitea.db +DB_TYPE = sqlite3 +HOST = localhost:3306 +NAME = gitea +USER = root +PASSWD = +SSL_MODE = disable +CHARSET = utf8 + +[indexer] +ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve + +[session] +PROVIDER_CONFIG = /data/gitea/sessions +PROVIDER = file + +[picture] +AVATAR_UPLOAD_PATH = /data/gitea/avatars +REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars +DISABLE_GRAVATAR = false +ENABLE_FEDERATED_AVATAR = true + +[attachment] +PATH = /data/gitea/attachments + +[log] +ROOT_PATH = /data/gitea/log +MODE = file +LEVEL = info + +[security] +INSTALL_LOCK = true +SECRET_KEY = 5Aocki6hsR7kzfZ7LJsKF7VESSZ4IMxEtGVc1YLEjGVUTYjnlTtOxL8vY7dLVFOi +INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NzM5MzU0OTl9.F1h5ZnL5eXqAgPp8Ya4tvhwFK08CyZQdETkyB9O5D34 + +[service] +DISABLE_REGISTRATION = true +REQUIRE_SIGNIN_VIEW = false +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +ALLOW_ONLY_EXTERNAL_REGISTRATION = true +ENABLE_CAPTCHA = false +DEFAULT_KEEP_EMAIL_PRIVATE = false +DEFAULT_ALLOW_CREATE_ORGANIZATION = true +DEFAULT_ENABLE_TIMETRACKING = true +SHOW_REGISTRATION_BUTTON = false +NO_REPLY_ADDRESS = noreply.example.org + +[oauth2] +JWT_SECRET = bnlTPZHUxEH5WGrJIAcY5IAqisk3BFb7XY8SUeI5XjA + +[mailer] +ENABLED = false + +[openid] +ENABLE_OPENID_SIGNIN = false +ENABLE_OPENID_SIGNUP = true +WHITELISTED_URIS = authelia.milvert.com diff --git a/grafana/grafana.ini b/grafana/grafana.ini index 28eba9b..a7be992 100755 --- a/grafana/grafana.ini +++ b/grafana/grafana.ini @@ -1135,5 +1135,6 @@ api_url = https://authelia.milvert.com/api/oidc/userinfo # Replace with y login_attribute_path = preferred_username groups_attribute_path = groups name_attribute_path = name +role_attribute_path = contains(groups[*], 'admin') && 'Admin' || 'Editor' use_pkce = true auto_login = true diff --git a/ha/config/automations.yaml b/ha/config/automations.yaml index d4b6df6..4c111f9 100644 --- a/ha/config/automations.yaml +++ b/ha/config/automations.yaml @@ -614,3 +614,142 @@ message: Varning! Frost kan vara på gång ❄️ (enligt prognos eller temptrend) action: notify.mobile_app_simon_mobil mode: single +- id: '1745266231556' + alias: Nimly_31_manual + description: '' + triggers: + - trigger: time + at: 06:45:00 + conditions: [] + actions: + - action: mqtt.publish + metadata: {} + data: + qos: '0' + retain: false + topic: zigbee_home_2/h014s/set/pin_code + payload: "{\n \"user\": 31,\n \"user_type\": \"unrestricted\",\n \"user_enabled\": + true,\n \"pin_code\": 9480\n }\n" + mode: single +- id: '1745266911651' + alias: enable_31 + description: '' + use_blueprint: + path: user/nimly_lock.yaml + input: + lock_device: lock.h014s + trigger_time: 06:45:00 + pin_code: '9480' + user_id: 31 + enabled: true +- id: '1745267035417' + alias: disable_31 + description: '' + use_blueprint: + path: user/nimly_lock.yaml + input: + trigger_time: '17:00:00' + lock_device: lock.h014s + user_id: 31 + pin_code: 'null' + enabled: false +- id: '1746992840091' + alias: Save last person detection + description: '' + triggers: + - type: turned_on + device_id: 80ecd4d9a212d4bc811d958b336ccec0 + entity_id: 390b057edde8e3a7ce5dd96fbc8f7486 + domain: binary_sensor + trigger: device + conditions: [] + actions: + - action: camera.snapshot + metadata: {} + data: + filename: /config/www/last_person_detection.jpg + target: + device_id: 80ecd4d9a212d4bc811d958b336ccec0 + mode: single +- id: '1755028231874' + alias: 'Spela musik ' + description: '' + triggers: + - trigger: tag + tag_id: d317de29-a548-4041-92a8-b34627e45cc3 + conditions: [] + actions: + - action: media_player.play_media + metadata: {} + data: + media_content_type: Music + media_content_id: spotify:playlist:37i9dQZF1DWVCKO3xAlT1Q + target: + entity_id: media_player.ada + mode: single +- id: '1756585900611' + alias: NFC Playbox + description: '' + triggers: + - event_type: tag_scanned + trigger: event + actions: + - choose: + - conditions: + - condition: template + value_template: '{{ current is defined and current.method == ''play_media'' + }}' + sequence: + - target: + entity_id: '{{ current.player }}' + data: + media: + media_content_id: '{{ current.media_content_id }}' + media_content_type: '{{ current.media_content_type | default(''Music'') + }}' + metadata: {} + action: media_player.play_media + - conditions: + - condition: template + value_template: '{{ current is defined and current.method == ''select_source'' + }}' + sequence: + - target: + entity_id: '{{ current.player }}' + data: + source: '{{ current.source }}' + action: media_player.select_source + default: + - data: + title: NFC Playbox + message: 'Okänd NFC-tagg: {{ tag_id }}' + action: persistent_notification.create + mode: single + variables: + TAGS: + 04-A1-4E-94-2E-02-89: + info: spellista_dolly + method: play_media + player: media_player.ada + media_content_id: spotify:playlist:3CTFR7Tf99Nj6rSM5l5HRf + media_content_type: playlist + 04-01-BA-52-2E-02-89: + info: spellista_godnattstund + method: play_media + player: media_player.ada + media_content_id: spotify:playlist:2hHIaWS6pELC5w58vJraVJ + media_content_type: playlist + 04-51-0C-91-2E-02-89: + info: spellista_disco + method: play_media + player: media_player.ada + media_content_id: spotify:playlist:7Lu5u70XvPDvRMc4fwMsLY + media_content_type: playlist + 04-01-DF-98-2E-02-89: + info: spellista_rosahelikopter + method: play_media + player: media_player.ada + media_content_id: spotify:playlist:37i9dQZF1E8C5l0TDkGXpx + media_content_type: playlist + tag_id: '{{ trigger.event.data.tag_id }}' + current: '{{ TAGS.get(tag_id) }}' diff --git a/ha/config/blueprints/automation/user/nimly_lock.yaml b/ha/config/blueprints/automation/user/nimly_lock.yaml new file mode 100644 index 0000000..7abcdec --- /dev/null +++ b/ha/config/blueprints/automation/user/nimly_lock.yaml @@ -0,0 +1,58 @@ +blueprint: + name: Nimly lås - Enable/Disable användare + description: Aktivera/inaktivera användare via MQTT till Nimly-lås i Zigbee2MQTT. + domain: automation + input: + trigger_time: + name: Tidpunkt + description: När automationen ska köras + selector: + time: {} + lock_device: + name: Välj låsenhet + description: Låset som ska styras + selector: + entity: + domain: lock + user_id: + name: Användar-ID + description: ID för användaren på låset + selector: + number: + min: 1 + max: 250 + pin_code: + name: PIN-kod + description: PIN-kod för användaren. Sätt till null för att ta bort den. + default: null + selector: + text: + enabled: + name: Aktivera användare + description: true för att aktivera, false för att inaktivera + selector: + boolean: {} + +mode: single + +triggers: + - trigger: time + at: !input trigger_time + +variables: + topic: "zigbee_home_2/h014s/set/pin_code" + user_id: !input user_id + pin_code: !input pin_code + enabled: !input enabled + +actions: + - service: mqtt.publish + data: + topic: "{{ topic }}" + payload: > + { + "user": {{ user_id }}, + "user_type": "unrestricted", + "user_enabled": {{ enabled | lower }}, + "pin_code": {{ 'null' if pin_code == 'null' else '"' ~ pin_code ~ '"' }} + } diff --git a/ha/config/blueprints/script/balloob/announce-text-to-speech-on-media-player.yaml b/ha/config/blueprints/script/balloob/announce-text-to-speech-on-media-player.yaml new file mode 100644 index 0000000..35e95b0 --- /dev/null +++ b/ha/config/blueprints/script/balloob/announce-text-to-speech-on-media-player.yaml @@ -0,0 +1,36 @@ +blueprint: + name: Announce + description: A script that announces a message on a media player using text-to-speech. + domain: script + input: + text_to_speech_engine: + selector: + entity: + domain: + - tts + multiple: false + name: Text-to-Speech engine + media_player: + selector: + entity: + domain: + - media_player + multiple: true + name: Media Player + source_url: https://community.home-assistant.io/t/announce-text-to-speech-on-media-player/699186 +mode: queued +fields: + message: + selector: + text: + multiline: true + name: Message + description: The message to broadcast + required: true +sequence: +- service: tts.speak + data: + media_player_entity_id: !input media_player + message: '{{ message }}' + target: + entity_id: !input text_to_speech_engine diff --git a/ha/config/blueprints/template/homeassistant/inverted_binary_sensor.yaml b/ha/config/blueprints/template/homeassistant/inverted_binary_sensor.yaml new file mode 100644 index 0000000..5be1840 --- /dev/null +++ b/ha/config/blueprints/template/homeassistant/inverted_binary_sensor.yaml @@ -0,0 +1,27 @@ +blueprint: + name: Invert a binary sensor + description: Creates a binary_sensor which holds the inverted value of a reference binary_sensor + domain: template + source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml + input: + reference_entity: + name: Binary sensor to be inverted + description: The binary_sensor which needs to have its value inverted + selector: + entity: + domain: binary_sensor +variables: + reference_entity: !input reference_entity +binary_sensor: + state: > + {% if states(reference_entity) == 'on' %} + off + {% elif states(reference_entity) == 'off' %} + on + {% else %} + {{ states(reference_entity) }} + {% endif %} + # delay_on: not_used in this example + # delay_off: not_used in this example + # auto_off: not_used in this example + availability: "{{ states(reference_entity) not in ('unknown', 'unavailable') }}" diff --git a/ha/config/configuration.yaml b/ha/config/configuration.yaml index 93b25a2..15f4f27 100644 --- a/ha/config/configuration.yaml +++ b/ha/config/configuration.yaml @@ -110,4 +110,3 @@ template: - diff --git a/ha/config/scripts.yaml b/ha/config/scripts.yaml index fe3bf7f..01c03da 100644 --- a/ha/config/scripts.yaml +++ b/ha/config/scripts.yaml @@ -281,3 +281,51 @@ varmepump_nattlage_med_stegvis_justering: seconds: 0 - action: climate.set_fan_mode data: {} +nfc_playbox_volume_handler: + alias: NFC-playbox Volume up + sequence: + - data: {} + target: + entity_id: input_boolean.esp32_spotify_volume + action: input_boolean.turn_on + - data: {} + target: + entity_id: + - media_player.ada + action: media_player.volume_up + - delay: + hours: 0 + minutes: 0 + seconds: 5 + milliseconds: 0 + - data: {} + target: + entity_id: input_boolean.esp32_spotify_volume + action: input_boolean.turn_off + mode: restart + icon: mdi:spotify + description: '' +nfc_playbox_volume_down: + sequence: + - data: {} + target: + entity_id: input_boolean.esp32_spotify_volume + action: input_boolean.turn_on + - data: {} + target: + entity_id: + - media_player.ada + action: media_player.volume_down + - delay: + hours: 0 + minutes: 0 + seconds: 5 + milliseconds: 0 + - data: {} + target: + entity_id: input_boolean.esp32_spotify_volume + action: input_boolean.turn_off + alias: NFC-playbox Volume down + mode: restart + icon: mdi:spotify + description: '' diff --git a/ha/zwave-config/nodes.json b/ha/zwave-config/nodes.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/ha/zwave-config/nodes.json @@ -0,0 +1 @@ +{} diff --git a/ha/zwave-config/settings.json b/ha/zwave-config/settings.json new file mode 100644 index 0000000..a54402e --- /dev/null +++ b/ha/zwave-config/settings.json @@ -0,0 +1 @@ +{"mqtt":{"name":"zwave-js-ui","host":"mqtt","port":1883,"qos":1,"prefix":"zwave","reconnectPeriod":3000,"retain":true,"clean":true,"auth":true,"username":"simon","password":"bajsa123","_ca":"","ca":"","_cert":"","cert":"","_key":"","key":""},"gateway":{"type":0,"plugins":[],"authEnabled":false,"payloadType":0,"nodeNames":true,"hassDiscovery":true,"discoveryPrefix":"homeassistant","logEnabled":true,"logLevel":"error","logToFile":false,"values":[],"jobs":[],"disableChangelog":false,"notifyNewVersions":false,"retainedDiscovery":true,"includeNodeInfo":true,"versions":{"app":"9.33.1","driver":"14.3.12","server":"1.40.3"}},"zwave":{"enabled":true,"port":"/dev/zwave","allowBootloaderOnly":false,"commandsTimeout":30,"logLevel":"debug","rf":{"txPower":{},"region":0},"securityKeys":{"S0_Legacy":"6DF43E869CE71A15B0AF1D7896766D35","S2_AccessControl":"9804893D142536A33941225F4337A9E9","S2_Unauthenticated":"7BDA36CC5F29E284F775CED69658F1D5","S2_Authenticated":"2F5AE4900CD7C23C32CA8D15EEAA66AB"},"securityKeysLongRange":{},"deviceConfigPriorityDir":"/usr/src/app/store/config","logEnabled":false,"logToFile":false,"maxFiles":7,"serverEnabled":false,"serverServiceDiscoveryDisabled":false,"enableSoftReset":true,"enableStatistics":false,"serverPort":3000,"maxNodeEventsQueueSize":100,"higherReportsTimeout":false,"disableControllerRecovery":false,"disableWatchdog":false,"disclaimerVersion":1},"backup":{"storeBackup":false,"storeCron":"0 0 * * *","storeKeep":7,"nvmBackup":false,"nvmBackupOnEvent":false,"nvmCron":"0 0 * * *","nvmKeep":7},"zniffer":{"enabled":false,"port":"","logEnabled":true,"logToFile":true,"maxFiles":7,"securityKeys":{"S2_Unauthenticated":"","S2_Authenticated":"","S2_AccessControl":"","S0_Legacy":""},"securityKeysLongRange":{"S2_Authenticated":"","S2_AccessControl":""},"convertRSSI":false},"ui":{"darkMode":false,"navTabs":false,"compactMode":false,"streamerMode":false}} diff --git a/ha/zwave-config/users.json b/ha/zwave-config/users.json new file mode 100644 index 0000000..322515e --- /dev/null +++ b/ha/zwave-config/users.json @@ -0,0 +1 @@ +[{"username":"admin","passwordHash":"df1ffe80e145cdf4:b9e829c2b1d80b67c1a07997b9b4bd444ec868161bc5a0e29d91a413d280032233c34814cb8a394f861749d8fdbb1115d1eb5105bcf8ae6f7719a9e51b326bd8"}] diff --git a/jelu/config b/jelu/config new file mode 100644 index 0000000..e69de29 diff --git a/torrent/config/rtorrent/.gitignore b/torrent/config/rtorrent/.gitignore new file mode 100755 index 0000000..c04f6e5 --- /dev/null +++ b/torrent/config/rtorrent/.gitignore @@ -0,0 +1 @@ +rtorrent_sess \ No newline at end of file