joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
857 stars 187 forks source link

[Feature Request] Buttons -/+ for light dimming #1088

Open Danlymp opened 7 months ago

Danlymp commented 7 months ago

I'm unfortunately not an expert, but I managed to get the nspanel running. I think it's the best solution for customizing the Panel. As the Panels are at a rather inconvenient hight replacing classic switches, I was wondering if it possible to kind of 'activate' -,+ Buttons instead of sliders for dimming/changing temperature of lights maybe with adjustable steps (kind of like the Thermo card). Mostly lights start at a predefined brightness so it's mostly to dim them up or down.

An a question: I'm sure that the panel was returning to the 'home screen' (gridCard navigating to hiddenCards) once turning off. Now it stays at the last hidden Card when touching the Screensaver.

joBr99 commented 7 months ago

You can configure a defaultCard, this way the panel will always return to the configured card.

Danlymp commented 7 months ago

Thanks for the fast response! Just a last question. Is there a documentation how to uncouple the buttons in ESP?

joBr99 commented 7 months ago

I'm not an esphome user, so I cannot tell you want you need to configure, but I would guess that you have to remove the onclick from the config.

https://github.com/sairon/esphome-nspanel-lovelace-ui/blob/dev/examples/basic-config.yml#L32C15-L32C15

nitropiet commented 6 months ago

Here is some code which I use in ESPHome to uncouple relay 1 (but still switch it as a backup) and have relay 2 switch and also sent a trigger signal:

binary_sensor:
  - platform: gpio
    name: $device_name Left Button
#    internal: true
    pin:
      number: 14
      inverted: true
    on_click:
# simple mode      
#      - switch.toggle: relay_1
#relay fallback mode
      if:
        condition:
          not:
            api.connected:
        then:
          - switch.toggle: relay_1

  - platform: gpio
    name: $device_name Right Button
    #internal: true
    pin:
      number: 27
      inverted: true
    on_click:
      - switch.toggle: relay_2