77
77
entity from Home Assistant.
78
78
79
79
80
- Known Issues:
81
-
82
- Currently there is no white or black lists, so any device that rtl_433 receives
83
- including transients, false positives, will create a bunch of entities in
84
- Home Assistant.
85
-
86
80
As of 2020-10, Home Assistant MQTT auto discovery doesn't currently support
87
81
supplying "friendly name", and "area" key, so some configuration must be
88
82
done in Home Assistant.
@@ -648,6 +642,11 @@ def bridge_event_to_hass(mqttc, topicprefix, data):
648
642
logging .warning ("No suitable identifier found for model: " , model )
649
643
return
650
644
645
+ if args .ids and data .get ("id" ) not in args .ids :
646
+ # not in the safe list
647
+ logging .debug ("Device (%s) is not in the desired list of device ids: [%s]" % (data ["id" ], ids ))
648
+ return
649
+
651
650
# detect known attributes
652
651
for key in data .keys ():
653
652
if key in mappings :
@@ -727,6 +726,8 @@ def run():
727
726
dest = "discovery_interval" ,
728
727
default = 600 ,
729
728
help = "Interval to republish config topics in seconds (default: %(default)d)" )
729
+ parser .add_argument ("-I" , "--ids" , type = int , nargs = "+" ,
730
+ help = "ID's of devices that will be discovered (omit for all)" )
730
731
args = parser .parse_args ()
731
732
732
733
if args .debug and args .quiet :
@@ -749,4 +750,10 @@ def run():
749
750
if not args .user or not args .password :
750
751
logging .warning ("User or password is not set. Check credentials if subscriptions do not return messages." )
751
752
753
+ if args .ids :
754
+ ids = ', ' .join (str (id ) for id in args .ids )
755
+ logging .info ("Only discovering devices with ids: [%s]" % ids )
756
+ else :
757
+ logging .info ("Discovering all devices" )
758
+
752
759
run ()
0 commit comments