Open slarti123 opened 1 week ago
I guess I "solved" it myself. I'm far from an expert, so please let me know, if there are any mistakes.
To troubleshoot, I utilized the local configuration file and made adjustments to the YAML settings.
Changes Made YAML Configuration Updates:
substitutions: toggle_relay_1_on_touch: "true" # Enable Relay 1 on touch toggle_relay_2_on_touch: "false" # Disable Relay 2 on touch toggle_relay_3_on_touch: "false" # Disable Relay 3 on touch toggle_relay_4_on_touch: "false" # Disable Relay 4 on touch
- id: handle_release
mode: restart
parameters:
pos: int
then:
- if:
condition:
lambda: "return ${relay_count}==4;"
then:
- if:
condition:
lambda: "return pos <= 2;" # Touch Position 1 und 2
then:
- binary_sensor.template.publish:
id: touchfield_1
state: ON
- if:
condition:
lambda: "return pos >= 3 && pos <= 4;" # Touch Position 3 und 4
then:
- binary_sensor.template.publish:
id: touchfield_2
state: ON
- if:
condition:
lambda: "return pos >= 6 && pos <= 7;" # Touch Position 6 und 7
then:
- binary_sensor.template.publish:
id: touchfield_3
state: ON
- if:
condition:
lambda: "return pos >= 9 && pos <= 10;" # Touch Position 9 und 10
then:
- binary_sensor.template.publish:
id: touchfield_4
state: ON
binary_sensor:
platform: template name: "Touchfield 1" id: touchfield_1 on_press:
- if: condition: lambda: "return ${toggle_relay_1_on_touch};" then:
- switch.toggle: relay_1
- delay: ${button_on_time}
- binary_sensor.template.publish: id: touchfield_1 state: OFF
- script.execute: refresh_led_default
platform: template name: "Touchfield 2" id: touchfield_2 on_press:
- if: condition: lambda: "return ${toggle_relay_2_on_touch};" then:
- switch.toggle: relay_2
- delay: ${button_on_time}
- binary_sensor.template.publish: id: touchfield_2 state: OFF
- script.execute: refresh_led_default
Similar updates for Touchfield 3 and 4...
Hope, that helps
Description: I am currently using a Sonoff TX Ultimate (T5-4C-86, with 4 relays) configured with ESPHome. When I press any of the physical touch buttons on the device, the relays are not toggling as expected. Instead, each press only activates the vibration motor, regardless of which button is pressed.
However, when I control the relays through the Home Assistant GUI (e.g., switch.tx_ultimate_5_tx_ultimate_51_l1), the relays toggle correctly.
Steps to Reproduce:
Logs: Here is the ESPHome log output when I press each touch button from left to right:
The Home Assistant logbook shows the following:
What I Expect:
What Happens:
Additional Information:
Request:
Thank you in advance for your help!