Anyone recently use the BroadLink Node Library (2.1.4 variant)?

Anyone recently use the BroadLink Node Library (2.1.4 variant)? It appears to be pretty old.

Not having any luck even getting the discover node to work. I know I have my RM4 Mini in local mode, not cloud mode, and was able to confirm this via the following python3 script, even was able to get the sensor data via python3 module.

#!/usr/bin/env python3
#
#

# pip3 install broadlink
import sys, traceback, broadlink

# Constants...
BROADCAST='192.168.1.255'
ZERO=0

# Wireless...
SSID='XXX'
PASSPHARSE='XXX'

# Wireless Security, 0:None, 1:WEP, 2:WPA1, 3:WPA2, 4:WPA1/WPA2
SECURITY=4

# Globals...
theResult=ZERO

#
def Values(theDictionary, *theKeys):

        #
        return (theDictionary[theKey] for theKey in theKeys)

#
try:

        #
        broadlink.setup(SSID, PASSPHARSE, SECURITY)

        #
        DEVICES=broadlink.discover(discover_ip_address=BROADCAST)

        for theDevice in DEVICES:

                theAuthentication=theDevice.auth()
                theSensors=theDevice.check_sensors()

                #
                print(theDevice)
                print(theAuthentication)
                print(theSensors)

                #
                theTemperature,theHumidity=Values(theSensors, 'temperature','humidity')
                print(theTemperature)
                print(theHumidity)

except Exception as theException:

        #
        print(repr(theException))

        #
        traceback.print_exc()

finally:

        #
        pass

#
sys.exit(theResult)

Output...

智能遥控 (Broadlink RM4 mini 0x648d / 192.168.1.XXX:80 / XX:XX:XX:XX:XX:XX)
True 
{'temperature': 28.42, 'humidity': 23.39}
28.42
23.39 

Oh, and the odd thing is, the Chinese is the device description, not name, where 智能遥控 translates to 'Smart Remote Control' thanks to translation.

Guess I am running a python3 script via execute node for now!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.