diff --git a/automations.yaml b/automations.yaml index e490031..d329b92 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1785,21 +1785,23 @@ data: {} - repeat: while: - - type: is_occupied - condition: device - device_id: 5243fe178006af9adee15bacfc9bcadc - entity_id: de7a9e40d544ab51409925618ef14deb - domain: binary_sensor - - type: is_occupied - condition: device - device_id: 66e998859b89cf23b000cc63e1ea9032 - entity_id: 584e49486e9e6257cf0fdc764cce39c6 - domain: binary_sensor - - type: is_occupied - condition: device - device_id: 18f9c114ab3e4b421899bbd6c84a3ba6 - entity_id: 5f7a6976e73109acbce02cc2de11259e - domain: binary_sensor + - condition: or + conditions: + - type: is_occupied + condition: device + device_id: 5243fe178006af9adee15bacfc9bcadc + entity_id: de7a9e40d544ab51409925618ef14deb + domain: binary_sensor + - type: is_occupied + condition: device + device_id: 66e998859b89cf23b000cc63e1ea9032 + entity_id: 584e49486e9e6257cf0fdc764cce39c6 + domain: binary_sensor + - type: is_occupied + condition: device + device_id: 18f9c114ab3e4b421899bbd6c84a3ba6 + entity_id: 5f7a6976e73109acbce02cc2de11259e + domain: binary_sensor - condition: numeric_state entity_id: counter.counter_for_lights_kuchnia_to_turn_off below: 30 diff --git a/blueprints/automation/homeassistant/motion_light.yaml b/blueprints/automation/homeassistant/motion_light.yaml new file mode 100644 index 0000000..54a4a4f --- /dev/null +++ b/blueprints/automation/homeassistant/motion_light.yaml @@ -0,0 +1,54 @@ +blueprint: + name: Motion-activated Light + description: Turn on a light when motion is detected. + domain: automation + source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml + input: + motion_entity: + name: Motion Sensor + selector: + entity: + domain: binary_sensor + device_class: motion + light_target: + name: Light + selector: + target: + entity: + domain: light + no_motion_wait: + name: Wait time + description: Time to leave the light on after last motion is detected. + default: 120 + selector: + number: + min: 0 + max: 3600 + unit_of_measurement: seconds + +# If motion is detected within the delay, +# we restart the script. +mode: restart +max_exceeded: silent + +trigger: + platform: state + entity_id: !input motion_entity + from: "off" + to: "on" + +action: + - alias: "Turn on the light" + service: light.turn_on + target: !input light_target + - alias: "Wait until there is no motion from device" + wait_for_trigger: + platform: state + entity_id: !input motion_entity + from: "on" + to: "off" + - alias: "Wait the number of seconds that has been set" + delay: !input no_motion_wait + - alias: "Turn off the light" + service: light.turn_off + target: !input light_target diff --git a/blueprints/automation/homeassistant/notify_leaving_zone.yaml b/blueprints/automation/homeassistant/notify_leaving_zone.yaml new file mode 100644 index 0000000..71abf8f --- /dev/null +++ b/blueprints/automation/homeassistant/notify_leaving_zone.yaml @@ -0,0 +1,44 @@ +blueprint: + name: Zone Notification + description: Send a notification to a device when a person leaves a specific zone. + domain: automation + source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml + input: + person_entity: + name: Person + selector: + entity: + domain: person + zone_entity: + name: Zone + selector: + entity: + domain: zone + notify_device: + name: Device to notify + description: Device needs to run the official Home Assistant app to receive notifications. + selector: + device: + integration: mobile_app + +trigger: + platform: state + entity_id: !input person_entity + +variables: + zone_entity: !input zone_entity + # This is the state of the person when it's in this zone. + zone_state: "{{ states[zone_entity].name }}" + person_entity: !input person_entity + person_name: "{{ states[person_entity].name }}" + +condition: + condition: template + value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}" + +action: + - alias: "Notify that a person has left the zone" + domain: mobile_app + type: notify + device_id: !input notify_device + message: "{{ person_name }} has left {{ zone_state }}" diff --git a/blueprints/script/homeassistant/confirmable_notification.yaml b/blueprints/script/homeassistant/confirmable_notification.yaml new file mode 100644 index 0000000..d52e5a6 --- /dev/null +++ b/blueprints/script/homeassistant/confirmable_notification.yaml @@ -0,0 +1,84 @@ +blueprint: + name: Confirmable Notification + description: >- + A script that sends an actionable notification with a confirmation before + running the specified action. + domain: script + source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml + input: + notify_device: + name: Device to notify + description: Device needs to run the official Home Assistant app to receive notifications. + selector: + device: + integration: mobile_app + title: + name: "Title" + description: "The title of the button shown in the notification." + default: "" + selector: + text: + message: + name: "Message" + description: "The message body" + selector: + text: + confirm_text: + name: "Confirmation Text" + description: "Text to show on the confirmation button" + default: "Confirm" + selector: + text: + confirm_action: + name: "Confirmation Action" + description: "Action to run when notification is confirmed" + default: [] + selector: + action: + dismiss_text: + name: "Dismiss Text" + description: "Text to show on the dismiss button" + default: "Dismiss" + selector: + text: + dismiss_action: + name: "Dismiss Action" + description: "Action to run when notification is dismissed" + default: [] + selector: + action: + +mode: restart + +sequence: + - alias: "Set up variables" + variables: + action_confirm: "{{ 'CONFIRM_' ~ context.id }}" + action_dismiss: "{{ 'DISMISS_' ~ context.id }}" + - alias: "Send notification" + domain: mobile_app + type: notify + device_id: !input notify_device + title: !input title + message: !input message + data: + actions: + - action: "{{ action_confirm }}" + title: !input confirm_text + - action: "{{ action_dismiss }}" + title: !input dismiss_text + - alias: "Awaiting response" + wait_for_trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "{{ action_confirm }}" + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "{{ action_dismiss }}" + - choose: + - conditions: "{{ wait.trigger.event.data.action == action_confirm }}" + sequence: !input confirm_action + - conditions: "{{ wait.trigger.event.data.action == action_dismiss }}" + sequence: !input dismiss_action diff --git a/blueprints/template/homeassistant/inverted_binary_sensor.yaml b/blueprints/template/homeassistant/inverted_binary_sensor.yaml new file mode 100644 index 0000000..5be1840 --- /dev/null +++ b/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/custom_components/ble_monitor/services.yaml b/custom_components/ble_monitor/services.yaml new file mode 100644 index 0000000..d2b478b --- /dev/null +++ b/custom_components/ble_monitor/services.yaml @@ -0,0 +1,13 @@ +cleanup_entries: +parse_data: + fields: + packet: + required: true + example: 043E2B02010000123456789ABC1F12161A1819416538C1A41B073915810B529F0F0B094154435F363534313139AA + selector: + text: + gateway_id: + required: false + example: esp32_gateway + selector: + text: diff --git a/custom_components/garmin_connect/services.yaml b/custom_components/garmin_connect/services.yaml new file mode 100644 index 0000000..353c60b --- /dev/null +++ b/custom_components/garmin_connect/services.yaml @@ -0,0 +1,154 @@ +set_active_gear: + name: Set active gear for activity + description: Set active gear for activity. + fields: + entity_id: + name: entity + description: entity + required: true + selector: + entity: + integration: garmin_connect + device_class: garmin_gear + activity_type: + required: true + name: activity type + description: garmin activity type + example: running + default: running + selector: + select: + options: + - running + - cycling + - hiking + - other + - walking + - swimming + setting: + required: true + name: setting + description: gear setting to apply + default: set this as default, unset others + selector: + select: + options: + - set this as default, unset others + - set as default + - unset default + +add_body_composition: + name: Adds updated body composition metrics + description: Adds updated body composition metrics. + fields: + entity_id: + name: entity + description: entity + required: true + selector: + entity: + integration: garmin_connect + device_class: weight + weight: + required: true + name: Weight + description: Weight in KG + example: 82.3 + timestamp: + required: false + name: Timestamp + description: Datetime string of when the measurements were recorded. Defaults to now. + example: 2023-12-30T07:34:00 + bmi: + required: false + name: BMI (Body Mass Index) + description: Body mass index is based on weight and height. + example: 24.7 + percent_fat: + required: false + name: Percent Fat + description: Percent body fat + example: 23.6 + percent_hydration: + required: false + name: Percent Hydration + description: Percent body hydration + example: 51.2 + visceral_fat_mass: + required: false + name: Visceral Fat Mass + description: Estimated mass of visceral fat in KG + example: 45.3 + bone_mass: + required: false + name: Bone Mass + description: Estimated mass of bones in KG + example: 10.1 + muscle_mass: + required: false + name: Muscle Mass + description: Estimated mass of muscle in KG + example: 15.2 + basal_met: + required: false + name: Basel Metabolism + description: Basel metabolism + example: 1900 + active_met: + required: false + name: Active Metabolism + description: Active metabolism + example: 840 + physique_rating: + required: false + name: Physique Rating + description: Physique Rating + example: 28 + metabolic_age: + required: false + name: Metabolic Age + description: Metabolic Age + example: 37 + visceral_fat_rating: + required: false + name: Visceral Fat Rating + description: Visceral Fat Rating + example: 10 + +add_blood_pressure: + name: Adds updated blood pressure metrics + description: Adds updated blood pressure metrics. + fields: + entity_id: + name: entity + description: entity + required: true + selector: + entity: + integration: garmin_connect + device_class: min_heart_rate + systolic: + required: true + name: Systolic + description: Systolic value + example: 120 + diastolic: + required: true + name: Diastolic + description: Diastolic value + example: 80 + pulse: + required: true + name: Pulse + description: Pulse + example: 60 + timestamp: + required: false + name: Timestamp + description: Datetime string of when the measurements were recorded. Defaults to now. + example: 2023-12-30T07:34:00 + notes: + required: false + name: Notes + description: Add notes to the measurement + example: 'Measured with Beurer BC54' \ No newline at end of file diff --git a/custom_components/xiaomi_miot/services.yaml b/custom_components/xiaomi_miot/services.yaml new file mode 100644 index 0000000..249ad4f --- /dev/null +++ b/custom_components/xiaomi_miot/services.yaml @@ -0,0 +1,333 @@ +send_command: + description: Send miio command. + fields: + entity_id: + description: ID of the entity. + example: light.yeelight_living_e92c + required: true + selector: + entity: + integration: xiaomi_miot + method: + description: Method of the command. + example: set_power + required: true + selector: + text: + params: + description: Params for the method. + example: ['on'] + required: true + selector: + object: + +get_properties: + description: Get miot properties. + fields: + entity_id: + description: ID of the entity. + example: climate.xiaomi_mc5_374e + required: true + selector: + entity: + integration: xiaomi_miot + mapping: + description: Mapping for properties. + example: '[{"siid": 2, "piid": 1}, {"siid": 3, "piid": 1}]' + required: true + selector: + object: + update_entity: + description: Update to entity state attributes. + default: false + example: true + selector: + boolean: + +set_property: + description: Set miot property. + fields: + entity_id: + description: ID of the entity. + example: climate.xiaomi_mc5_374e + required: true + selector: + entity: + integration: xiaomi_miot + field: + description: Field of property. + example: air_conditioner.on + required: true + selector: + text: + value: + description: Value of property. + example: true + required: true + selector: + object: + +set_miot_property: + description: Set miot property by siid/piid. + fields: + entity_id: + description: ID of the entity. + example: climate.xiaomi_mc5_374e + required: true + selector: + entity: + integration: xiaomi_miot + siid: + description: Miot service ID. + example: 2 + required: true + selector: + number: + min: 1 + max: 9999 + mode: box + piid: + description: Miot property ID. + example: 1 + required: true + selector: + number: + min: 1 + max: 9999 + mode: box + value: + description: Miot property value. + example: true + required: true + selector: + object: + +call_action: + description: Call miot action. + fields: + entity_id: + description: ID of the entity. + example: media_player.xiaoai_x08c + required: true + selector: + entity: + integration: xiaomi_miot + siid: + description: Miot service ID. + example: 3 + required: true + selector: + number: + min: 1 + max: 9999 + mode: box + aiid: + description: Miot action ID. + example: 5 + required: true + selector: + number: + min: 1 + max: 9999 + mode: box + params: + description: Miot action params. + example: "['Turn on light', 1]" + selector: + object: + +intelligent_speaker: + description: Play text on Xiaoai speaker / Execute text directive / 小爱TTS及执行语音命令 + fields: + entity_id: + description: ID of the entity. + example: media_player.xiaoai_x08c + required: true + selector: + entity: + integration: xiaomi_miot + domain: media_player + text: + description: Text content. + example: Turn on light + required: true + selector: + text: + execute: + description: Execute text directive. + default: false + example: true + selector: + boolean: + silent: + description: Silent execution. + default: false + example: false + selector: + boolean: + +xiaoai_wakeup: + description: Wake up the Xiaoai speaker / 唤醒小爱音箱 + fields: + entity_id: + description: ID of the xiaoai entity. + example: media_player.xiaoai_x08c + required: true + selector: + entity: + integration: xiaomi_miot + domain: media_player + text: + description: Text content for wake up. + example: Livingroom light + selector: + text: + +get_device_data: + description: Get xiaomi device data from cloud. + fields: + entity_id: + description: ID of the entity. + example: sensor.xiaomi_lock + required: true + selector: + entity: + integration: xiaomi_miot + type: + description: Data type. + default: prop + example: prop + selector: + select: + options: + - prop + - event + - prop_cal_day + - prop_cal_week + - prop_cal_month + - store + key: + description: Data key. + example: power + required: true + selector: + text: + time_start: + description: From the unix timestamp. + example: 0 + selector: + number: + min: 0 + max: 9999999999 + mode: box + time_end: + description: To the unix timestamp. + example: 0 + selector: + number: + min: 0 + max: 9999999999 + mode: box + limit: + description: Limit of results. + example: 10 + selector: + number: + min: 1 + max: 2000 + mode: box + group: + description: Results grouping. + default: raw + example: raw + selector: + select: + options: + - raw + - hour + - day + - week + - month + +renew_devices: + description: Renew xiaomi devices. + fields: + username: + description: Xiaomi Account ID / Email / Phone. + required: false + selector: + text: + +get_token: + description: Get xiaomi device token. + fields: + name: + description: Keyword of device name in Mihome / IP / Model. + required: true + selector: + text: + +get_bindkey: + description: Get bindkey for ble device from cloud. + fields: + entity_id: + description: ID of the entity. + example: sensor.lywsd03mmc_temperature + required: true + selector: + entity: + integration: xiaomi_miot + did: + description: Xiaomi device ID. + selector: + text: + +request_xiaomi_api: + description: Request xiaomi cloud api. + fields: + entity_id: + description: ID of the entity. + example: sensor.xiaomi_device + required: true + selector: + entity: + integration: xiaomi_miot + api: + description: Xiaomi API path. + example: /home/device_list + required: true + selector: + text: + data: + description: Xiaomi API request data. + example: "{'getVirtualModel':true}" + selector: + object: + method: + description: Request method. + default: POST + example: POST + selector: + select: + options: + - POST + - GET + crypt: + description: Crypt data. + default: true + example: true + selector: + boolean: + sid: + description: Xiaomi service ID. + default: xiaomiio + example: xiaomiio + selector: + select: + options: + - label: Mihome API + value: xiaomiio + - label: Xiaoai API + value: micoapi + - label: i.mi.com + value: i.mi.com diff --git a/esphome/archive/arducam-esp32s.yaml b/esphome/archive/arducam-esp32s.yaml new file mode 100644 index 0000000..c815041 --- /dev/null +++ b/esphome/archive/arducam-esp32s.yaml @@ -0,0 +1,32 @@ +esphome: + name: arducam-esp32s + friendly_name: arducam esp32s + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "mbYd9CtjGy8/N27ffan+I8R/XxMamKE9aj24O5gKlOQ=" + +ota: + - platform: esphome + password: "acc74810aa71f661703982d1967e1929" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Arducam-Esp32S Fallback Hotspot" + password: "o9VPjn0MTzFs" + +captive_portal: + \ No newline at end of file diff --git a/esphome/archive/asf.yaml b/esphome/archive/asf.yaml new file mode 100644 index 0000000..8f6029d --- /dev/null +++ b/esphome/archive/asf.yaml @@ -0,0 +1,32 @@ +esphome: + name: asf + friendly_name: asf + +esp32: + board: esp32-c3-devkitm-1 + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "XnT9g3GwVSOZ+uKaYP1esOv4SNkh6Q6bvTKIJJQRJPU=" + +ota: + - platform: esphome + password: "d936024239d1c4f83cf5d5f7d9652618" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Asf Fallback Hotspot" + password: "3GazmA51veHg" + +captive_portal: + \ No newline at end of file diff --git a/esphome/archive/esp32-c3-oled-test.yaml b/esphome/archive/esp32-c3-oled-test.yaml new file mode 100644 index 0000000..415d7b6 --- /dev/null +++ b/esphome/archive/esp32-c3-oled-test.yaml @@ -0,0 +1,138 @@ +esphome: + name: oled-test + friendly_name: oled test + +esp32: + board: esp32-c3-devkitm-1 + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "rNfuxXEaIvVuOHvYVdb4QpW8fezbbkKn3wvjkHdHGkY=" + +ota: + - platform: esphome + password: "5aa6ac416280761455b83922c266822b" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +# Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Esp32-C3-Oled-Test" + password: "Zto2fEEcWgnS" + +captive_portal: + + +web_server: + +i2c: + id: bus_oled + sda: GPIO5 + scl: GPIO6 + frequency: 100kHz + scan: true + +# --- Czcionki do wyświetlacza (wygodne, ale możesz zmienić na swoje) --- +font: + - file: "fonts/Roboto-Regular.ttf" + id: f12 + size: 9 + - file: "fonts/Roboto-Bold.ttf" + id: f20 + size: 11 + +# --- Przydatne sensory do pokazania na ekranie --- +sensor: + - platform: wifi_signal + name: "WiFi RSSI" + id: wifi_rssi + update_interval: 30s + + - platform: uptime + name: "Uptime (s)" + id: uptime_s + update_interval: 60s + +text_sensor: + - platform: wifi_info + ip_address: + name: "IP" + id: ip_addr + ssid: + name: "SSID" + id: wifi_ssid + +# --- Przycisk BOOT (ten „użytkowy”; RESET/EN nie da się odczytać) --- +binary_sensor: + - platform: gpio + pin: + number: GPIO9 # BOOT na większości C3 + mode: INPUT_PULLUP + inverted: true + name: "BOOT Button" + id: btn_boot + +# --- Prosty przełącznik stron na OLED --- +globals: + - id: page + type: int + restore_value: no + initial_value: '0' + +interval: + - interval: 1s + then: + - if: + condition: + binary_sensor.is_on: btn_boot + then: + - lambda: |- + static uint32_t last = 0; + if (millis() - last > 300) { // debouncing + auto-repeat off + id(page) = (id(page) + 1) % 2; + last = millis(); + } + +# --- Wyświetlacz OLED --- +display: + - platform: ssd1306_i2c + model: "SSD1306 72x40" + address: 0x3C + rotation: 0 + i2c_id: bus_oled # <- to jest kluczowe + lambda: |- + if (id(page) == 0) { + // Strona 1: tytuł + IP + sygnał WiFi + it.printf(0, 0, id(f20), "C3 OLED"); + if (id(ip_addr).has_state()) { + it.printf(0, 14, id(f12), "IP: %s", id(ip_addr).state.c_str()); + } else { + it.printf(0, 14, id(f12), "IP: (brak)"); + } + if (id(wifi_rssi).has_state()) { + it.printf(0, 20, id(f12), "RSSI: %.0f dBm", id(wifi_rssi).state); + } + } else { + // Strona 2: SSID + uptime + if (id(wifi_ssid).has_state()) { + it.printf(0, 0, id(f12), "SSID: %s", id(wifi_ssid).state.c_str()); + } + if (id(uptime_s).has_state()) { + int t = (int) id(uptime_s).state; + int h = t / 3600; + int m = (t % 3600) / 60; + int s = t % 60; + it.printf(0, 14, id(f12), "Uptime: %02d:%02d:%02d", h, m, s); + } + it.printf(0, 26, id(f12), "BOOT: zmiana strony"); + } + + \ No newline at end of file diff --git a/esphome/archive/led3xdrv.yaml b/esphome/archive/led3xdrv.yaml new file mode 100644 index 0000000..dd49a89 --- /dev/null +++ b/esphome/archive/led3xdrv.yaml @@ -0,0 +1,30 @@ +esphome: + name: led3xdrv + friendly_name: Led 3x + +esp8266: + board: esp12e + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "qHvgYr1RgkorYHuCq5kaolpW8Og8TUcV3YZH0KE8ndk=" + +ota: + - platform: esphome + password: "d1e7d153acd8591234576da1844f822f" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Led3Xdrv Fallback Hotspot" + password: "gtsVxHfDKMMR" + +captive_portal: + \ No newline at end of file diff --git a/esphome/archive/test.yaml b/esphome/archive/test.yaml new file mode 100644 index 0000000..8f25b8e --- /dev/null +++ b/esphome/archive/test.yaml @@ -0,0 +1,32 @@ +esphome: + name: test + friendly_name: test + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "Vve4YEX+31JNwAFU+sVD2NnhWWnbuUMKWZlL4mORRIc=" + +ota: + - platform: esphome + password: "f09ef31f496ad2b71b25eecf291b2d43" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Test Fallback Hotspot" + password: "Auci6pFwvVke" + +captive_portal: + \ No newline at end of file diff --git a/esphome/arducam-esp32s.yaml b/esphome/arducam-esp32s.yaml new file mode 100644 index 0000000..8e17b8c --- /dev/null +++ b/esphome/arducam-esp32s.yaml @@ -0,0 +1,53 @@ +esphome: + name: arducam-esp32s + friendly_name: arducam esp32s + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "i8aPgOMVd9fxwvWk6sxr1vsel4XuY9j7r8koRbMrcSI=" + +ota: + - platform: esphome + password: "e1a35f2e0f0254858edb23a94a67f061" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Arducam-Esp32S Fallback Hotspot" + password: "y0yrTNW9ESAy" + +esp32_camera: + name: Arducam Camera + external_clock: + pin: GPIO0 + frequency: 20MHz + i2c_pins: + sda: GPIO26 + scl: GPIO27 + data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35] + vsync_pin: GPIO25 + href_pin: GPIO23 + pixel_clock_pin: GPIO22 + power_down_pin: GPIO32 + resolution: 640x480 + jpeg_quality: 10 + max_framerate: 10 fps + idle_framerate: 0.1 fps + +status_led: + pin: GPIO33 + +captive_portal: + \ No newline at end of file diff --git a/esphome/esp32-cam-front.yaml b/esphome/esp32-cam-front.yaml new file mode 100644 index 0000000..1cdb2bd --- /dev/null +++ b/esphome/esp32-cam-front.yaml @@ -0,0 +1,32 @@ +esphome: + name: esp32-cam-front + friendly_name: esp32-cam-front + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "g9J9UpLCM7i3nzkoU7SV3d2sF5fdqXxPZWaDxQa3g0g=" + +ota: + - platform: esphome + password: "48b5d11c5bca1f2750ab7c6c2ca9be6b" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Esp32-Cam-Front Fallback Hotspot" + password: "NCZ2T6oPRnrq" + +captive_portal: + \ No newline at end of file diff --git a/esphome/i2ctest.yaml b/esphome/i2ctest.yaml new file mode 100644 index 0000000..2dc1f6d --- /dev/null +++ b/esphome/i2ctest.yaml @@ -0,0 +1,142 @@ +esphome: + name: oled-test + friendly_name: oled test + +esp32: + board: esp32-c3-devkitm-1 + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "rNfuxXEaIvVuOHvYVdb4QpW8fezbbkKn3wvjkHdHGkY=" + +ota: + - platform: esphome + password: "5aa6ac416280761455b83922c266822b" + +wifi: + ssid: "Lothlorien" + password: "LitwoOjczyznoMojaTysJestJakZdrowie" + +captive_portal: + +web_server: + +output: + - platform: ledc + pin: GPIO4 + id: led_pwm + frequency: 20000 Hz # 20 kHz – bez pisku i bez migotania w kamerze + +light: + - platform: monochromatic + name: "LED PWM" + output: led_pwm + gamma_correct: 1.0 + +button: + - platform: restart + name: "Restart Device" + - platform: safe_mode + name: "Restart in Safe Mode" + +i2c: + id: bus_oled + sda: GPIO5 + scl: GPIO6 + frequency: 100kHz + scan: true + + +# --- Przydatne sensory do pokazania na ekranie --- +sensor: + - platform: wifi_signal + name: "WiFi RSSI" + id: wifi_rssi + update_interval: 30s + + - platform: uptime + name: "Uptime (s)" + id: uptime_s + update_interval: 60s + + - platform: hm3301 + i2c_id: bus_oled + update_interval: 30s + pm_1_0: + name: "PM1.0" + id: pm_1_0 + pm_2_5: + name: "PM2.5" + id: pm_2_5 + pm_10_0: + name: "PM10" + id: pm_10_0 + + - platform: dht + pin: GPIO10 + model: DHT11 + temperature: + name: "Temperatura" + humidity: + name: "Wilgotność" + update_interval: 30s + + - platform: bmp3xx_i2c + i2c_id: bus_oled + address: 0x77 # jeśli skan pokaże 0x76, zmień tutaj + temperature: + name: "Temperatura BMP388" + oversampling: 16x + pressure: + name: "Ciśnienie BMP388" + oversampling: 16x + update_interval: 30s + +text_sensor: + - platform: wifi_info + ip_address: + name: "IP" + id: ip_addr + ssid: + name: "SSID" + id: wifi_ssid + +# --- Przycisk BOOT (ten „użytkowy”; RESET/EN nie da się odczytać) --- +binary_sensor: + - platform: gpio + pin: + number: GPIO9 # BOOT na większości C3 + mode: INPUT_PULLUP + inverted: true + name: "BOOT Button" + id: btn_boot + - platform: gpio + pin: + number: GPIO7 + mode: + input: true + pullup: false + pulldown: true + name: "Czujnik ruchu SR505" + device_class: motion + filters: + - delayed_off: 2s + - platform: gpio + pin: + number: GPIO3 + mode: + input: true + pullup: false + pulldown: false + name: "Czujnik ruchu HW-416A" + device_class: motion + filters: + - delayed_off: 2s + + diff --git a/esphome/led3xdrv.yaml b/esphome/led3xdrv.yaml new file mode 100644 index 0000000..e913dc3 --- /dev/null +++ b/esphome/led3xdrv.yaml @@ -0,0 +1,88 @@ +esphome: + name: led3xdrv + friendly_name: Led 3x + +esp32: + board: esp32-c3-devkitm-1 + variant: esp32c3 + +logger: + +api: + encryption: + key: "naGRefDq/h5OWxKuRx+Wo7lJbgz9ynFkUajsMPrBrY4=" + +ota: + - platform: esphome + password: "2fd6ea54e1209c9ce76a7d9392108b71" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +web_server: + +output: + - platform: ledc + pin: GPIO4 + id: led_pwm01 + frequency: 20000 Hz + - platform: ledc + pin: GPIO5 + id: led_pwm02 + frequency: 20000 Hz + - platform: ledc + pin: GPIO6 + id: led_pwm03 + frequency: 20000 Hz + +light: + - platform: monochromatic + name: "LED PWM 1" + output: led_pwm01 + gamma_correct: 1.0 + - platform: monochromatic + name: "LED PWM 2" + output: led_pwm02 + gamma_correct: 1.0 + - platform: monochromatic + name: "LED PWM 3" + output: led_pwm03 + gamma_correct: 1.0 + +button: + - platform: restart + name: "Restart Device" + - platform: safe_mode + name: "Restart in Safe Mode" + +sensor: + - platform: wifi_signal + name: "WiFi RSSI" + id: wifi_rssi + update_interval: 30s + + - platform: uptime + name: "Uptime (s)" + id: uptime_s + update_interval: 60s + +binary_sensor: + - platform: gpio + pin: + number: GPIO9 # BOOT na większości C3 + mode: INPUT_PULLUP + inverted: true + name: "BOOT Button" + id: btn_boot + - platform: gpio + pin: + number: GPIO7 + mode: + input: true + pullup: false + pulldown: true + name: "Czujnik ruchu SR505" + device_class: motion + filters: + - delayed_off: 2s