A teď první rychlý test:
1) ESP home nahrát jde, následně OTA upload funguje bez problémů
2) Config - funkční relé, led a tlačítko, měření snad přibližně také, ještě to bude chtít kalibraci
Kód: Vybrat vše
esphome:
name: eu6stest
platform: ESP8266
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "0dd51cb18a730538afecdd0e5144e38b"
wifi:
ssid: !secret iotssid
password: !secret iotwifipass
domain: .lan
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Eu6Stest Fallback Hotspot"
password: "2vuZFXTmTeWq"
captive_portal:
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO13
inverted: True
on_press:
- switch.toggle: fakebutton
switch:
- platform: template
name: "Blitzwolf SHP2 Přepínač"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
id: relay
pin: GPIO15
output:
- platform: esp8266_pwm
id: pow_blue_led
pin:
number: GPIO2
inverted: True
light:
- platform: monochromatic
output: pow_blue_led
id: led
sensor:
- platform: wifi_signal
name: "Blitzwolf SHP2 WiFi Signál"
update_interval: 60s
- platform: uptime
name: "Blitzwolf SHP2 Doba běhu"
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO05
cf1_pin: GPIO14
current_resistor: "0.0028"
voltage_divider: "960"
current:
name: "Blitzwolf SHP2 Proud"
unit_of_measurement: A
voltage:
name: "Blitzwolf SHP2 Napětí"
unit_of_measurement: V
power:
name: "Blitzwolf SHP2 Příkon"
unit_of_measurement: W
id: power
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: "Blitzwolf SHP2 Denní spotřeba"
power_id: power
unit_of_measurement: W
text_sensor:
- platform: version
name: "Blitzwolf SHP2 Verze firmware"
#status_led:
# pin: GPIO2
time:
- platform: sntp
id: my_time
LOG:
Kód: Vybrat vše
INFO Reading configuration /config/esphome/eu6stest.yaml...
INFO Detected timezone 'Europe/Prague'
INFO Starting log output from eu6stest.lan using esphome API
INFO Successfully connected to eu6stest.lan
[04:25:28][I][app:099]: ESPHome version 2021.11.4 compiled on Dec 1 2021, 04:19:28
[04:25:28][C][wifi:488]: WiFi:
[04:25:28][C][wifi:350]: Local MAC: 50:02:91:48:61:41
[04:25:28][C][wifi:351]: SSID: [redacted]
[04:25:28][C][wifi:352]: IP Address: 192.168.199.245
[04:25:28][C][wifi:354]: BSSID: [redacted]
[04:25:28][C][wifi:355]: Hostname: 'eu6stest'
[04:25:28][C][wifi:357]: Signal strength: -57 dB ▂▄▆█
[04:25:28][C][wifi:361]: Channel: 11
[04:25:28][C][wifi:362]: Subnet: 255.255.255.0
[04:25:28][C][wifi:363]: Gateway: 192.168.199.1
[04:25:28][C][wifi:364]: DNS1: 192.168.199.2
[04:25:28][C][wifi:365]: DNS2: 0.0.0.0
[04:25:28][C][logger:233]: Logger:
[04:25:28][C][logger:234]: Level: DEBUG
[04:25:28][C][logger:235]: Log Baud Rate: 115200
[04:25:28][C][logger:236]: Hardware UART: UART0
[04:25:28][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'button'
[04:25:28][C][gpio.binary_sensor:016]: Pin: GPIO13
[04:25:28][C][template.switch:058]: Template Switch 'Blitzwolf SHP2 Přepínač'
[04:25:28][C][template.switch:059]: Restore State: NO
[04:25:28][C][template.switch:060]: Optimistic: YES
[04:25:28][C][switch.gpio:048]: GPIO Switch 'relay'
[04:25:28][C][switch.gpio:049]: Pin: GPIO15
[04:25:28][C][switch.gpio:071]: Restore Mode: Restore (Defaults to OFF)
[04:25:29][C][esp8266_pwm:025]: ESP8266 PWM:
[04:25:29][C][esp8266_pwm:026]: Pin: GPIO2
[04:25:29][C][esp8266_pwm:027]: Frequency: 1000.0 Hz
[04:25:29][C][uptime.sensor:031]: Uptime Sensor 'Blitzwolf SHP2 Doba běhu'
[04:25:29][C][uptime.sensor:031]: State Class: 'total_increasing'
[04:25:29][C][uptime.sensor:031]: Unit of Measurement: 's'
[04:25:29][C][uptime.sensor:031]: Accuracy Decimals: 0
[04:25:29][C][uptime.sensor:031]: Icon: 'mdi:timer-outline'
[04:25:29][C][light:098]: Light 'led'
[04:25:29][C][light:100]: Default Transition Length: 1.0s
[04:25:29][C][light:101]: Gamma Correct: 2.80
[04:25:29][C][hlw8012:037]: HLW8012:
[04:25:29][C][hlw8012:038]: SEL Pin: GPIO12
[04:25:29][C][hlw8012:039]: CF Pin: GPIO5
[04:25:29][C][hlw8012:040]: CF1 Pin: GPIO14
[04:25:29][C][hlw8012:041]: Change measurement mode every 8
[04:25:29][C][hlw8012:042]: Current resistor: 2.8 mΩ
[04:25:29][C][hlw8012:043]: Voltage Divider: 960.0
[04:25:29][C][hlw8012:044]: Update Interval: 10.0s
[04:25:29][C][hlw8012:045]: Voltage 'Blitzwolf SHP2 Napětí'
[04:25:29][C][hlw8012:045]: Device Class: 'voltage'
[04:25:29][C][hlw8012:045]: State Class: 'measurement'
[04:25:29][C][hlw8012:045]: Unit of Measurement: 'V'
[04:25:29][C][hlw8012:045]: Accuracy Decimals: 1
[04:25:29][C][hlw8012:046]: Current 'Blitzwolf SHP2 Proud'
[04:25:29][C][hlw8012:046]: Device Class: 'current'
[04:25:29][C][hlw8012:046]: State Class: 'measurement'
[04:25:29][C][hlw8012:046]: Unit of Measurement: 'A'
[04:25:29][C][hlw8012:046]: Accuracy Decimals: 2
[04:25:29][C][hlw8012:047]: Power 'Blitzwolf SHP2 Příkon'
[04:25:29][C][hlw8012:047]: Device Class: 'power'
[04:25:29][C][hlw8012:047]: State Class: 'measurement'
[04:25:29][C][hlw8012:047]: Unit of Measurement: 'W'
[04:25:29][C][hlw8012:047]: Accuracy Decimals: 1
[04:25:29][C][total_daily_energy:024]: Total Daily Energy 'Blitzwolf SHP2 Denní spotřeba'
[04:25:29][C][total_daily_energy:024]: Device Class: 'energy'
[04:25:29][C][total_daily_energy:024]: State Class: 'total_increasing'
[04:25:29][C][total_daily_energy:024]: Unit of Measurement: 'W'
[04:25:29][C][total_daily_energy:024]: Accuracy Decimals: 3
[04:25:29][C][version.text_sensor:021]: Version Text Sensor 'Blitzwolf SHP2 Verze firmware'
[04:25:29][C][version.text_sensor:021]: Icon: 'mdi:new-box'
[04:25:29][C][captive_portal:151]: Captive Portal:
[04:25:29][C][ota:082]: Over-The-Air Updates:
[04:25:29][C][ota:083]: Address: eu6stest.lan:8266
[04:25:29][C][ota:086]: Using Password.
[04:25:29][C][api:134]: API Server:
[04:25:29][C][api:135]: Address: eu6stest.lan:6053
[04:25:29][C][api:139]: Using noise encryption: NO
[04:25:29][C][wifi_signal.sensor:009]: WiFi Signal 'Blitzwolf SHP2 WiFi Signál'
[04:25:29][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[04:25:29][C][wifi_signal.sensor:009]: State Class: 'measurement'
[04:25:29][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[04:25:29][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[04:25:29][C][sntp:050]: SNTP Time:
[04:25:29][C][sntp:051]: Server 1: '0.pool.ntp.org'
[04:25:29][C][sntp:052]: Server 2: '1.pool.ntp.org'
[04:25:29][C][sntp:053]: Server 3: '2.pool.ntp.org'
[04:25:29][C][sntp:054]: Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[04:25:29][C][mdns:084]: mDNS:
[04:25:29][C][mdns:085]: Hostname: eu6stest
[04:25:38][D][hlw8012:076]: Got power=33.0W, current=0.1A
[04:25:38][D][sensor:113]: 'Blitzwolf SHP2 Proud': Sending state 0.07294 A with 2 decimals of accuracy
[04:25:38][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 33.03520 W with 1 decimals of accuracy
[04:25:38][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 2.81830 W with 3 decimals of accuracy
[04:25:43][D][sensor:113]: 'Blitzwolf SHP2 Doba běhu': Sending state 352.98099 s with 0 decimals of accuracy
[04:25:48][D][hlw8012:076]: Got power=33.0W, current=0.1A
[04:25:48][D][sensor:113]: 'Blitzwolf SHP2 Proud': Sending state 0.07294 A with 2 decimals of accuracy
[04:25:48][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 33.03520 W with 1 decimals of accuracy
[04:25:48][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 2.91006 W with 3 decimals of accuracy
[04:25:50][D][sensor:113]: 'Blitzwolf SHP2 WiFi Signál': Sending state -56.00000 dBm with 0 decimals of accuracy
[04:25:58][D][hlw8012:076]: Got power=33.2W, current=0.1A
[04:25:58][D][sensor:113]: 'Blitzwolf SHP2 Proud': Sending state 0.07294 A with 2 decimals of accuracy
[04:25:58][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 33.18605 W with 1 decimals of accuracy
[04:25:58][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 3.00224 W with 3 decimals of accuracy
[04:26:08][D][hlw8012:076]: Got power=33.0W, current=0.1A
[04:26:08][D][sensor:113]: 'Blitzwolf SHP2 Proud': Sending state 0.07294 A with 2 decimals of accuracy
[04:26:08][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 33.03520 W with 1 decimals of accuracy
[04:26:08][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 3.09400 W with 3 decimals of accuracy
[04:26:18][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 33.03520 W with 1 decimals of accuracy
[04:26:18][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 3.18566 W with 3 decimals of accuracy
[04:26:28][D][hlw8012:082]: Got power=32.9W, voltage=241.7V
[04:26:28][D][sensor:113]: 'Blitzwolf SHP2 Napětí': Sending state 241.71536 V with 1 decimals of accuracy
[04:26:28][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 32.88435 W with 1 decimals of accuracy
[04:26:28][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 3.27712 W with 3 decimals of accuracy
[04:26:38][D][hlw8012:082]: Got power=32.9W, voltage=241.6V
[04:26:38][D][sensor:113]: 'Blitzwolf SHP2 Napětí': Sending state 241.64861 V with 1 decimals of accuracy
[04:26:38][D][sensor:113]: 'Blitzwolf SHP2 Příkon': Sending state 32.88435 W with 1 decimals of accuracy
[04:26:38][D][sensor:113]: 'Blitzwolf SHP2 Denní spotřeba': Sending state 3.36846 W with 3 decimals of accuracy