Giter Site home page Giter Site logo

smarthome-yourself / sonoff-tx-ultimate-for-esphome Goto Github PK

View Code? Open in Web Editor NEW
84.0 84.0 34.0 69 KB

ESPHome Custom Component for Sonoff TX Ultimate

Home Page: https://smarthomeyourself.de/sonoff-tx-ultimate-mit-esphome-custom-component/

License: MIT License

Python 30.45% C++ 69.55%
esphome esphome-component smart-home sonoff

sonoff-tx-ultimate-for-esphome's People

Contributors

danielscheidler avatar shonp40 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonoff-tx-ultimate-for-esphome's Issues

Invalid encryption key

i get this error. even if I delete the key api, and note, it asks me for the key once flashed

“ERROR Error auth result: Error: Authentication invalid. Is the password correct?”

this is the log:

INFO ESPHome 2024.2.0
INFO Reading configuration /config/esphome/tx-ultimate.yaml…
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
WARNING GPIO15 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
INFO Detected timezone ‘Europe/Madrid’
INFO Detected timezone ‘Europe/Madrid’
INFO Starting log output from 192.168.2.167 using esphome API
INFO Successfully connected to tx-ultimate @ 192.168.2.167 in 0.051s
WARNING tx-ultimate @ 192.168.2.167: Connection error occurred: tx-ultimate @ 192.168.2.167: Invalid encryption key: received_name=tx-ultimate
WARNING Can’t connect to ESPHome API for tx-ultimate @ 192.168.2.167: Error while finishing connection: Finishing connection cancelled due to fatal exception: tx-ultimate @ 192.168.2.167: Invalid encryption key: received_name=tx-ultimate: received_name=None (InvalidEncryptionKeyAPIError)

any idea?

Edit. Its solved flashing with espflasher insted of chrome
ty !!

auto nightlight , led indicator

there's a way to disable the auto turn on off the nightlight after sunset ?

the led indicator of the switches not on the right place...

image

green - how the LED probebly should be
red: how it is

this is the 120mm box 3 gang
can I fix it ?

tx_ultimate_cover.yaml - Wrong cover brightness after swipe right

I just implemented the TX Ultimate with 2 buttons as cover control in four rooms with customized nightlight and cover brightness. Awesome! :)

But especially in the bed room I noticed, that the pretty dim cover position LEDs I specified light up with nearly full brightness after a swipe from left to right, which I used to control the night light in the bath with a sleep timer.

I studied the script tx_ultimate_cover.yaml a bit and found out that the cover brightness restoriation is missing at the end of script "led_on_swipe_right". I tried it out locally and with this change it works like intended:

  - id: led_on_swipe_right
    mode: restart
    then:
      - light.turn_on:
          id: leds_right
          brightness: ${swipe_right_brightness}
          red: !lambda "return id(swipe_right_color)[0]/100.0;"
          green: !lambda "return id(swipe_right_color)[1]/100.0;"
          blue: !lambda "return id(swipe_right_color)[2]/100.0;"
          effect: ${swipe_right_effect}
      - delay: 2.4s
      - light.turn_on:
          id: leds_right
          brightness: ${cover_brightness}  # This is missing!
          effect: "Cover Position"

I haven't looked into the other scripts, but maybe it's also missing there as well.

Enhancement ? Dimmer function

I can't yet work out how to detect the start of a button press, I think I just see the binary sensor you've created toggle on release.

Am I missing some understanding ?

I am hoping that if I can see the start of a button press I can cycle through brightness levels until the button is released.

NeoPixel and nightlight

Hello,

I'm wondering if what i'm observing is the intended behaviour of the wall switch.

When I turn the NeoPixel light on and then push one of the touchfields, the light is turned off.
In home assistant the entity is still shown as on.
I've seen this happening in 3 different devices, with 1 and 2 channels

When i do the same thing with the nightlight, the light doesn't turn off, but it dims and returns to full brightness 2 seconds later.

I'm thinking this may happen because of the light effects on touch, multi touch, etc. that are overriding the neopixel light.
I made all effect brightnesses 0 so as to not have any effects, is there any more appropriate way to do have no effects?

Thank you.

Ajustments for US version?

The US version has a rectangle shape instead of a square shape... What do we need to update to make the LEDs work nicely?
For example, at the moment the leds that light up do not correspond with the toch area on my 3 gang switch...

Vibration on touch

Hi,

with the current configuration, the vibration starts after releasing the finger. Is it possible to have it on touch, like the original firmware?

Thank you for your outstanding work!
Have a good one!

T5-1C-120 32leds 1 relais

I've rectangular model of Tx Ultimate and I need of firmware for mine, that has 32 leds and not 28, only 1 relais.Anyone could has it? Thx!

Esphome update 2023.12.5

Good day all,

Has anyone had a problem with the touch panel stop working after updating to 2023.12.5 (might have been after 2023.12.4 as I think I skipped it) ?

Move touch event to release event

Firstly, thats for writing this config. I couldnt have done this without it. This is more of a suggestion and tell me if ive done this wrong "issue" rather than anything wrong with your config

I have noticed that the touch events for a single button are fired before a swipe event causing confusion on use. E.g if i swipe from left to right, the button press animation starts, then the swipe starts.

I have played around with you config and have managed to move the animations from on_press into on_release.

Effectively, on_press does nothing, and actions for led_on_touch is moved into handle_release. This might not be an issue with the default rainbow config, but I have a custom swipe left/right animation and split a led action between the 3 buttons and they were overlapping.

This basically, has the leds above the buttons turn on, but only if a press is detected. A swipe will run the swipe animation instead of running the touch events

Changes made

Remove on_press action

Add swipe animation to leds_top:
(havnt figured out how to take the variable colors into this lambda)

      - addressable_lambda:
          name: "Scan Right"
          update_interval: 50ms
          lambda: |-
            static uint16_t progress = 0;
            static Color normal = Color(255, 65, 206);
            
            if (initial_run) {
              progress = 0;
              it.all() = Color::BLACK;
            }
            else {
              //progress 1 led
              if (progress < it.size()) {
                it[progress] = normal;
                            
                progress++;
              }
              //When reach the end stop
              else {
              }
            };
      - addressable_lambda:
          name: "Scan LEFT"
          update_interval: 50ms
          lambda: |-
            static uint16_t progress = 0;
            static Color normal = Color(255, 65, 206);
            
            if (initial_run) {
              progress = 0;
              it.all() = Color::BLACK;
            }
            else {
              //progress 1 led
              if (progress < it.size()) {
                it[it.size() - progress] = normal;
                progress++;
              }
              //When reach the end stop
              else {
              }
            };

Added more led partitions for individual top buttons:

  - platform: partition
    id: leds_top_left
    internal: true
    effects:
      - addressable_rainbow:
    segments:
      - id: leds
        from: 20
        to: 22
  - platform: partition
    id: leds_top_middle
    internal: true
    effects:
      - addressable_rainbow:
    segments:
      - id: leds
        from: 22
        to: 24
  - platform: partition
    id: leds_top_right
    internal: true
    effects:
      - addressable_rainbow:
    segments:
      - id: leds
        from: 24
        to: 26

add to the top of handle_release "then" section:

      - if:
          condition:
            lambda: "return pos <= 3;"
          then:
            - script.execute: button_left_touch
          else:
            - if:
                condition:
                  lambda: "return pos <= 7;"
                then:
                  - script.execute: button_middle_touch
                else:
                  - script.execute: button_right_touch

New button scripts:

  - id: button_left_touch
    mode: restart
    then:
      - light.turn_on:
          id: leds_top_left
          brightness: ${touch_brightness}
          red: !lambda "return id(touch_color)[0]/100.0;"
          green: !lambda "return id(touch_color)[1]/100.0;"
          blue:  !lambda "return id(touch_color)[2]/100.0;"
          effect: ${touch_effect}

  - id: button_middle_touch
    mode: restart
    then:
      - light.turn_on:
          id: leds_top_middle
          brightness: ${touch_brightness}
          red: !lambda "return id(touch_color)[0]/100.0;"
          green: !lambda "return id(touch_color)[1]/100.0;"
          blue:  !lambda "return id(touch_color)[2]/100.0;"
          effect: ${touch_effect}

  - id: button_right_touch
    mode: restart
    then:
      - light.turn_on:
          id: leds_top_right
          brightness: ${touch_brightness}
          red: !lambda "return id(touch_color)[0]/100.0;"
          green: !lambda "return id(touch_color)[1]/100.0;"
          blue:  !lambda "return id(touch_color)[2]/100.0;"
          effect: ${touch_effect}

Flaschen funktioniert nicht esp bleibt im bootloop

Hallo zusammen ich bin mitlerweile komplett ratlos. Immer wenn ich versuche esphome auf meinen Sonoff Ty ultimate Flasche funktoert das ohne Probleme (wie im Video nur über esphomeflsher. Aber dieser baut keine Verbindung mit dem Internet oder sonstiges auf auch kein Hotspot. Im seriellen Monitor habe ich jedoch ein bootloop von dieser "Fehler" Meldung. Hatt irgendwer eine Idee ich bin komplett ratlos. Der Boot "Knopf" ist den ganzen Flash Durchgang gedrückt.

image

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 153911750, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5828 entry 0x400806ac [I][logger:262]: Log initialized [C][ota:469]: There have been 2 suspected unsuccessful boot attempts. [D][esp32.preferences:114]: Saving 1 preferences to flash... [D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed [I][app:029]: Running through setup()... [C][uart.arduino_esp32:077]: Setting up UART... [C][switch.gpio:011]: Setting up GPIO Switch 'Kammer Lichtschalter Vibration'... [C][switch.gpio:011]: Setting up GPIO Switch 'PA Power'... [C][switch.gpio:011]: Setting up GPIO Switch 'touch panel power'... [C][switch.gpio:011]: Setting up GPIO Switch 'Kammer Lichtschalter L1'... [C][switch.gpio:011]: Setting up GPIO Switch 'Kammer Lichtschalter L2'... [C][switch.gpio:011]: Setting up GPIO Switch 'Kammer Lichtschalter L3'... [C][i2s_audio:024]: Setting up I2S Audio... [I][log:012]: Tx Ultimate Touch is initialized [C][wifi:038]: Setting up WiFi... [C][wifi:048]: Starting WiFi... [C][wifi:049]: Local MAC: 54:43:B2:71:98:8C ets Jul 29 2019 12:21:46

4 Relays version

Hello,
thanks for the great work!

I'm tinkering with the 120-4 Relays EU version, and I figured out to enable the 4th channel touch on the yaml.

FYI, touch positions are mapped as follows:
Touch 1: pos 1,2
Touch 2: pos 3,4,5
Touch 3: pos 6,7,8
Touch 4: pos 9,10

LEDS are 32.
Top side: from 31 to 8
Right side: from 9 to 14
Bottom side: from 15 to 24
Left side: from 25 to 30

Having four buttons, the mapping of scripts with button_left, middle, right will need a renaming maybe.
It will be great if you will like to support this device version.
All the best

Sound volume too low

Hi,

I noticed you managed to have sound playing in the Sonoff, but the sound is too low volume, even with volume at max settings in home assistant.

Sonoff's promo videos mention alarm siren as a use case, which was my need, is there anything that can be done to increase the sound volume further (maybe some config i missed)?

Thank you.

A kind of bug with vibro

Hi there!

I installed ESPHome firmware in my sonoff tx-ultimate switch and tonight I faced a bug when vibro started working instantly and switch couldn't work properly (nothing happend when I touched it).

Sound of vibro was like when I first time flashed this firmware into module.

What could it be? I thought that it couldn't connect to HomeAssistant (I powered off it for the night) and it sarted to rollback the firmware to last version? I don't know if it can do such operation, could it?

If it happens one more time, I will try to record a video. Anyway, I need know what it could be and how to fix it, because waking up every night doesen't sound good))

Waiting for somebodies answer!

"long press" funktioniert nicht

Hallo Daniel,

zunächst möchte ich erst einmal sagen, dann du hier ein echt super Projekt durchgeführt hast!
Ich bin total begeistert :-)
Leider funktioniert bei mit "long_press" nicht. Ich habe die minimale Konfiguration genutzt.
Alles anderen Funktionen sind prima. Gibt es für die Funktion "long_press" etwas Bestimmtes oder Wichtiges
zu beachten?

Viele Dank und Grüße
Detlef

Sound Fix

Hey and thank you for this great component.
You mentioned, that you will add the audio fix, when it is available.
As it is available, are there plans to implement it?
KR

Template for sonoff-tx ultimate 2 relay for COVER

Discussed in #4

Originally posted by kroon040 June 9, 2023
Is it possible to have the config made for to use with covers. It should be nice to use it swipe left to right closes and from right to left opens and stop multitouch, and some led colors them moving.

Any idea for a config|?

Perhaps use LEDs on one side, to show position of the cover?

ble proxy

I want to use my tx for the bluetooth proxy functionality, but:
Error: The program size (1941981 bytes) is greater than maximum allowed (1835008 bytes)

How can inprove the size of the overall firmware?, I have 1 gang switch, nothing connected to the relay, but i want to know with part of the touchpanel is used.
I already try to comment some features like logger, but without success.

Status Lights auto off

Thank you for the great work, everything works really well so far.
But now that I have a TX Ultimate in the bedroom, I would like to be able to switch off the cover status LEDs on the right-hand side.
I would like the status to be displayed when the cover is moving and all LEDs to switch off after a certain time when it has stopped. Perhaps it would also be possible to display the status on both sides when the cover is moving?
Is there a simple way to implement this?

Thank you and best regards

Light Status - Leds: Top instead of Button

What would be the best approach to have the led on the top turn on, when the light is on - instead of the led on the button?
It would be more easy to see the state of a light: on/off.

I imagine it has to do with the scripts: led_on_button_left/led_off_button_left, led_on_button_middle/led_off_button_middle and led_on_button_right/led_off_button_right...

edit:
Hmmm... initially I thought it would only be needed to change the specific led in partition:

  - platform: partition
    name: "LEDs Button left"
    id: leds_button_left
    internal: true
    segments:
      - id: leds
        from: 11 #to 21
        to: 11 #to 21

But that only make the specific led "21" blink and turn off. Could it be a conflict with the script that turns on the top leds, sequentially, and off, when the button is pressed?

Swipe up and down triggers

Is it possible to have a swipe up/down trigger? I would like to experiment with the utlimate, to control not only the lights in the room, but jelousies as well. The idea is to swipe up to start opening the blinds, swipe down to start closing them, a swipe left/right would adjust the angle and a multitouch could stop whatever motion is active.

I tried understanding the code, but I just don't have the info how the data arrives from the touch sensor. Is there a y coordinate somewhere? Could you point me to a description of the data structure the touch sensor sends?

Great work, I really appretiate it!

How to wire the TX Ultimate as one of 3 way stairs light switch?

Hi,
I have 3-way stair light switch and I want to replace one of them with my flashed TX Ultimate 3C.

There is a one unrelated light switch (1,2) which I know how to wire but I need help with cable 3,4,5 from the picture.
Neutral is available and clear where to connect.

image

Thanks.

nightlight cannot be turned off

First of all thanks for your great work. I bought 8 switches after I found your integration and I am very happy with them.

However I have one issue with nightlight:
Generally I have nightlight turned off in my yaml code (nightlight: "off") and control the nightlight via home assistant automations.
So the nightlight is tuned on and off at a certain times or events.
However turning off e.g. in the morning fails regularly. In HA the switch shows off but some of the switches still have the nightlight on.
Sometimes 5 of 5 fail and sometimes only 2 of 5. I am not able to find any correlation.
Also switching the nightlight on/off in HA does not fix this, the nightlight stays on.
A reboot of the switch makes them controllable again.

Do you guys have any idea what could be the issue?

Thanks in advance!

esphome/components/binary_sensor/binary_sensor.h: No such file or directory

I got an error message:

Compiling .pioenvs/txultimate-livingroom-front/src/esphome/components/tx_ultimate_touch/tx_ultimate_touch.cpp.o
In file included from src/esphome/components/tx_ultimate_touch/tx_ultimate_touch.cpp:2:
src/esphome/components/tx_ultimate_touch/tx_ultimate_touch.h:7:10: fatal error: esphome/components/binary_sensor/binary_sensor.h: No such file or directory
 #include "esphome/components/binary_sensor/binary_sensor.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pioenvs/txultimate-livingroom-front/src/main.cpp.o
In file included from src/esphome.h:77,
                 from src/main.cpp:3:
src/esphome/components/tx_ultimate_touch/tx_ultimate_touch.h:7:10: fatal error: esphome/components/binary_sensor/binary_sensor.h: No such file or directory
 #include "esphome/components/binary_sensor/binary_sensor.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I simply commented out the respective line:

image

and it worked.

ESPhome 2023.8.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.