royoltmans / aqualin-mqtt-deamon Goto Github PK
View Code? Open in Web Editor NEWLightweight aqualin BLE mqtt deamon controller
Lightweight aqualin BLE mqtt deamon controller
pi@octopi:~ $ cd /opt/aqualin-mqtt-deamon
pi@octopi:/opt/aqualin-mqtt-deamon $ ./aqualin-mqtt-deamon.py
MQTT: Connected with result code 0
('on', 1, u'E7:E7:BB:18:F2:A3')
BLE instruction:
7b03010001
Connecting E7:E7:BB:18:F2:A3...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "./aqualin-mqtt-deamon.py", line 105, in runworkerbledevicestate
setblerequest(queuevalues[0], queuevalues[2], bleHandle, getblevalue(queuevalues[0], queuevalues[1]))
File "./aqualin-mqtt-deamon.py", line 88, in setblerequest
device = btle.Peripheral(str(devicemac))
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
BTLEDisconnectError: Failed to connect to peripheral E7:E7:BB:18:F2:A3, addr type: public
Hi,
Is there any way to define the mqtt broker username and password. I tried specifying them in the config ini but still throws error 5.
The battery level (percentage) is published in hexadecimal format.
To get this value published in decimal format change the client.publish ...
line in def runbatterycheck()
: to
client.publish(mqttbasepath + str(devicemac) + '/battery', int(strbatstatus,16))
Dear All,
I tried to execute the following command on my rasberryPi and get the following error.
./aqualin-mqtt-deamon.py
MQTT: Connected with result code 0
the screen is afterwards hanging and I can not continue with the other steps.
First, I want to thank you for this project and tell you that it works perfectly.
Nevertheless, I have a question : how can I get the status of the valve : on or off ? Is it a way to query the valve and can you document it ?
Thank you
Please consider adding an explicit license to this, as it currently is somewhat ambiguous. If I could suggest PSF, GPLv2+, or MIT are all good choices.
The valve state is never retrieved from the Aqualin due to to many 'deviceblelock' instructions.
First after commenting (or deleting) the lines as below the valve state is correctly presented in the MQTT-message:
....
def runvalvecheck():
global deviceblelock
for i, devicemac in enumerate(devicemaclist):
if trace:
print "runvalvecheck start - deviceblelock: " + str(deviceblelock)
if deviceblelock == False:
# deviceblelock = True
# device = btle.Peripheral(str(devicemac))
intsolenoidstate = getsolenoidvalve(devicemac)
print "Solenoide state is: " + str(intsolenoidstate)
if intsolenoidstate <= 0:
strvalvestate = 'off'
else:
strvalvestate = 'on'
client.publish(mqttbasepath + str(devicemac) + '/valvestate', strvalvestate) # publish
if trace:
print "Valve state is " + strvalvestate + " for device " + str(devicemac)
time.sleep(int(waittime))
# device.disconnect()
# deviceblelock = False
if trace:
print "runvalvecheck end - deviceblelock: " + str(deviceblelock)
else:
time.sleep(5)
....
Hi,
Great work! Any plans to make this work on esp32 platform?
Thanks
I assume it is not compatible with python3, as it fails with error "ImportError: No module named bluepy", even though the module is installed. The same error is thrown with the fork: https://github.com/warthog9/aqualin-mqtt-deamon Any idea what could be the issues? Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.