libretiny-eu / upk2esphome

Automatically generate ESPHome YAML for Tuya IoT devices
https://upk.libretiny.eu/
MIT License
17 stars 4 forks source link

LSC - 3004200 WiFi Outdoor Dual Socket *Working Config* #2

Open Sn00kiT opened 1 year ago

Sn00kiT commented 1 year ago

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
kuba2k2 commented 1 year ago

Is it different than the one generated by UPK? Did the UPK config have any problems?

Sn00kiT commented 1 year ago

Is it different than the one generated by UPK? Did the UPK config have any problems?

The YAML generated in UPK does only have the basic config and no GPIO´s associated. When using this the device simply does not have any functions, other than having one binary sensor for the button