Nie wiem czy to ogarnę w espeasy miałem wszystko do wyboru w esphome muszę nauczyć się programować
a próbowałeś czytać dokumentację? Jest wszystko dobrze opisane.
poczytałem... i z podstaw już coś kumam.
chciałbym sterować czerwoną diodą która jest na ESP32 z tego co wyczytałem jest ona na GPIO2
wpisałem taki kod ale to nie działa co jest źle?
switch:
- platform: gpio
pin: 2
name: "led"
id: led
binary_sensor:
- platform: gpio
pin:
number: 27
mode:
input: true
pullup: true
inverted: true
name: "przycisk"
id: button1
on_press:
then:
- switch.toggle: led
teoretycznie powinno działać. Na początku konfiguracji podajesz rodzaj platformy, np. d1_mini, po tym jest rozpoznawana mapa we/wy.
Po pierwsze dla pewności podawaj pełną nazwę GPIOx, po drugie do led powinno się stosować:
### przycisk
binary_sensor:
- platform: gpio
pin:
number: GPIO4
filters:
- delayed_on_off: 50ms # small delay to prevent debouncing
name: "Switch ${devicename}"
on_press:
then:
- light.toggle: red_led
internal: true
id: switchid
### kontrolka
light:
- platform: monochromatic
output: pwm_output
name: "red led"
id: red_led
output:
- platform: esp8266_pwm
pin: GPIO3
frequency: 1000Hz
id: pwm_output
poczytałem... i z podstaw już coś kumam.
chciałbym sterować czerwoną diodą która jest na ESP32 z tego co wyczytałem jest ona na GPIO2
wpisałem taki kod ale to nie działa co jest źle?switch: - platform: gpio pin: 2 name: "led" id: led binary_sensor: - platform: gpio pin: number: 27 mode: input: true pullup: true inverted: true name: "przycisk" id: button1 on_press: then: - switch.toggle: led
Spróbuj czegoś takiego ( nie bezpośrednio tylko przez template )
binary_sensor: - platform: gpio pin: number: GPIO27 mode: INPUT_PULLUP inverted: True id: button1 on_press: - switch.toggle: button_switch switch: - platform: template name: Switch optimistic: true id: button_switch turn_on_action: - switch.turn_on: led turn_off_action: - switch.turn_off: led - platform: gpio pin: number: GPIO02 id: led
po drugie do led powinno się stosować:
Ale to do LED do oświetlenia żeby je ściemniać , a nie do takich statusowych on/off...
switch:
- platform: gpio
name: "dioda"
id: relay
pin: D3
button:
- platform: template
name: przycisk
on_press:
- switch.toggle: relay
binary_sensor:
- platform: gpio
pin:
number: D4
filters:
- delayed_on_off: 50ms # small delay to prevent debouncing
name: "Switch ${devicename}"
on_press:
then:
- switch.toggle: relay
internal: true
id: switchid
Pododawałem kilka rodzajów czujników a teraz mam problem z bme280_i2c
wpisałem tak w esphome:
i2c:
sda: 4
scl: 5
scan: true
sensor:
- platform: bme280_i2c
temperature:
name: "BME280 Temperature"
id: bme280_temperature
pressure:
name: "BME280 Pressure"
id: bme280_pressure
humidity:
name: "BME280 Relative Humidity"
id: bme280_humidity
address: 0x77
update_interval: 15s
- platform: template
name: "Altitude"
lambda: |-
const float STANDARD_SEA_LEVEL_PRESSURE = 1013.25; //in hPa, see note
return ((id(bme280_temperature).state + 273.15) / 0.0065) *
(powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme280_pressure).state), 0.190234) - 1); // in meter
update_interval: 15s
icon: 'mdi:signal'
unit_of_measurement: 'm'
- platform: absolute_humidity
name: "Absolute Humidity"
temperature: bme280_temperature
humidity: bme280_humidity
- platform: template
name: "Dew Point"
lambda: |-
return (243.5*(log(id(bme280_humidity).state/100)+((17.67*id(bme280_temperature).state)/
(243.5+id(bme280_temperature).state)))/(17.67-log(id(bme280_humidity).state/100)-
((17.67*id(bme280_temperature).state)/(243.5+id(bme280_temperature).state))));
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'
log mam taki:
INFO ESPHome 2024.10.3 INFO Reading configuration /config/esphome/test-jedynka.yaml... INFO Detected timezone 'Europe/Warsaw' INFO Starting log output from 192.168.2.174 using esphome API INFO Successfully connected to test-jedynka @ 192.168.2.174 in 0.109s INFO Successful handshake with test-jedynka @ 192.168.2.174 in 3.002s [21:18:59][I][app:100]: ESPHome version 2024.10.3 compiled on Nov 17 2024, 20:47:20 [21:18:59][C][wifi:600]: WiFi: [21:18:59][C][wifi:428]: Local MAC: 8C:CE:1E:E3:3D:C4 [21:18:59][C][wifi:433]: SSID: [redacted] [21:18:59][C][wifi:436]: IP Address: 192.168.2.174 [21:18:59][C][wifi:439]: BSSID: [redacted] [21:18:59][C][wifi:441]: Hostname: 'test-jedynka' [21:18:59][C][wifi:443]: Signal strength: -81 dB ▂▄▆█ [21:18:59][C][wifi:447]: Channel: 11 [21:18:59][C][wifi:448]: Subnet: 255.255.255.0 [21:18:59][C][wifi:449]: Gateway: 192.168.2.1 [21:18:59][C][wifi:450]: DNS1: 192.168.2.1 [21:18:59][C][wifi:451]: DNS2: 0.0.0.0 [21:18:59][C][logger:185]: Logger: [21:18:59][C][logger:186]: Level: DEBUG [21:18:59][C][logger:188]: Log Baud Rate: 115200 [21:18:59][C][logger:189]: Hardware UART: UART0 [21:18:59][C][i2c.arduino:071]: I2C Bus: [21:18:59][C][i2c.arduino:072]: SDA Pin: GPIO4 [21:18:59][C][i2c.arduino:073]: SCL Pin: GPIO5 [21:18:59][C][i2c.arduino:074]: Frequency: 50000 Hz [21:18:59][C][i2c.arduino:086]: Recovery: bus successfully recovered [21:18:59][I][i2c.arduino:096]: Results from i2c bus scan: [21:18:59][I][i2c.arduino:102]: Found i2c device at address 0x76 [21:18:59][C][template.sensor:022]: Template Sensor 'Altitude' [21:18:59][C][template.sensor:022]: State Class: '' [21:18:59][C][template.sensor:022]: Unit of Measurement: 'm' [21:18:59][C][template.sensor:022]: Accuracy Decimals: 1 [21:18:59][C][template.sensor:022]: Icon: 'mdi:signal' [21:18:59][C][template.sensor:023]: Update Interval: 15.0s [21:18:59][C][template.sensor:022]: Template Sensor 'Dew Point' [21:18:59][C][template.sensor:022]: State Class: '' [21:18:59][C][template.sensor:022]: Unit of Measurement: '°C' [21:18:59][C][template.sensor:022]: Accuracy Decimals: 1 [21:18:59][C][template.sensor:022]: Icon: 'mdi:thermometer-alert' [21:18:59][C][template.sensor:023]: Update Interval: 60.0s [21:18:59][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'testowy przycisk' [21:18:59][C][gpio.binary_sensor:016]: Pin: GPIO12 [21:18:59][C][homeassistant.time:010]: Home Assistant Time: [21:18:59][C][homeassistant.time:011]: Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3' [21:18:59][C][bme280_i2c.sensor:025]: Address: 0x77 [21:18:59][C][bme280.sensor:182]: BME280: [21:18:59][E][bme280.sensor:185]: Communication with BME280 failed! [21:18:59][C][bme280.sensor:194]: IIR Filter: OFF [21:18:59][C][bme280.sensor:195]: Update Interval: 15.0s [21:18:59][C][bme280.sensor:197]: Temperature 'BME280 Temperature' [21:18:59][C][bme280.sensor:197]: Device Class: 'temperature' [21:18:59][C][bme280.sensor:197]: State Class: 'measurement' [21:18:59][C][bme280.sensor:197]: Unit of Measurement: '°C' [21:18:59][C][bme280.sensor:197]: Accuracy Decimals: 1 [21:18:59][C][bme280.sensor:198]: Oversampling: 16x [21:18:59][C][bme280.sensor:199]: Pressure 'BME280 Pressure' [21:18:59][C][bme280.sensor:199]: Device Class: 'pressure' [21:18:59][C][bme280.sensor:199]: State Class: 'measurement' [21:18:59][C][bme280.sensor:199]: Unit of Measurement: 'hPa' [21:18:59][C][bme280.sensor:199]: Accuracy Decimals: 1 [21:18:59][C][bme280.sensor:200]: Oversampling: 16x [21:18:59][C][bme280.sensor:201]: Humidity 'BME280 Relative Humidity' [21:18:59][C][bme280.sensor:201]: Device Class: 'humidity' [21:18:59][C][bme280.sensor:201]: State Class: 'measurement' [21:18:59][C][bme280.sensor:201]: Unit of Measurement: '%' [21:18:59][C][bme280.sensor:201]: Accuracy Decimals: 1 [21:18:59][C][bme280.sensor:202]: Oversampling: 16x [21:18:59][E][component:082]: Component bme280_base is marked FAILED [21:18:59][C][absolute_humidity.sensor:026]: Absolute Humidity 'Absolute Humidity' [21:18:59][C][absolute_humidity.sensor:026]: State Class: 'measurement' [21:18:59][C][absolute_humidity.sensor:026]: Unit of Measurement: 'g/m³' [21:18:59][C][absolute_humidity.sensor:026]: Accuracy Decimals: 2 [21:18:59][C][absolute_humidity.sensor:026]: Icon: 'mdi:water' [21:18:59][C][absolute_humidity.sensor:036]: Saturation Vapor Pressure Equation: Wobus [21:18:59][C][absolute_humidity.sensor:043]: Sources [21:18:59][C][absolute_humidity.sensor:044]: Temperature: 'BME280 Temperature' [21:18:59][C][absolute_humidity.sensor:045]: Relative Humidity: 'BME280 Relative Humidity' [21:18:59][C][captive_portal:089]: Captive Portal: [21:18:59][C][web_server:153]: Web Server: [21:18:59][C][web_server:154]: Address: test-jedynka.local:80 [21:18:59][C][mdns:116]: mDNS: [21:18:59][C][mdns:117]: Hostname: test-jedynka [21:18:59][C][esphome.ota:073]: Over-The-Air updates: [21:18:59][C][esphome.ota:074]: Address: test-jedynka.local:8266 [21:18:59][C][esphome.ota:075]: Version: 2 [21:18:59][C][esphome.ota:078]: Password configured [21:18:59][C][safe_mode:018]: Safe Mode: [21:18:59][C][safe_mode:019]: Boot considered successful after 60 seconds [21:18:59][C][safe_mode:021]: Invoke after 10 boot attempts [21:18:59][C][safe_mode:022]: Remain in safe mode for 300 seconds [21:18:59][C][api:140]: API Server: [21:18:59][C][api:141]: Address: test-jedynka.local:6053 [21:18:59][C][api:143]: Using noise encryption: YES
co jest nie tak?
ja nie korzystam z takich rozwiązań nawet w akwarium mam oddzielne ledy do symulacji świt/zmierzch.
Zaciekawiło mnie to, zrobiłeś to na esphome czy może na WLED?
Napisz coś więcej bo dodał bym to też w moim akwarium.
Tradycyjnie nie widziałem banalnego błędu.
Już działa tylko wskazuje ciśnienie sporo zaniżone w porównaniu gdy podłączę go po staremu do Domoticza jak to skorygować?
rozwiń myśl. Czujnik wysyła takie same dane niezależnie do czego jest podłączony.
do kalibracji:
Bo ciśnienie ciśnieniu nie równe 🙂 Zależy ściśle od wysokości czujnika ( w tym samym miejscu czujnik pokaże inną wartość na parterze , a inną na 4 piętrze) , i on pokazuje wartość względną , a wszystkie dane meteorologiczne sprowadzają ciśnienie tak jakby nie było dodatkowych wysokości ( czyli do 0m nad poziomem morza).
Widziałem gdzieś przykłady , gdzie podawało się konkretną wysokość na jakiej czujnik się znajduje ( trzeba to wiedzieć , choćby z map , czy z GPSu) a on wtedy przelicza ciśnienie na bezwzględne ( czyli takie ,jakie zobaczyć można w Pogodzie).
Bo u Ciebie jest odwrotnie , na podstawie Ciśnienia referencyjnego na 0m npm ( przyjętego na 1013,25 hPa) wylicza ,na jakiej wysokości jest czujnik.
....... ja nie korzystam z takich rozwiązań nawet w akwarium mam oddzielne ledy do symulacji świt/zmierzch.
Napisz proszę jak masz to rozwiązane chciałbym też zrobić świt zmierzch w akwarium.

