Format all files

This commit is contained in:
2026-07-12 12:56:02 +00:00
parent 7612987884
commit a5c5bf6c6b
56 changed files with 2372 additions and 2395 deletions
+5 -5
View File
@@ -13,7 +13,7 @@ globals:
- id: ble_scans
type: int
restore_value: no
initial_value: '0'
initial_value: "0"
esp32_ble_tracker:
scan_parameters:
@@ -23,10 +23,10 @@ esp32_ble_tracker:
active: true
on_scan_end:
- then:
- sensor.template.publish:
id: ble_scans_finished
state: !lambda 'return ++id(ble_scans);'
- script.execute: restart_after_delay
- sensor.template.publish:
id: ble_scans_finished
state: !lambda "return ++id(ble_scans);"
- script.execute: restart_after_delay
bluetooth_proxy:
id: btproxy
+5 -5
View File
@@ -12,8 +12,8 @@ packages:
logger:
switch:
- platform: gpio
pin: GPIO0
name: None
inverted: true
id: relay
- platform: gpio
pin: GPIO0
name: None
inverted: true
id: relay
+7 -7
View File
@@ -16,13 +16,13 @@ ethernet:
domain: ""
text_sensor:
- platform: ethernet_info
ip_address:
name: "ESP chip IP (Ethernet)"
icon: mdi:ip-network
mac_address:
name: "ESP chip MAC (Ethernet)"
icon: mdi:expansion-card
- platform: ethernet_info
ip_address:
name: "ESP chip IP (Ethernet)"
icon: mdi:ip-network
mac_address:
name: "ESP chip MAC (Ethernet)"
icon: mdi:expansion-card
logger:
+4 -4
View File
@@ -1,7 +1,7 @@
# Make sure nothing is connected to the A0 pin.
sensor:
- platform: adc
pin: VCC
name: "ESP chip VCC Voltage"
entity_category: diagnostic
- platform: adc
pin: VCC
name: "ESP chip VCC Voltage"
entity_category: diagnostic
+82 -82
View File
@@ -41,39 +41,39 @@ status_led:
pin: GPIO16
binary_sensor:
- platform: gpio
id: mystrom_side
name: "Side button (plus) pressed"
pin:
number: GPIO23
mode:
input: true
pullup: true
inverted: true
- platform: gpio
id: mystrom_bottom
name: "Bottom button (power) pressed"
pin:
number: GPIO18
mode:
input: true
pullup: true
inverted: true
on_press:
then:
- switch.toggle: mystrom_relay
- platform: gpio
id: mystrom_side
name: "Side button (plus) pressed"
pin:
number: GPIO23
mode:
input: true
pullup: true
inverted: true
- platform: gpio
id: mystrom_bottom
name: "Bottom button (power) pressed"
pin:
number: GPIO18
mode:
input: true
pullup: true
inverted: true
on_press:
then:
- switch.toggle: mystrom_relay
script:
- id: power_cycle_relay
mode: single
then:
- if:
condition:
switch.is_on: mystrom_relay
then:
- switch.turn_off: mystrom_relay
- delay: 7s
- switch.turn_on: mystrom_relay
- id: power_cycle_relay
mode: single
then:
- if:
condition:
switch.is_on: mystrom_relay
then:
- switch.turn_off: mystrom_relay
- delay: 7s
- switch.turn_on: mystrom_relay
button:
- platform: template
@@ -83,60 +83,60 @@ button:
- script.execute: power_cycle_relay
sensor:
- platform: pulse_counter
pin: 4
update_interval: 10s
id: mystrom_power_consumption
name: "Power relay consumption"
device_class: "power"
state_class: "measurement"
unit_of_measurement: "W"
accuracy_decimals: 0
filters:
- multiply: 3.29E-02 # pulse/min -> W
total:
name: "Energy consumption"
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "total_increasing"
accuracy_decimals: 3
- platform: pulse_counter
pin: 4
update_interval: 10s
id: mystrom_power_consumption
name: "Power relay consumption"
device_class: "power"
state_class: "measurement"
unit_of_measurement: "W"
accuracy_decimals: 0
filters:
- multiply: 5.48E-07 # pulses -> kWh
- multiply: 3.29E-02 # pulse/min -> W
- platform: tmp102
id: mystrom_temperature
name: "Internal temperature"
update_interval: 60s
entity_category: diagnostic
address: 0x48
on_value_range:
above: 80
then:
- switch.turn_off: mystrom_relay
total:
name: "Energy consumption"
unit_of_measurement: "kWh"
device_class: "energy"
state_class: "total_increasing"
accuracy_decimals: 3
filters:
- multiply: 5.48E-07 # pulses -> kWh
- platform: duty_time
id: continuous_on_time
name: Continuous on time
lambda: "return id(mystrom_relay).state;"
accuracy_decimals: 0
- platform: tmp102
id: mystrom_temperature
name: "Internal temperature"
update_interval: 60s
entity_category: diagnostic
address: 0x48
on_value_range:
above: 80
then:
- switch.turn_off: mystrom_relay
- platform: duty_time
id: continuous_on_time
name: Continuous on time
lambda: "return id(mystrom_relay).state;"
accuracy_decimals: 0
switch:
- platform: gpio
name: None # Main entity for the device.
pin: GPIO27
id: mystrom_relay
restore_mode: RESTORE_DEFAULT_ON
device_class: outlet
on_turn_off:
- sensor.duty_time.reset: continuous_on_time
- platform: gpio
name: None # Main entity for the device.
pin: GPIO27
id: mystrom_relay
restore_mode: RESTORE_DEFAULT_ON
device_class: outlet
on_turn_off:
- sensor.duty_time.reset: continuous_on_time
- platform: gpio
# Exposing this as a switch rather than light to avoid
# automations and dashboard picking it up as illuminance
# source.
name: "Identify LED (white)"
restore_mode: ALWAYS_OFF
pin:
number: GPIO17
inverted: true
- platform: gpio
# Exposing this as a switch rather than light to avoid
# automations and dashboard picking it up as illuminance
# source.
name: "Identify LED (white)"
restore_mode: ALWAYS_OFF
pin:
number: GPIO17
inverted: true
+4 -4
View File
@@ -1,5 +1,5 @@
button:
- platform: restart
name: "ESP chip restart"
entity_category: diagnostic
id: restart_button
- platform: restart
name: "ESP chip restart"
entity_category: diagnostic
id: restart_button
+5 -5
View File
@@ -1,6 +1,6 @@
binary_sensor:
- platform: template
name: "ESP chip clock invalid"
lambda: 'return !id(sntp_time).now().is_valid();'
entity_category: diagnostic
device_class: problem
- platform: template
name: "ESP chip clock invalid"
lambda: "return !id(sntp_time).now().is_valid();"
entity_category: diagnostic
device_class: problem
+33 -33
View File
@@ -23,9 +23,9 @@ esphome:
version: "5.0"
on_boot:
priority: 600 # Default; most sensors set up, no network yet.
priority: 600 # Default; most sensors set up, no network yet.
then:
- script.execute: cc2652_reset
- script.execute: cc2652_reset
packages:
device_base: !include esp32-poe.yaml
@@ -38,38 +38,38 @@ external_components:
- source: github://oxan/esphome-stream-server
script:
- id: fw_update_mode
then:
- switch.turn_on: zBSL
- delay: 1s
- switch.turn_on: zRST_gpio
- delay: 1s
- switch.turn_off: zRST_gpio
- logger.log: "Delaying ~10 seconds for cc2652 to settle"
- delay: 11s
- switch.turn_off: zBSL
- logger.log: "Please try update with cc2538-bsl tool now"
- logger.log: "cc-bsl usage: cc2538-bsl.py -p socket://ip-of-gw:6638 -evw firmware.hex"
- id: fw_update_mode
then:
- switch.turn_on: zBSL
- delay: 1s
- switch.turn_on: zRST_gpio
- delay: 1s
- switch.turn_off: zRST_gpio
- logger.log: "Delaying ~10 seconds for cc2652 to settle"
- delay: 11s
- switch.turn_off: zBSL
- logger.log: "Please try update with cc2538-bsl tool now"
- logger.log: "cc-bsl usage: cc2538-bsl.py -p socket://ip-of-gw:6638 -evw firmware.hex"
- id: cc2652_reset
then:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
- id: cc2652_reset
then:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
button:
- platform: template
name: "ZigBee Module reset"
disabled_by_default: true
id: zRST
on_press:
- script.execute: cc2652_reset
- platform: template
name: "ZigBee Module reset"
disabled_by_default: true
id: zRST
on_press:
- script.execute: cc2652_reset
- platform: template
name: "ZigBee Module enter programming mode"
disabled_by_default: true
on_press:
- script.execute: fw_update_mode
- platform: template
name: "ZigBee Module enter programming mode"
disabled_by_default: true
on_press:
- script.execute: fw_update_mode
stream_server:
uart_id: uart_bus
@@ -78,6 +78,6 @@ stream_server:
buffer_size: 4096
binary_sensor:
- platform: stream_server
connected:
name: "ZigBee Module serial stream connected"
- platform: stream_server
connected:
name: "ZigBee Module serial stream connected"
+2 -2
View File
@@ -1,3 +1,3 @@
sensor:
- platform: uptime
name: "ESP chip uptime"
- platform: uptime
name: "ESP chip uptime"
+15 -15
View File
@@ -1,21 +1,21 @@
sensor:
- platform: wifi_signal
name: "ESP chip WiFi signal"
- platform: wifi_signal
name: "ESP chip WiFi signal"
text_sensor:
- platform: wifi_info
mac_address:
name: "ESP chip MAC"
icon: mdi:wifi-cog
ip_address:
name: "ESP chip IP"
icon: mdi:wifi-cog
bssid:
name: "ESP chip connected to BSSID"
icon: mdi:wifi-settings
filters:
- to_upper
- substitute: !secret wifi_ap_lookup
- platform: wifi_info
mac_address:
name: "ESP chip MAC"
icon: mdi:wifi-cog
ip_address:
name: "ESP chip IP"
icon: mdi:wifi-cog
bssid:
name: "ESP chip connected to BSSID"
icon: mdi:wifi-settings
filters:
- to_upper
- substitute: !secret wifi_ap_lookup
wifi:
ssid: !secret wifi_ssid