Energenie


#1

Can you add energenie sockets as controlled devices.
I looked in list but it seems very limited.


#2

can you share a link to the device?


#3

#4

sure you can connect it. add a device using https://github.com/myDevicesIoT/Cayenne-MQTT-Python and then use energenie library to control it from the dashboard https://pythonhosted.org/energenie/


#5

wow. thanks . what a great response


#6

you can create a pi plugin for energenie and help the cayenne community user to add engenie directly using pi agent and no need for coding https://github.com/myDevicesIoT/cayenne-plugin-example.
i see energenie as an excellent add on to pi agent plugin list.


#7

Thanks. Ive spent the last couple of hours looking through the information and trying things out. Im afraid its well out of my scope of experience.
I thought it would be easy to find the energenie pimote adapter and load it up but that doesnt seem to be the way it works.
I was also trying to add a dht11 sensor but again came unstuck


#8

no issue here,

what is the issue you are facing?

if you can provide more detail, i can help solve it.


#9

Thanks for your time on this its .much appreciated.
I cant see how to start and add the pimote board to your system.
same applies to the dht11 temp sensor.
I know both work as ive tested them with pyhon scripts.
Bob


#10

First of all you need to create new device on cayenne: On your cayenne dashboard navigate to add new--->devices/widget--->Bring your Own thing and you will get MQTT credential.
on you pi add this code https://github.com/myDevicesIoT/Cayenne-MQTT-Python/blob/master/examples/Example-03-CayenneClient.py and change the MQTT credential.
Next, run the code and you will see your device online on the dashboard. you will also see some green temporary widget, you can add them if you want.
Now you need a button to control the energenie device ON/OFF. For this add a custom button widget with channel 4 selected and add the below code in your code.

def on_message(message):
    print("message received: " + str(message))
    if (message.channel == 4) and (message.value == "1"):
        switch_on(1)
    else:
        switch_on(0)

For DHT11 you can either use pi plugin https://github.com/myDevicesIoT/cayenne-plugin-dht or have a code to read DHT11 data https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/overview and send it using the above code.


#11

Hi,
I tried that info but get:
pi@raspberrypi:~/Desktop python cayenne.py Traceback (most recent call last): File "cayenne.py", line 2, in <module> import cayenne.client File "/home/pi/Desktop/cayenne.py", line 2, in <module> import cayenne.client ImportError: No module named client pi@raspberrypi:~/Desktop
I tried from the beginning but the same result.
Bob


#12

Run this command on your pi:

git clone https://github.com/myDevicesIoT/Cayenne-MQTT-Python
cd Cayenne-MQTT-Python
python setup.py install

#13

Thanks. Thats working now

I followed the dht11 sensor instructions but when i run
sudo pip3 install it just gives error.


#14

you are missing the DOT sudo pip3 install .


#15

Thank you
That worked but now its the same message that it stops at the
import cayenne.client

Ive gone back and all the commands again but it comes back to halting at import cayenne.client

Bob


#16

hold on, there are two separate method and seems like you using both. Use any one. either use python code or pi agent with plugin