thejeffreystone / hassio_addons

Apache License 2.0
45 stars 26 forks source link

white list not working #30

Open btenney100 opened 2 years ago

btenney100 commented 2 years ago

I have enabled the whitelist and added one id. it still finds 30 other devices over a week.

Thanks in advance, I'm sure I am missing something simple.

scuppasteve commented 1 year ago

I agree, i would appreciate an example from someone of a working whitelist format. So i can stop adding so many garbage devices.

thejeffreystone commented 1 year ago
CleanShot 2022-12-09 at 21 14 02@2x

My Whitelist looks like this. And when enabled should only send the Devices with the ids in the Whitelist field. If I don't put anything, and turn on debug, then every time it reads a device it puts a note that the device is not in the whitelist.

scuppasteve commented 1 year ago
CleanShot 2022-12-09 at 21 14 02@2x

My Whitelist looks like this. And when enabled should only send the Devices with the ids in the Whitelist field. If I don't put anything, and turn on debug, then every time it reads a device it puts a note that the device is not in the whitelist.

How does that ID work, where does it come from. my devices come from a state topic of rtl_433/Acurite-Tower/4726/A/ are you saying the whitelist ID for this item would be 4726?

FinestDice17 commented 1 year ago

did you ever figure this out, because im reading my electric and gas meters with this but am also getting others, would like to filter out just my 2 meters. What id is this looking for?

btenney100 commented 1 year ago

I still can not get the white list to work. I tried the example given, but it still reads all

FinestDice17 commented 1 year ago

I still can not get the white list to work. I tried the example given, but it still reads all

I got mine working, can you paste a copy of your Mqtt data coming over and I might be able to help you locate your id.

thejeffreystone commented 1 year ago

It reads all in th log or they end up in Home Assistant? It is going to read all of it in the log. I guess we could filter those out. But if its not in the whitelist it should print a line that its not in the white list.

thejeffreystone commented 1 year ago

Think I found a bug. Trying to squash it now.

btenney100 commented 1 year ago

Thanks all for helping with this. I will get a copy of my log files.

On a side note, This is so bulletproof that I have abandoned my other zigbee temp / humidity sensors because this is so reliable compared to them. The only problem I ever have is when the batteries die in my sensors. Thanks again! Awesome.

FinestDice17 commented 1 year ago

Here is how i have mine configured which is now working flawlessly at only sending over data to HA of my gas and electric meters only.....

::::::::Starting RTL_433 with parameters:::::::: [05:45:56] INFO: MQTT Host = "mqtt host ip address" [05:45:56] INFO: MQTT port = 1883 [05:45:56] INFO: MQTT User = "optional" [05:45:56] INFO: MQTT Password = "optional" [05:45:56] INFO: MQTT Topic = rtl_433 [05:45:56] INFO: MQTT Retain = true [05:45:56] INFO: PROTOCOL = -R 149 -R 160 -R 161 [05:45:56] INFO: FREQUENCY = -f 915m -f 912m [05:45:56] INFO: Whitelist Enabled = true [05:45:56] INFO: Whitelist = 37823822 15093018 [05:45:56] INFO: Expire After = 0 [05:45:56] INFO: UNITS = si [05:45:56] INFO: DISCOVERY_PREFIX = homeassistant [05:45:56] INFO: DISCOVERY_INTERVAL = 300 [05:45:56] INFO: DEBUG = true ################################################################################# Received message: rtl_433/events : {"time": "2023-02-01 05:45:57-0500", "protocol": 149, "model": "ERT-SCM", "id": 39059630, "physical_tamper": 0, "ert_type": 4, "encoder_tamper": 1, "consumption_data": 6769, "mic": "CRC", "mod": "ASK", "freq": 915.07885, "rssi": -4.69423, "snr": 22.13518, "noise": -26.8294} Device Id:39059630 not in whitelist Received message: rtl_433/events : {"time": "2023-02-01 05:45:57-0500", "protocol": 149, "model": "ERT-SCM", "id": 37823822, "physical_tamper": 0, "ert_type": 4, "encoder_tamper": 1, "consumption_data": 15664, "mic": "CRC", "mod": "ASK", "freq": 915.10074, "rssi": -3.54561, "snr": 23.41345, "noise": -26.9591} Received key time for ERT-SCM Received key freq for ERT-SCM Received key rssi for ERT-SCM Received key snr for ERT-SCM Received key noise for ERT-SCM

For Device Id:39059630 its receiving the message but but publishing it to HA For Device Id:37823822 you see its sending Received messages for : Received key time for ERT-SCM Received key freq for ERT-SCM Received key rssi for ERT-SCM Received key snr for ERT-SCM Received key noise for ERT-SCM

hope this helps a little. Thank you @thejeffreystone for your work on this!

scuppasteve commented 1 year ago

I still don't get the whitelist working

Received message: rtl_433/events : {"time": "2023-02-06 07:41:10-0800", "protocol": 40, "model": "Acurite-Tower", "id": 1946, "channel": "A", "battery_ok": 1, "temperature_F": 72.14, "humidity": 40, "mic": "CHECKSUM", "mod": "ASK", "freq": 433.94515, "rssi": -0.118229, "snr": 24.17268, "noise": -24.2909}

I am going to assume my ID for this is 1946.

I have entered all of those in the whitelist with spaces between them, and other devices keep getting picked up. It is a PITA to have to keep cleaning up the created devices.

image

thejeffreystone commented 1 year ago

Yeah, the SDR to MQTT isn't respecting the whitelist. I haven't had a chance to get it all fixed.

scuppasteve commented 1 year ago

I know beggars can't be choosers, but this causes a huge knock on effect of adding so many entities that it crashes Node-Red due to so many entities in the system. So every like 3 months i have to delete like 2000 devices. Thanks for all the work so far.

thejeffreystone commented 1 year ago

Yeah, I get it. I've been working on updates to both versions. Hoping to have those up there this week. I need to do some more testing to make sure I don't make things worse. I think going forward I will put beta versions up that have the changes in them so everyone could help test since I dont have all the sensors, or setups.

btenney100 commented 1 year ago

Beta is a great idea. Would love to help test and provide feedback. I have 42 sensors. Thanks for all the work.

A

thejeffreystone commented 1 year ago

Ok, I pushed an update. Lots of changes that Ive been working on and testing with my setup. Finger crossed nothing breaks.

I tried to clean up the whitelist logic. And I tested it on a new system and MQTT server. It appears to work at least in terms of Home Assistant. When whitelist is on, it reports in the log that it received data from a device, but didn't send it to Home Assistant. No new devices were created in home assistant that were not in the whitelist.

But those devices do still end up in the MQTT server since that is done by the rtl_433 program I am using. If we want to prevent those entities from making it to the MQTT server then I will need to write a wrapper for the RTL_433 program and handle the sending to MQTT part.

scuppasteve commented 1 year ago

Awesome, thank you i will try it out. I don't know that i care about it going through MQTT, i already have lots of traffic there that i ignore. More of an issue with entity creation in my mind. Thank you for being response and the work you have put in.

thejeffreystone commented 1 year ago

Ok, I think the whitelist problem is not going to be fixed by anything I added...or at least once the device has been pushed to the home assistant topic in the mqtt server it's there. From that point on, unless it is removed from the home assistant topic, and removed from HA it will continue to get updates even after the whitelist has been enabled.

Because the whitelist only prevents auto discovery from happening.

So I need to rethink the whitelist setup.