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

Feature request: Create switch/button in Home Assistant for restarting NUKI Hub #158

Closed
bcutter opened this issue Mar 28, 2023 · 9 comments

Comments

@bcutter
Copy link
Contributor

bcutter commented Mar 28, 2023

Can we have an out of the box switch (or button meanwhile) entity in Home Assistant for restarting the NUKI hub?


I had some situations where this was needed, physical access to the ESP was not possible and logging in to the web interface (open MQTT/network settings and click save to trigger restart) is only possible for me (due to the access protection) but still neither handy nor quickly.

Latest occurrence (which made me finally write this FR) by the way: SL died (Bluetooth died), pulled the battery. After that, NUKI hub did not reconnect automatically within few minutes - at least changing settings (LED off/on etc.) from HA had no effect on the SL. For that a quick restart sent from HA would just be perfect.

@bcutter bcutter changed the title Feature request: Create switch/button in HA for restarting NUKI Hub Feature request: Create switch/button in Home Assistant for restarting NUKI Hub Mar 28, 2023
@technyon
Copy link
Owner

Hi, you can already connect with MQTT explorer and trigger a reboot by setting the maintenance/reset node to 1.

@bcutter
Copy link
Contributor Author

bcutter commented Mar 28, 2023

OK that's good news - and a welcome prerequisite for the target of having an entity for that in HA.

Step 1: how to template this? (MQTT noob asking)

Step 2: why not making this button available out of the box?

@desheh
Copy link

desheh commented Mar 31, 2023

You can easily setup a button (trigger the "MQTT: Publish" service) that will publish an MQTT packet with topic: nuki/maintenance/reset with payload 1.

@bcutter
Copy link
Contributor Author

bcutter commented Mar 31, 2023

You can easily setup a button (trigger the "MQTT: Publish" service) that will publish an MQTT packet with topic: nuki/maintenance/reset with payload 1.

How?

To be precise: not talking bout a simple GUI button but a button.nuki_hub_restart entity.

If one could provide a full working example, that would be helpful I guess.

@benedikt-bartscher
Copy link

You can either template the button with Home Assistant (https://www.home-assistant.io/integrations/template/) manually or extend nuki_hub by adding mqtt autodiscovery for the button

@bcutter
Copy link
Contributor Author

bcutter commented Mar 31, 2023

Sorry, still no news - I'm really looking for a working example on how to achieve this.

@mundschenk-at
Copy link
Collaborator

mundschenk-at commented Apr 2, 2023

@bcutter I don't want to sound harsh, but you could just look that up in HA's MQTT documentation.

Anyway, here's a working configuration:

mqtt:
  button:    
    - name: "Restart Nuki Hub"      
      unique_id: <some unique ID>
      qos: 2      
      availability:        
        topic: "nuki/maintenance/mqttConnectionState"        
        payload_available: online        
        payload_not_available: offline      
      device:        
        identifiers: <your lock>
        device_class: restart      
        entity_category: config      
      payload_press: 1      
      command_topic: "nuki/maintenance/reset"

@technyon
Copy link
Owner

technyon commented Apr 4, 2023

Check Release 8.21.

@technyon technyon closed this as completed Apr 4, 2023
@bcutter
Copy link
Contributor Author

bcutter commented Apr 4, 2023

grafik

Veeeeery nice. Two new entites per NUKI hub! 🎉🥳

And the restart works like a charme. Thank you so much!

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

No branches or pull requests

5 participants