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

Basic whitelisting/blacklisting support for ZgatewayRF #919

Closed

Conversation

mtiutiu
Copy link
Contributor

@mtiutiu mtiutiu commented Apr 6, 2021

Basic whitelisting/blacklisting support for the ZGatewayRF. Nothing fancy or complicated just a simple filtering based on the unique RC switch code being sent. This avoids creating in Home Assistant for example redundant entities because the RF receiver "catches signals" from other devices around the house or neighbors.

I tested both whitelisting/blacklisting and seems to work as expected. Disabling whitelisting/blacklisting is also supported.

Hope it helps.

@mtiutiu mtiutiu force-pushed the ZGatewayRF_white_blacklisting branch 2 times, most recently from 76f6567 to af13858 Compare April 6, 2021 10:08
@mtiutiu
Copy link
Contributor Author

mtiutiu commented Apr 6, 2021

Made it to compile for the AVR arch but no ARDUINO UNO support due to limited resources available.

@mtiutiu mtiutiu force-pushed the ZGatewayRF_white_blacklisting branch from 40bcc10 to 4ac7122 Compare April 6, 2021 12:59
@mtiutiu mtiutiu changed the title basic whitelisting/blacklisting support for ZgatewayRF Basic whitelisting/blacklisting support for ZgatewayRF Apr 6, 2021
@mtiutiu
Copy link
Contributor Author

mtiutiu commented Apr 6, 2021

Should fix #568 as well. As a future enhancement I think I can add the ability to filter based on a range like this:

{"white-list": ["110355-220000"]}

instead of writing all those id's by hand which can be tedious when you have many around. Same for blacklisting. But let's keep this PR as it is right now because as I already mentioned in the title it adds Basic functionality.

@1technophile 1technophile added this to the v0.9.7 milestone Apr 6, 2021
@mtiutiu
Copy link
Contributor Author

mtiutiu commented Apr 7, 2021

It's quite inefficient to send white/black list via MQTT and JSON due to RAM constraints for embedded devices. And the current implementation that I made may not be efficient as well because of the fact that one cannot send long lists of id's. I updated the readme with the details. It should be more efficient when using ranges like I mentioned in the previous comment. Yet again I will opt for a web interface that the Gateway should expose and do some configuration things there which get stored on the internal flash. This should be not that trivial to implement for the ESP32/8266 platforms.

@1technophile
Copy link
Owner

Thanks for the PR, I will look at it next week

@@ -82,6 +82,7 @@ extra_configs =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[libraries]
arduino_stl = ciband/avr_stl @ ^1.2.3
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Zgateway BT White and blacklist mechanism we use:

`stl = https://github.com/mike-matera/ArduinoSTL.git#7411816`

The one that you are proposing seems more maintained. Would it be possible to do the replacement into platformio.ini so as to use only yours?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Comment on lines +32 to +34
# if defined(ESP32) || defined(ESP8266) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
# include <vector>
using namespace std;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a difference between your macro segmentation and the one in ZgatewayBT:

#  if !defined(ESP32) && !defined(ESP8266)
#    include <ArduinoSTL.h>
#  endif

#  include <vector>
using namespace std;

It could be interesting to unify both as we are talking about the same function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this one is more concise and shorter. Will do.

@1technophile
Copy link
Owner

1technophile commented Apr 18, 2021

Thanks for the PR, we may have in a future PR to think about factoring white and blacklist functions between the different gateways.
I like also your add regarding black and white list removal, we should add it for BLE

@1technophile
Copy link
Owner

Should fix #568 as well. As a future enhancement I think I can add the ability to filter based on a range like this:

Could be a nice option

@1technophile 1technophile removed this from the v0.9.7 milestone Jun 20, 2021
@BadWolf42 BadWolf42 mentioned this pull request Aug 26, 2022
3 tasks
@github-actions github-actions bot added the stale label Oct 7, 2023
@github-actions github-actions bot closed this Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants