Git Product home page Git Product logo

upk2esphome's Introduction

upk2esphome

This website allows you to generate ESPHome YAML Configuration based on user_param_key parameters, used in many Tuya smart devices.

A live, web version is deployed on GitHub Pages at https://upk.libretiny.eu/.

Since v4.1.0, ltchiptool contains a GUI that can generate ESPHome configs (based on this program). It can also grab configuration data from ESPHome-Kickstart.

upk2esphome's People

Contributors

cossid avatar habbie avatar kuba2k2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

upk2esphome's Issues

Support for ADC-based ambient light sensor

Based on my tests (as I mentioned in libretiny-eu/libretiny#219), the mere existence of one of the keys: 'day', 'dusk', 'evenfall', 'evening' and 'night' suggest that there's an ADC-based ambient light sensor. There seem to be no configuration of ADC in UPK, but all of my 3 kind of lamps that have this use the same setup, which can be expressed in esphome yaml like this:

sensor:
  - platform: adc
    id: ambient
    name: Ambient
    unit_of_measurement: "V"
    state_class: "measurement"
    pin: P23

And the keys can be expressed as esphome select like this:

globals:
  - id: light_sensitivity
    type: int
    restore_value: no
    initial_value: '0'

select:
  - platform: template
    id: light_sensitivity_setting
    name: "Ambient light trigger"
    entity_category: config
    restore_value: yes
    options:
     - "Day"
     - "Dusk"
     - "Evenfall"
     - "Evening"
     - "Night"
    initial_option: "Evenfall"
    optimistic: true
    set_action:
      - logger.log:
          format: "Chosen option: %s"
          args: ["x.c_str()"]
    on_value:
      then:
        lambda: !lambda |-
          if (i == 1)
          {
            id(light_sensitivity) = 0.157f;
          }
          else
          if (i == 2)
          {
            id(light_sensitivity) = 1.800f;
          }
          else
          if (i == 3)
          {
            id(light_sensitivity) = 2.100f;
          }
          else
          if (i == 4)
          {
            id(light_sensitivity) = 2.180f;
          }
          else id(light_sensitivity) = 0.0f;

The above thresholds are taken from UPK itself of course.

My python knowledge is yet too basic to try the pull request, so I'm leaving this to someone else to try :)

WB3S Tuya 1 gang switch

Hi,

I have this type of gang switches, 1, 2 and 3 gang.
First one to test was 1 gang.

WhatsApp Image 2023-11-24 at 01 04 07_71505596

I used Tuya Generic ATS01L-US 1 gang Touch switch as it seemed more appropriate.
It works in terms of Status LED and blinkin WIFI led but it won't trigger the internal relay(switch)

Can somebody help me with the correct pin?

LSC - 3004200 WiFi Outdoor Dual Socket *Working Config*

Working Config for the LSC Dual Socket Outdoor Plug:

button:
- platform: restart
  name: Restart

debug:
  update_interval: 30s

switch:
- platform: gpio
  pin: P14
  name: "Relay #1 On"
  id: relay1
  interlock: [relay2]
#  internal: true
- platform: gpio
  pin: P26
  name: "Relay #2 Off"
  id: relay2
  interlock: [relay1]
#  internal: true

- platform: gpio
  pin: P9
  name: "Relay #3 On"
  id: relay3
  interlock: [relay4]
#  internal: true
- platform: gpio
  pin: P8
  name: "Relay #4 Off"
  id: relay4
  interlock: [relay3]
#  internal: true

- platform: template
  name: "Switch_Socket1"
  id: Socket_1
  optimistic : true
  turn_on_action:
    - switch.turn_off: relay2
    - switch.turn_on: relay1
  turn_off_action:
    - switch.turn_off: relay1
    - switch.turn_on: relay2
    
- platform: template
  name: "Switch_Socket2"
  id: Socket_2
  optimistic : true
  turn_on_action:
    - switch.turn_off: relay4
    - switch.turn_on: relay3
  turn_off_action:
    - switch.turn_off: relay3
    - switch.turn_on: relay4


text_sensor:
- platform: debug
  reset_reason:
    name: Reset Reason
- platform: libretiny
  version:
    name: LibreTiny Version

sensor:
- platform: uptime
  name: Uptime

binary_sensor:
- platform: gpio
  id: binary_switch_all
  pin:
    number: P7
    inverted: true
  on_press:
    then:
    - switch.toggle: Socket_1
    - switch.toggle: Socket_2

status_led:
  pin: P1

Working profile with calibrated power monitoring for BN-LINK BNC-60/U133TJ WiFi Heavy Duty smart plug

https://www.amazon.com/gp/product/B07CX5KLXN/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&th=1

esphome:
name: outlet
friendly_name: Outlet

bk72xx:
board: generic-bk7231t-qfn32-tuya

logger:
captive_portal:
mdns:
api:
ota:

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

text_sensor:

  • platform: libretiny
    version:
    name: LibreTiny Version

light:

  • platform: status_led
    id: light_switch_1
    pin:
    number: P6
    inverted: true

binary_sensor:

  • platform: gpio
    id: binary_switch_1
    pin:
    number: P10
    inverted: true
    mode: INPUT_PULLUP
    on_press:
    then:
    - switch.toggle: switch_1

switch:

  • platform: gpio
    id: switch_1
    name: Relay 1
    pin: P26
    on_turn_on:
    • light.turn_on: light_switch_1
      on_turn_off:
    • light.turn_off: light_switch_1

status_led:
pin:
number: P11
inverted: true

sensor:

  • platform: hlw8012
    model: BL0937
    cf_pin:
    number: P7
    inverted: true
    cf1_pin:
    number: P8
    inverted: true
    sel_pin:
    number: P24
    inverted: true
    current:
    name: BL0937 Current
    voltage:
    name: BL0937 Voltage
    power:
    name: BL0937 Power
    energy:
    name: BL0937 Energy
    voltage_divider: 870
    current_resistor: 0.002 ohm

Tuya device firmware read from WR3 can't be analyzed in UPK2ESPHome

Hi,

the firmware file for this humidifier device https://eurom.nl/en/product/climate-control/humidifiers/oasis-303-wifi/ (original manufacturer: https://www.globalsources.com/product/evaporator-humidifiers_1192004025f.htm ) is not readable in UPK2ESPHome. I never booted the device before reading the flash memory, so the file attached is original without any personal settings.

When I open the file in text editor I can see Tuya references and generally there's a lot of of readable text.
Luftbefeuchter ebay ltchiptool_ambz_2024-04-02_00-45-27.zip

Thanks,
Helge

device support

Hello,

I don't know it this is the place to ask, I was looking for some kind of Q&A page or message board but couldn't find any.
Are there plans to extend the device support to other devices as well?

there are 2 devices which I want to OTA flash, but I'm a little bit afraid I will kill the functionality if I don't know the config.
I'm especially interested in vacuum cleaner support. this makes use of datapoints over tx/rx instead of GPIO pins. So I don't even know if this is possible,

but the main question is, do you have plans to support more device types if possible?

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.