-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fixed code of Smartnest and updated documentation #4001
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,41 @@ | ||
# Smartnest | ||
|
||
Enables integration with `smartnest.cz` service which provides MQTT integration with voice assistants. | ||
Enables integration with `smartnest.cz` service which provides MQTT integration with voice assistants, for example Google Home, Alexa, Siri, Home Assistant and more! | ||
|
||
In order to setup Smartnest follow the [documentation](https://www.docu.smartnest.cz/). | ||
- You can create up to 5 different devices | ||
- To add the project to Google Home you can find the information [here](https://www.docu.smartnest.cz/google-home-integration) | ||
- To add the project to Alexa you can find the information [here](https://www.docu.smartnest.cz/alexa-integration) | ||
|
||
## MQTT API | ||
|
||
The API is described in the Smartnest [Github repo](https://github.com/aososam/Smartnest/blob/master/Devices/lightRgb/lightRgb.ino). | ||
|
||
|
||
## Usermod installation | ||
|
||
1. Register the usermod by adding `#include "../usermods/smartnest/usermod_smartnest.h"` at the top and `usermods.add(new Smartnest());` at the bottom of `usermods_list.cpp`. | ||
or | ||
2. Use `#define USERMOD_SMARTNEST` in wled.h or `-D USERMOD_SMARTNEST` in your platformio.ini | ||
|
||
|
||
Example **usermods_list.cpp**: | ||
|
||
```cpp | ||
#include "wled.h" | ||
/* | ||
* Register your v2 usermods here! | ||
* (for v1 usermods using just usermod.cpp, you can ignore this file) | ||
*/ | ||
|
||
/* | ||
* Add/uncomment your usermod filename here (and once more below) | ||
* || || || | ||
* \/ \/ \/ | ||
*/ | ||
//#include "usermod_v2_example.h" | ||
//#include "usermod_temperature.h" | ||
#include "../usermods/usermod_smartnest.h" | ||
|
||
void registerUsermods() | ||
{ | ||
/* | ||
* Add your usermod class name here | ||
* || || || | ||
* \/ \/ \/ | ||
*/ | ||
//usermods.add(new MyExampleUsermod()); | ||
//usermods.add(new UsermodTemperature()); | ||
usermods.add(new Smartnest()); | ||
|
||
} | ||
``` | ||
1. Use `#define USERMOD_SMARTNEST` in wled.h or `-D USERMOD_SMARTNEST` in your platformio.ini (recommended). | ||
|
||
## Configuration | ||
|
||
Usermod has no configuration, but it relies on the MQTT configuration.\ | ||
Under Config > Sync Interfaces > MQTT: | ||
* Enable MQTT check box | ||
* Set the `Broker` field to: `smartnest.cz` | ||
* The `Username` and `Password` fields are the login information from the `smartnest.cz` website. | ||
|
||
* Enable `MQTT` check box. | ||
* Set the `Broker` field to: `smartnest.cz` or `3.122.209.170`(both work). | ||
* Set the `Port` field to: `1883` | ||
* The `Username` and `Password` fields are the login information from the `smartnest.cz` website (It is located above in the 3 points). | ||
* `Client ID` field is obtained from the device configuration panel in `smartnest.cz`. | ||
* `Device Topic` is obtained by entering the ClientID/report , remember to replace ClientId with your real information (Because they can ban your device). | ||
* `Group Topic` keep the same Group Topic. | ||
|
||
Wait `1 minute` after turning it on, as it usually takes a while. | ||
|
||
## Change log | ||
|
||
2022-09 | ||
* First implementation. | ||
* First implementation. | ||
|
||
2024-05 | ||
* Solved code. | ||
* Updated documentation. | ||
* Second implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this static const (or constexpr is better)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue to allow it to be just
unsigned
and use it as a run-time settable variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I better leave it like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to add configuration item like other usermods.