Open nwithan8 opened 1 year ago
I have the same problem. Also it shows always the status 'hdmi2'. Even if I press the button manually on the device to switch the inputs.
@nwithan8 and @ildar7070 -- Connect a wire from the ground pin on your ESP board to ground on the HDMI switch. I used one of the HDMI port lugs. Note that I also switched the "DAT" connection from D4 to D1, as my ESP board didn't seem like having that pin pulled low during boot.
See attached image:
I changed the board type and pin numbers to match my particular board/connections:
esphome:
name: esphome-web-d739ff
friendly_name: hdmi-switch
esp8266:
board: d1_mini_lite
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxx"
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-xxxxxx"
password: "xxxxxxxxxxxx"
captive_portal:
output:
- platform: gpio
pin:
number: D2
inverted: true
id: 'output_toggle'
button:
- platform: output
name: "Toggle HDMI Port"
output: 'output_toggle'
duration: 500ms
binary_sensor:
- platform: gpio
name: "HDMI Port Status"
id: hdmi_pin
internal: true
pin: D1
publish_initial_state: true
on_state:
then:
- lambda: !lambda |-
if (id(hdmi_pin).state) {
id(hdmi_port).publish_state("hdmi2");
} else {
id(hdmi_port).publish_state("hdmi1");
}
text_sensor:
- platform: template
id: hdmi_port
name: "HDMI Port"
This did the trick for me. Thank you for providing help on this. I think we can close this issue
I'm still having a problem with this if anyone can help me, It keeps jumping back to the same port. Ive tried adding the connection between the GND pin and a lug on the HDMI and this just stops the device from functioning alltogether, it seems to set the LOLIN D1 into flash mode. Any help would be grately appreciated.
I'm still having a problem with this if anyone can help me, It keeps jumping back to the same port. Ive tried adding the connection between the GND pin and a lug on the HDMI and this just stops the device from functioning alltogether, it seems to set the LOLIN D1 into flash mode. Any help would be grately appreciated.
If connecting the grounds together makes the esp8266 go into flash mode, you have connected something wrong. Make sure you didn't connect pin D3 to anything.
Everytime I hit the "Toggle" button, it switches between the two ports in rapid succession, rather than staying on the next port.
Logs via ESPHome: