-
Notifications
You must be signed in to change notification settings - Fork 27
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
General refactoring #11
Open
santam85
wants to merge
24
commits into
giannello:master
Choose a base branch
from
santam85:main
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0564c75
Added forced devices type
santam85 4c310d0
Refactored subscriptions, implemented wind and rain, registration of …
santam85 4188029
Added USB lib source, upgraded dependencies for serial port, continue…
santam85 e1cf976
Create README.md
santam85 6b9b6ae
Add Docker GHA CI
santam85 93c170f
Remove i386 support
santam85 8a3fbd6
Add qEmu support
santam85 7049358
Trimmed dependencies
santam85 7062580
Update position of moving blinds
santam85 a73c89d
Add weather station to devices array
santam85 b216241
Send a string on MQTT
santam85 14876c7
Added docs
santam85 79163c0
Fix units of measurement
santam85 0a6aad9
Update README.md
santam85 3f6cefc
Added device 24
santam85 2398f53
Merge remote-tracking branch 'origin/main'
santam85 40963ba
Allow network discovery without MQTT config
santam85 201e084
Make sure online state is restored after possible disconnect.
santam85 d8abbf6
Retain position messages
santam85 b74210b
Comply to entity naming guidelines
santam85 440f399
has_entity_name: true
santam85 23cebcf
has_entity_name: true
santam85 0364da6
force name to null
santam85 a6220a7
Add stick
santam85 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# - name: Login to GitHub Container Registry | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.repository_owner }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push (standalone) | ||
uses: docker/build-push-action@v3 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
file: standalone.Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: | | ||
santam/wms-mqtt:latest | ||
# - name: Build and push (addon) | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=max | ||
# file: Dockerfile | ||
# platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
# push: true | ||
# tags: | | ||
# santam/wms-mqtt-addon:latest |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
node_modules | ||
*.log |
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
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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# addon-warema-wms | ||
|
||
This Home Assistant addon allows to control Warema WMS equipment. | ||
In order to use this addon you'll need a Warema WMS stick (https://www.warema.com/en/control-systems/radio-systems/supplementary-components/) | ||
|
||
### Installation | ||
### Configuration | ||
|
||
MQTT_SERVER | ||
: MQTT server url (ie: http://localhost:1883) | ||
|
||
MQTT_USER | ||
: Username for MQTT server authentication | ||
|
||
MQTT_PASSWORD | ||
: Password for MQTT server authentication | ||
|
||
IGNORED_DEVICES | ||
: A comma-separated list of device ids to exclude from the results of network scanning. Any excluded device will not show up in Home assistant, and the integration will ignore any status or position updates coming from it. | ||
|
||
FORCE_DEVICES | ||
: A comma-separated list of devices to monitor for status and position updates. The devices included in this list will be added to Home assistant even | ||
if the automatic scanning process can't detect them. Their online status will be updated whenever they are in range. You can specify a particular device type for the forced devices | ||
using the format `DEVICE_ID:DEVICE_TYPE` for each device in the list. In case no type is specified, type 25 is assumed (radio-controlled motor). For a list of supported device types check https://www.npmjs.com/package/warema-wms-venetian-blinds. | ||
|
||
POLLING_INTERVAL | ||
: Default value: 30000. Time interval in ms between each request to all devices to report their position and state. | ||
|
||
MOVING_INTERVAL | ||
: Default value: 1000. Minimum value: 100, Time interval between each request to a moving device to report position and state. | ||
This applies only to covers being opened or closed, for the duration of the operation or until stopped. Set to 0 to disable. | ||
|
||
WMS_CHANNEL, WMS_KEY, WMS_PAN_ID | ||
: Use these parameters to configure the WMS network your devices are connected to. In order to discover the parameters, start the addon with a `PAN_ID` equal to | ||
`FFFFF`, and follow the instructions described at the WMS network parameter discovery section ([here](#wms-discovery)). | ||
|
||
WMS_SERIAL_PORT | ||
: Default value: `/dev/ttyUSB0`. Device path for the WMS Usb Key. | ||
|
||
LOG_LEVEL | ||
: Default value: `info`. Log level, one of `[error, warn, info , http , verbose , debug , silly]` (in increasing order). | ||
|
||
### <a name="wms-discovery"></a>WMS Network parameters discovery | ||
In order to control WMS devices, the addon must be configured with the network parameters, which can be discovered through | ||
a brief process. You can initiate this process by starting the add-on with default parameters, or run it standalone with | ||
a command similar to the following: | ||
```shell | ||
docker run -it -e WMS_PAN_ID=FFFF -e WMS_SERIAL_PORT=/dev/ttyUSB0 santam/wms-mqtt | ||
``` | ||
|
||
When the `panId` configuration env parameter is set to `"FFFF"`, the stick will enter discovery mode and print out | ||
instructions on the console on how to retrieve your network configuration using a remote. | ||
|
||
You will see something resembling the following: | ||
``` | ||
-------------------------------------------------------------------------------- | ||
Starting getting network parameters... | ||
- Open the battery case of the WMS Handheld transmitter. | ||
- Select the channel using the (+) button. | ||
Notice: If an unassigned channel is selected, press the (+) button for 5 s. | ||
As soon as the LED flashes, all channels can be selected by | ||
pressing the (+) button again | ||
- Press the learn button in the battery case of the WMS Handheld | ||
transmitter for approx. 5 s. LEDS go green; the transmission LED flashes. | ||
For several seconds, the WMSHand-held transmitter plus scans the operating | ||
range for devices. | ||
- Each time when scanning stops with red LED perform steps: | ||
1) When you press the control button (A), you can check WHICH target device | ||
was just found. | ||
2) If you can *not* see the output | ||
"*** Waving and Hello!" | ||
on the screen after pressing (A) another device than the WMS Stick has | ||
been found. Press the (C) button to switch to the next receiver. | ||
3) If you can see the output | ||
"*** Waving and Hello!" | ||
on the screen after pressing (A) then the WMS Stick has been found. | ||
Press the STOP button to assign the WMS Stick to the channel. After | ||
pressing STOP the network parameters are displayed on the screen. | ||
- Press Ctrl-C to abort. | ||
``` | ||
Once the remote is in "learning mode", and you pressed the (A) button to identify devices, you should start seeing messages like: | ||
``` | ||
*** Stick scanned by SNR 123456. | ||
*** Stick scanned by SNR 123456. | ||
*** Stick scanned by SNR 123456. | ||
*** *** Waving and Hello! (requested from SNR 123456) | ||
*** *** Waving and Hello! (requested from SNR 123456) | ||
``` | ||
Use these logs to make sure you are using the right network channel for the intended devices. | ||
Once you are happy that (most of) your devices are discovered, by pressing the "stop" button on the remote, you should finally be able to see the network parameters: | ||
``` | ||
*** WMS Network parameters successfully detected: | ||
Channel: 17 | ||
PanId: 1A2B | ||
Key: 0123456789ABCDEF0123456789ABCDEF | ||
- Write down and remember the network parameters. | ||
- Briefly press the learn button on the back of WMS Handheld transmitter to | ||
stop the scanning process. | ||
- Press Ctrl-C to stop program. | ||
-------------------------------------------------------------------------------- | ||
``` | ||
At this point you have all the configuration needed to setup the addon. You'll need to add these configuration parameters to the | ||
environment variables. The process for doing so changes depending on how you are running the addon. | ||
|
||
You'll have to restart the addon container with the new configuration to reinitialize the WMS stick using the correct parameters. |
Oops, something went wrong.
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.
This will need changing, can be parameterized with repo secrets or workflow parameters