Energenie

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

can you share a link to the device?

sure you can connect it. add a device using GitHub - myDevicesIoT/Cayenne-MQTT-Python: Python Library for Cayenne MQTT API and then use energenie library to control it from the dashboard Energenie

wow. thanks . what a great response

1 Like

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 GitHub - myDevicesIoT/cayenne-plugin-example: An example plugin for Cayenne.
i see energenie as an excellent add on to pi agent plugin list.

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

no issue here,

what is the issue you are facing?

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

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

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 Cayenne-MQTT-Python/Example-03-CayenneClient.py at master · myDevicesIoT/Cayenne-MQTT-Python · GitHub 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 GitHub - myDevicesIoT/cayenne-plugin-dht: A DHT sensor plugin for Cayenne or have a code to read DHT11 data Overview | DHT Humidity Sensing on Raspberry Pi or Beaglebone Black with GDocs Logging | Adafruit Learning System and send it using the above code.

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

Run this command on your pi:

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

Thanks. Thats working now

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

you are missing the DOT sudo pip3 install .

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

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

Hi
I can see the message received and the value change from 0 to 1 etc but the code doesnt respond to the change.

can you share the code you are using?

Its probably where ive pasted the code that’s making it fail.

Can you copy paste the code and the output here in place of sending the image as it is difficult to read it.