NSPManager / NSPanelManager

Sonoff NSPanel custom firmware for responsive and intuitive use
https://nspanelmanager.com/
128 stars 10 forks source link

Physical buttons functionality! #30

Closed cablesandcoffee closed 1 year ago

cablesandcoffee commented 1 year ago

User should be able to choose what the physical buttons does.

User choices that I can think of:

  1. Use button to turn on and off panel relay = Kill power to light

  2. Bind room light to physical button. Similar to adding lights on room page.

  3. Maybe user wants neither 1 or 2. Give the option to add a switch for example.

cablesandcoffee commented 1 year ago

Relay 1 gpio 22 relay 2 gpio 19 Knapp vänster pin 14 (inverted true in ESPhome) Knapp höger pin 27 (inverted true in ESPhome)

tpanajott commented 1 year ago

Code now available to test for button and relays. Need to verify correct on/off state for relays.

Topics: nspanel/name/r1_cmd nspanel/name/r1_state nspanel/name/r2_cmd nspanel/name/r2_state

cablesandcoffee commented 1 year ago

Tested now. States are correct and buttons work. I can see the state topics in the mqtt log.

the cmd topics doesn't seem to work though.

I've tried sending 0 and 1 to nspanel/name/r1_cmd and nspanel/name/r2_cmd but nothing happens.

tpanajott commented 1 year ago

Just to be overly clear, did you change "name" to the name of the NSPanel?

cablesandcoffee commented 1 year ago

Yes I did. :)

tpanajott commented 1 year ago

I could indeed reproduce it here. I fixed a bug and it should now work!

tpanajott commented 1 year ago

1 and 2 should be fixed/work as of latest commit.

Maybe 3 can wait as that would require rewriting major things in the firmware and I see an opportunity to, at the same time, incorporate custom manually added MQTT entities to the mix. I propose that we close this issue (given that 1 & 2 works) and open a new one as an enhancement to the existing functionality?

cablesandcoffee commented 1 year ago

Cool! Sounds good, I'll open an enhancement!