Coder Social home page Coder Social logo

aqualin-mqtt-deamon's People

Contributors

royoltmans avatar warthog9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aqualin-mqtt-deamon's Issues

MQTT Error- ./aqualin-mqtt-deamon.py

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

MQTT authentication

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.

Battery level published in wrong format

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))

MQTT

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.

How get the status of the valve ?

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

Consider adding an explicit license

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.

Valve state of Aqualin is never retrieved

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)
 ....

ESP32 support

Hi,
Great work! Any plans to make this work on esp32 platform?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.