From ae9c3aaf30ff860538a22fa37e3e6b88ac76c790 Mon Sep 17 00:00:00 2001 From: pszafer Date: Sun, 23 Nov 2025 08:52:13 +0100 Subject: [PATCH] fix gpio for 8x10A --- create_firmware.py | 11 ++- dev-boneio-8x10A-adc.yaml | 2 +- dev-boneio-ps01.yaml | 194 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 dev-boneio-ps01.yaml diff --git a/create_firmware.py b/create_firmware.py index 51d9f4f..1a2dd3c 100644 --- a/create_firmware.py +++ b/create_firmware.py @@ -32,11 +32,16 @@ exclude_files = [ # Dodaj tutaj kolejne pliki do wykluczenia ] +include_files = [ + "boneio-dimmer_gen2_4cct-v0_1.yaml", + "boneio-dimmer_gen2_2rgbw-v0_1.yaml", +] + def json_pattern(firmware_name, chip_family="ESP32"): return { "name": "ESPHome", - "version": "2025.8.2", + "version": "2025.10.2", "home_assistant_domain": "esphome", "funding_url": "https://esphome.io/guides/supporters.html", "new_install_prompt_erase": False, @@ -70,6 +75,9 @@ for file in glob.glob("*.yaml"): if file in exclude_files: print(f"Skipping excluded file: {file}") continue + if file not in include_files: + print(f"Skipping file: {file}") + continue filename = get_boneio_name(file) chip_family = "ESP32-S3" if "gen2" in filename else "ESP32" @@ -92,6 +100,7 @@ for file in glob.glob("*.yaml"): with open( f"{json_destination}/{filename}.json", "w", encoding="utf-8" ) as f: + print(f"Creating JSON file: {json_destination}/{filename}.json") json.dump( json_pattern(firmware_name=filename, chip_family=chip_family), f, diff --git a/dev-boneio-8x10A-adc.yaml b/dev-boneio-8x10A-adc.yaml index 7571bf7..831bd95 100644 --- a/dev-boneio-8x10A-adc.yaml +++ b/dev-boneio-8x10A-adc.yaml @@ -198,7 +198,7 @@ switch: id: can_led name: 'CAN LED' pin: - number: GPIO19 # Pin dla CAN_LED + number: GPIO8 # Pin dla CAN_LED mode: output: true inverted: false diff --git a/dev-boneio-ps01.yaml b/dev-boneio-ps01.yaml new file mode 100644 index 0000000..de3740c --- /dev/null +++ b/dev-boneio-ps01.yaml @@ -0,0 +1,194 @@ +substitutions: + name: boneio-ps-01 + friendly_name: 'BoneIO PS-01 Czujnik Obecności' + serial_prefix: 'ps01' #Don't change it. + firmware_manifest: 'https://boneio.eu/esp/boneio-ps-01.json' # URL manifestu + +esphome: + name: '${name}' + friendly_name: '${friendly_name}' + name_add_mac_suffix: true + project: + name: boneio.presence-sensor-ps01 + version: 'dev0.1' # Przykładowa wersja + on_boot: + priority: -100 + then: + - delay: 5s + - if: + condition: + lambda: 'return id(serial_no) != nullptr;' + then: + - component.update: serial_no + - logger.log: "Serial No updated on boot" + else: + - logger.log: "Serial No component not found" + +esp32: + variant: esp32s3 + flash_size: 16MB + framework: + type: esp-idf +psram: + mode: octal + speed: 80MHz +# --- NOWA SEKCJA: WiFi --- +wifi: + ssid: "TwojeSSID" + password: "TwojeHaslo" + + # Tryb AP do pierwszej konfiguracji + ap: + ssid: "PS-01 Sensor Setup" + password: "boneio-setup" + +captive_portal: + + +i2c: + id: i2c_bus # Dodano ID dla czujników + sda: GPIO10 + scl: GPIO11 + scan: True + frequency: 400kHz + +# --- ZAKTUALIZOWANY UART (dla radaru) --- +uart: + - id: radar_uart + tx_pin: GPIO21 # ESP TX -> Radar RX + rx_pin: GPIO14 # ESP RX -> Radar TX + baud_rate: 115200 # Standard dla LD2412 + - id: boneio_uart + rx_pin: GPIO47 # CAN RX wg tabeli (dla CAN Bus) + tx_pin: GPIO48 # CAN TX wg tabeli (dla CAN Bus) + baud_rate: 9600 + stop_bits: 1 + +# --- NOWA SEKCJA: Radar LD2412 --- +ld2412: + uart_id: radar_uart + +packages: + internals_packages: + url: https://github.com/boneIO-eu/esphome + ref: v1.7.1 + files: [ + 'devices/serial_no.yaml', + ] + +dashboard_import: + package_import_url: github://boneIO-eu/esphome/boneio-ps-01-presence-sensor.yaml@main # Zgadywany URL + import_full_config: true + +# --- USUNIĘTY pcf8574 --- + +logger: + hardware_uart: UART0 +api: + reboot_timeout: 0s +ota: + - platform: esphome + - platform: web_server + +web_server: + port: 80 + version: 3 + local: true + +# --- USUNIĘTE 'output' i 'light' --- + +debug: + update_interval: 15s + +sensor: + - platform: lm75b + id: boneIO_temp + name: 'Temperature' + update_interval: 30s + entity_category: diagnostic + on_value_range: + - above: 70.0 + then: + - switch.turn_on: buzzer + - below: 70.0 + then: + - switch.turn_off: buzzer + - platform: debug + free: + name: "Heap Free" + block: + name: "Heap Max Block" + + # --- NOWA SEKCJA: Czujniki I2C --- + - platform: sht4x + i2c_id: i2c_bus + address: 0x44 # Z tabeli + temperature: + name: "Temperatura" + humidity: + name: "Wilgotność" + update_interval: 15s + + - platform: veml7700 + address: 0x10 + update_interval: 60s + + # short variant of sensor definition: + ambient_light: "Ambient light" + # longer variant of sensor definition: + actual_gain: + name: "Actual gain" + + # Czujniki dla radaru LD2412 (dystans, energia) + # zostaną dodane automatycznie przez komponent 'ld2412' + +switch: + - platform: gpio + id: buzzer + name: 'Buzzer' + pin: + number: GPIO12 # Zaktualizowany pin + mode: output + inverted: false + + - platform: gpio + id: can_stb + name: 'CAN STB' + pin: + number: GPIO13 # Zaktualizowany pin + mode: output + inverted: false + + # --- NOWA SEKCJA: Przełączniki --- + - platform: gpio + id: led_status + name: 'LED Status' + pin: + number: GPIO1 # Zaktualizowany pin + mode: output + inverted: false + + - platform: gpio + id: relay_1 + name: 'Przekaźnik 1' + pin: + number: GPIO18 # Z tabeli + mode: output + inverted: false + + - platform: gpio + id: relay_2 + name: 'Przekaźnik 2' + pin: + number: GPIO17 # Z tabeli + mode: output + inverted: false + + +binary_sensor: + - platform: gpio + name: 'Obecność (Pin OUT)' + pin: + number: GPIO41 # RADAR_OUT + mode: input + device_class: presence \ No newline at end of file