I have used the ESPHome example YAML for a SonOff Mini R4 Extreme and have it working as below in Home Assistant.
The sensor appears to always read as off. Compare above with below,
However, when I click on S1 it appears that the state does change, it just does not indicate it in the text.
Given that the reply shows on or off, what is the point of the sensor?
substitutions:
device_name: smartswitch-front-door
esphome:
name: ${device_name}
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret ekey-sw-frontdoor
ota:
- platform: esphome
password: !secret ota-sw-frontdoor
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
sensor:
- platform: wifi_signal
name: ${device_name} Wifi Signal Strength
update_interval: 90s
entity_category: "diagnostic"
- platform: uptime
name: ${device_name} Uptime
update_interval: 300s
entity_category: "diagnostic"
text_sensor:
- platform: wifi_info
ssid:
name: Connected SSID
ip_address:
name: IP Address
dns_address:
name: DNS Address
esp32_ble_tracker:
scan_parameters:
# interval: 1100ms
# window: 1100ms
active: true
bluetooth_proxy:
active: true
#######################################
# Device specific Config Begins Below #
#######################################
status_led:
pin:
number: GPIO19
inverted: true
output:
# Physical relay on GPIO
- platform: gpio
pin: GPIO26
id: relay_1
light:
- platform: binary
id: light_1
name: ${device_name}
icon: mdi:ceiling-light-multiple-outline
restore_mode: restore_default_off
output: relay_1
binary_sensor:
- platform: gpio
pin: GPIO00
id: button
filters:
- invert:
- delayed_off: 50ms
on_press:
- light.toggle:
id: light_1
- platform: gpio
name: s1
pin: GPIO27
id: s1
filters:
- invert:
- delayed_off: 50ms
on_press:
then:
- light.turn_on:
id: light_1
on_release:
then:
- light.turn_off:
id: light_1
If not really necessary, how do I remove it and if it is necessary how do I get the text to change to reflect the switch state?