ThomDietrich / miflora-mqtt-daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
MIT License
610 stars 140 forks source link

New MAC Addreses #87

Closed ERgoliner closed 4 years ago

ERgoliner commented 5 years ago

Hi Tom

I recently received a new miflora sensor which is not white but light green colored. Those have a new mac beginning with 80:EA:CA therefore your script will not work any longer

Initialize Mi Flora sensors

flores = OrderedDict() for [name, mac] in config['Sensors'].items(): if not re.match("C4:7C:8D:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}", mac): print_line('The MAC address "{}" seems to be in the wrong format. Please check your configuration'.format(mac), error=True, sd_notify=True) sys.exit(1)

It would be great if you could fix that.

Thx Chris

Fietspomp86 commented 5 years ago

Could you not just edit these code lines from miflora-mqtt-daemon.py? Line 215 onwards. I've ordered a few more also, I'm curious which ones I get. I also have some light green ones, but they do have "C4:7C:8D" MAC addresses.

# Initialize Mi Flora sensors
flores = OrderedDict()
for [name, mac] in config['Sensors'].items():
    if not re.match("C4:7C:8D:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}", mac):
        print_line('The MAC address "{}" seems to be in the wrong format. Please check your configuration'.format(mac), error=True, sd_notify=True)
        sys.exit(1)
diogopms commented 4 years ago

I remove this validation and seems to work. My MAC address is 80:EA:CA:88:AF:99.

ThomDietrich commented 4 years ago

Hey guys! Looking at this with a fresh eye I can't remember why we decided to implement it like this.