Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance config options #332

Merged
merged 31 commits into from
May 10, 2024
Merged

Enhance config options #332

merged 31 commits into from
May 10, 2024

Conversation

iranl
Copy link
Collaborator

@iranl iranl commented Mar 29, 2024

  • Add every config and advanced config option to MQTT (JSON)
  • Separate config state from config actions in MQTT (same as lockstate/action and keypad codes/action)
  • ACL for every separate config option
  • Make some config/advanced config options more human readable
  • Allow modifying every config and advanced config option through MQTT
  • Modify existing config Home Assistant auto discovery topics
  • Add new config Home Assistant auto discovery topics
  • Update README
  • Enable/disable all button for ACL options in WebCfg
  • Final minor adjustments and testing
  • Update Arduino Core to 2.0.15 (won't build otherwise using Actions/Dockerfile)

NOTE: Breaking change as the existing configuration MQTT topics can not be used for changing settings if this is merged.

Closes #327

commit ea34708
Merge: e14877b 1dcef13
Author: Jan-Ole Schümann <j.o.schuemann@gmx.de>
Date:   Tue Mar 26 20:16:00 2024 +0700

    Merge pull request technyon#328 from iranl/ha-fixes

    Multiple fixes (Nuki ID + README + ACL + DoorSensor/Keypad)

commit 1dcef13
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 24 22:28:44 2024 +0100

    Add extra checks and auto retries

commit 56d718b
Author: iranl <iranl@users.noreply.github.com>
Date:   Sat Mar 23 19:52:50 2024 +0100

    Remove Force options

commit a3658bf
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 17 22:57:24 2024 +0100

    Update README.md

commit ef7fe75
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 17 22:50:46 2024 +0100

    Update WebCfgServer.cpp

commit ac375df
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 17 22:47:42 2024 +0100

    Redact Nuki ID

commit 516af39
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 17 22:40:22 2024 +0100

    ACL Info WebCfg + Force Keypad/DoorSensor

commit 3db4c06
Author: iranl <iranl@users.noreply.github.com>
Date:   Sun Mar 17 21:59:57 2024 +0100

    Nuki ID + README + ACL fix
@iranl iranl force-pushed the separate-config branch 9 times, most recently from f511163 to f8c8db7 Compare April 1, 2024 19:45
@iranl iranl force-pushed the separate-config branch 6 times, most recently from ee2497a to 2af1fbd Compare April 3, 2024 22:26
@iranl
Copy link
Collaborator Author

iranl commented Apr 4, 2024

@technyon This PR needs the most recent changes in I-Connect/NukiBleEsp32. Can you sync nuki_ble with upstream?

@technyon
Copy link
Owner

technyon commented Apr 6, 2024

Hi,

Sorry I didn't see your comment. nuki_ble is now updated.

One more thing: Since there are breaking changes in this PR, could we have a discussion on discord? Not that I'm against it, I'd just like to hear some more opinions.

@iranl iranl force-pushed the separate-config branch 4 times, most recently from 47fc663 to 01a294b Compare April 26, 2024 18:40
@katiuskt
Copy link

katiuskt commented May 1, 2024

Apologies if this is not the place to ask this but testing the 8.34pre4 release in a AtomS3 Lite + Atom PoE and configured as follows:
imagen
it looks like the wifi fallback is being used: MAC does not change in router; if I check the option "Disable fallback to Wi-Fi / Wi-Fi config portal" I lost access completely; and:

Nuki Hub version: 8.34-pre-4
(...)
Network device: Built-in Wi-Fi

Same M5Stack Atom POE but with an Atom Lite (not S3 Lite) with 8.33 works fine (connectivity is done by ethernet if configured so)

Based on this snap from their store
imagen
I would expect Atom PoE working for both Atom and AtomS3 but taking a closer look, the pinout of the S3Lite (G5/G6/G7/G8/G38/G39) is different from the non-S3 (G19/G21/G22/G23/G25/G33). 5V and GND remain in the same place.
So not sure if this is something it could be managed in code somehow to get the M5Stack Atom PoE working also with the AtomS3 Lite or maybe things are not so easy or completely unrelated with nukihub could handle.

Thanks!

@iranl
Copy link
Collaborator Author

iranl commented May 2, 2024

@katiuskt: I've pushed an update to the W5500 code to change the pinout for the AtomPOE on the S3 to 5/7/8/39 instead of 19/22/23/33

Can you try esp32-s3-assets.zip?
Note: Will still show 8.34-pre4

@iranl iranl mentioned this pull request May 2, 2024
@katiuskt
Copy link

katiuskt commented May 2, 2024

Thanks @iranl . OTA updated to that new version but unfortunately, nothing changed: connectivity remains by wifi. Turned off/on PoE to restart (just in case it would be necessary) didn't help either.
Not sure if there are some logs or something I could share (no idea how can this be debugged)

@iranl
Copy link
Collaborator Author

iranl commented May 3, 2024

I've taken a good look at the pinouts and it seems the following pinouts translate to the different models:

Func Atom S3 lite ESP32-S3 Atom lite ESP32
CLK 6 19
CS 5 22
MISO 7 23
MOSI 8 33

In my first try I assumed the pinout G5/G6/G7/G8/G38/G39 translated to G19/G21/G22/G23/G25/G33.

Please try esp32-s3-assets.zip

You can try debugging using the serial console with a program like hterm

@katiuskt
Copy link

katiuskt commented May 3, 2024

Thanks @iranl , it worked now!

A couple of "weird" things (not sure if expected):

  1. I had to turn off/on PoE and do several changes between Wifi-only and W5500 options before it worked properly.
  2. I expected the device to have the same MAC address it already had with the Atom Lite but it is not the case. I mean, expected the MAC to be linked to the Atom POE adapter so regardless the ESP32 attached to it (Atom Lite or Atom S3 Lite), I expected the MAC being the same. However it is not (and thus also the device name changes from "WIZnetXXYYZZ" to "WIZnetAABBCC").

Beyond those two observations (probably not relevant), S3 lite seems to be working fine. I'll do further tests next days, though, but really appreciated your work supporting the S3!! 🙌

UPDATE:
One suggestion related with the HA autodiscovery topics: Given the fact the reset command auto-resets to 0

maintenance/reset: Set to 1 to trigger a reboot of the ESP. Auto-resets to 0.

Wouldn't be a better choice to configure it as a "button" (https://www.home-assistant.io/integrations/button.mqtt/) rather than as a "switch"?
imagen

@iranl
Copy link
Collaborator Author

iranl commented May 3, 2024

Good to hear the Atom POE now works on the S3.

As for the maintenance/reset button I agree, this is also the way I have recently implemented the query buttons.
The choice to expose maintenance/reset through a switch was made a while ago and changing it would mean a breaking change for people using this switch in an automation. The pros of changing this behaviour don't outweigh the cons of a breaking change at this time in this case imho.

@iranl iranl force-pushed the separate-config branch 2 times, most recently from 92744a0 to e2ad4c0 Compare May 5, 2024 18:55
@technyon technyon merged commit 94a6f67 into technyon:master May 10, 2024
1 check passed
@iranl iranl deleted the separate-config branch May 11, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ring suppression
3 participants