Enocean switch

Hi Dani

Yes, I integrated switches, covers and contacts from Omnio, but without the official enocean HA integration.
I divided the integration of my Omnio products into two parts. For sending commands, I use command line switches which use the libraries and scripts of https://github.com/kipe/enocean. To read and integrate status telegrams of the enocean devices, I use a second raspberry pi with its own enocean pi board as an enocean-mqtt gateway with the tools of https://github.com/romor/enocean-mqtt.
Unnecessary complicated, I know. :woozy_face:

Hi @cgrueter

Thanks! rather complicated, indeed :frowning:
Since Iā€™m not really a developer I would have to figure out how to integrate libraries and scripts first ā€¦ and not sure what I would have to do afterwards. Iā€™d be willing to invest some time to learn though.
But before doing so, Iā€™m trying to find the solution with the least coding needed. I.e. I prefer solutions where I can connect working components to a system.

I found another post here: Controlling my Eltako dimmers via Enocean PI - Need advice
The proposed solution is to connect the enocean devices via FHEM and then connect FHEM and HA via an MQTT broker.

Iā€™m running hassio. so the mqtt add-on might work:


However, I need to figure out whether I can run FHEM on the same Raspberry Pi as Hassio and if I can use the some enocean USB dongleā€¦

What is your opinion? Scripts and libraries vs Hassio & FHEM & MQTT? One Raspberry PI vs 2 Raspberry PI?

(Sorry if these questions sound dumb, but as mentioned above, Iā€™m no dev, just a bit interested in technologyā€¦)

Hi Dani

For my first attempts I also used FHEM between HA and the enocean devices. Both systems FHEM and HA are complete home automation systems, so to cascade them doesnā€™t seem very fancy to me. But to use MQTT between HA and enocean seems to be the best way as long as the HA included enocean integration doesnā€™t support our devices. (I would implement it if I could, but Iā€™m also not a developer).

The way I described above doesnā€™t need two RPIs, you can run HA, mosquitto, and the named enocean-mqtt gateway from romor on the same RPI. What you need are two enocean dongles, two USB300 will also work. The reason is, that the dongle communication is done by UART (tty device), and while the enocean-mqtt gateway uses the interface, you canā€™t use it by another application as command line scripts.

According to romorā€™s description, it should also be possible to send commands from HA through enocean-mqtt to enocean devices, Iā€™m still testing. If it works, the command line scripts as the second dongle will be obsolete.

By the way, I also integrated FSG71/1-10V from Eltako.

Hi @cgrueter

Cool!! Sounds very promising! And that fact that you have it up and running is important to me. More on that below.

I just achieved a milestone myself. I could get my TF61D to work with the standard HA enocean integration and control it from lovelace! Instead of configuring it as a switch I defined it as a light according to https://www.home-assistant.io/integrations/enocean/#light (donā€™t know why I thought it should be a switch beforehandā€¦)

All of a sudden I got status updates in HA when controlling the TF61D with some enocean wall switch (Omnio and Feller) (btw, the wording ā€œswitchā€ is confusing as from an enocean/HA perspective itā€™s used differently than in plain Englishā€¦)
Thus the only thing left was to teach the TF61D to ā€œlistenā€ to the USB dongle and ultimately to the HA commands. In the TF61D manual it said that you should send a certain teach in telegram (0xE0400D80) when connecting rotary switches or ā€œGFVSā€. Since GFVS is some kind of software I figured this could be similar to HA. However, I donā€™t know how to send specific telegrams with the USB dongle via HA. So I downloaded DolphinView from enocean.com, installed it on my Windows computer, connected the USB dongle to the computer, put the TF61D in teach-in mode and sent the above telegram from DolphinView. Then I reconnected the USB dongle to the RPI - and here you go!

Why is this a major milestone to me? Since weā€™re about to build a house Iā€™m trying to find an affordable solution for the whole electricity installation that works without (!) home automation and any respective server etc. However, that installation should be able to be integrated in a home automation solution that I set up myself later on.
I like the whole enocean standard due to the self-power feature. It is perfect to later include window sensors and similar stuff. Or to simply install a new wall mounted switch. For my use case, this is an advantage over Zigbee or Z-Wave.
So what I have now is a proof of concept that this works: I can start with plain enocean, then extend with HA later on. However, my ā€œsimpleā€ way HA isnā€™t able to cover all the enocean devices on the market yet.

Nevertheless, I believe (hopeā€¦) that over time, more devices will be supported. I even have some python dev friends, so I might be able to get one of them to help.
In the meantime or as an alternative, I might ask you for some support on how to get your setting up and running. I still need to figure out how to run a simple script from GitHubā€¦

Hi @cgrueter

You might want to check out my post here: EnOcean - Configure FUD61, how to get 'sender_id'

I got the Eltakto enocean actors working directly with the ā€œstandardā€ HA enocean integration - but by doing the teaching in via a PC.

What I havenā€™t tried so far is to integrate enocean sensors.

Cheers
Dani

Hi Dani

Okay I see, I should try again the original HA enocean integration, there are some changes since I tested i last time. :slightly_smiling_face:
I will play around with it and give a feedback as soon as I found the time doing that. :timer_clock:

For the teach-in I tinkered some lines of Python code:

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from enocean.consolelogger import init_logging
import enocean.utils
from enocean.communicators.serialcommunicator import SerialCommunicator
from enocean.protocol.packet import RadioPacket
from enocean.protocol.packet import Packet
from enocean.protocol.constants import PACKET, RORG
import sys, time

try:
    import queue
except ImportError:
    import Queue as queue

sender_id=[0xAA, 0xAA, 0xAA, 0xFF]

destination_id=[0xFF, 0xFF, 0xFF, 0xFF]

def assemble_packet_press_a_1():
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=0, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_a_0():
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=1, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_b_1():
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=2, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_b_0():
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=3, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_release():
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=0, EB=0, R2=0, SA=0, T21=True, NU=False)

init_logging()
communicator = SerialCommunicator(port='/dev/ttyUSB0')
communicator.start()
time.sleep(1.5)
communicator.send(assemble_packet_press_a_1()) #a_1
time.sleep(0.2)
communicator.send(assemble_packet_release())
time.sleep(0.3)
communicator.send(assemble_packet_press_a_1()) #a_1
time.sleep(0.2)
communicator.send(assemble_packet_release())
time.sleep(1.5)
communicator.stop()

The script simulates pressing two times the ā€œa1ā€ rocker of a double rocker. I think itā€™s self explaining whatā€™s to change if you only have to simulate one click or if you want to use the ā€œbā€ rocker. If I remember correct, I used the example script from kipe as base Idea for this script, maybe itā€™s also useful for you.
Itā€™s important to change the sender_id, the first three codes have to correspond to the base id of your USB enocean dongle (or enocean pi).

Exactly same reasons why I use enocean: Works without central ā€œheadā€ device, no batteries, no dedicated network needed (WLAN), very short telegram (collision avoidance), Feller Design available.

Have fun with enocean and Home Assistant.

Hello, I am interested by this topic : indeed my project would be to control my roller shutter with Home Assistant.
My equipement is 1) Nodon Soft Remote control (ENOCEAN EEP F6-02-02) and Eltako FSB61NP for the roller shutter). I have found the sender_ID of my remote control with HEXDUMP and a Enocean PI on my Rpi.
But, the Enocean module of Home Assistant seems not to be able to treat this project.
I am a beginner in domotic, but quite interested, I am motivated to improve myself, and I was wondering if someone has succeeded to control his rollet shutter with HA ? with MQTT ? I donā€™t understand how HA can send an action to my Eltako
I thank you in advance for your answers

Hello, I have progressed beeing able to command my eltako FSB61NP (for cover shutter) from HA via MQTT FHEM.
But I would like to directly command from HA via enocean2mqtt.
I have an enoceanpi (and not a key USB300) so not able to use dolphin on a PC.
But maybe I can use the parameters from FHEM to configure enocean2mqtt.
Do you have some tuto or explanations so as to use enocean2mqtt using information such as below ?
Thank you in advance for your help

Hi

In between I wrote some chaotic python spaghetti code. :smirk:
It would be great if there is any python developer who is able to help me/us.

With the following python code Iā€™m able to control my roller shutters by Home Assistant (Omnio UPJ230/12, sending EEP F6-02-02, receiving feedbak EEP D2-05-00). It shows the correct status (open, close, position) and Iā€™m able to open and close them from Home Assistant.

The code uses again the kipe/enocean library and is based on the example code there.
Basically itā€™s also a Home Assistant -> MQTT -> Enocean gateway and vice versa.
It takes the sender ID of the enocean actuator and create the Home Assistant entities and the configuration of them by the Home Assistant MQTT discovery function. I only have to place the configured entities on the Home Assistant GUI from the ā€œunused entitiesā€ list.
My USB enocean dongle sender IDs are teached in into the shutter actuator with the above described ā€œteach inā€ script, and the actuator are configured sending periodically a feedback VLD telegram.

I also wrote the same chaotic python spaghetti code for enocean window contacts, light actuator and switch actuator. Maybe I should upload the scripts on GitHub, so that you can adjust and use it for your own application.

@Christianb233: Belong the data sheet of eltako FSB61NP you are only able to send commands to this roller shutter actuator, but not to receive state and position feedbacks?

Have fun with enocean and Home Assistant.

#/usr/local/bin/python3.7
# -*- encoding: utf-8 -*-
from enocean.consolelogger import init_logging
from enocean.communicators.serialcommunicator import SerialCommunicator
from enocean.protocol.packet import RadioPacket
from enocean.protocol.packet import Packet
from enocean.protocol.constants import PACKET, RORG
import enocean.utils
import traceback
import sys, time, queue, logging
import paho.mqtt.client as mqtt


mqttBroker = "10.0.0.99"
mqttUsername = "mqtt-user"
mqttPassword = "mqtt-secret"
mqttClientId = "enocean_gateway"
enocean_port="/dev/ttyUSB0"

# Pace your shutter ID and names here
rollo_actors = {'01:75:C9:FE' : 'rollo_nord'}
# or here, if open close is reversed, as the most of mines :-)
rollo_actors_v = {'01:77:30:3A' : 'rollo_west_1',
                  '01:75:BB:76' : 'rollo_west_2',
                  '01:72:60:48' : 'rollo_south_1',
                  '01:72:64:C0' : 'rollo_south_2'}
init_logging()

destination_id=[0xFF, 0xFF, 0xFF, 0xFF]
sender_id=[0xAA, 0xAA, 0xAA, 0x00]

def assemble_packet_press_a_1(sender_id):
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=0, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_a_0(sender_id):
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=1, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_b_1(sender_id):
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=2, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_press_b_0(sender_id):
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=3, EB=1, R2=0, SA=0, T21=True, NU=True)

def assemble_packet_release(sender_id):
    return Packet.create(packet_type=PACKET.RADIO, rorg=0xF6, rorg_func=0x02, rorg_type=0x02, 
                         destination=destination_id, sender=sender_id, R1=0, EB=0, R2=0, SA=0, T21=True, NU=False)

def on_mqtt_connect(client, userdata, flags, rc):
  if rc==0:
    print("Connection to "+mqttBroker+" successful, Returned code=",rc)
    mqttclient.connected_flag=True
  else:
    print("Bad connection Returned code=",rc)

def on_mqtt_disconnect(client, userdata, rc):
  print("disconnecting reason " +str(rc))
  mqttclient.connected_flag=False
  mqttclient.disconnected_flag=True

def on_mqtt_message(client, userdata, message):
  print("Received Topic:",message.topic,"Message",message.payload)
  if message.topic=="homeassistant/cover/enocean/rollo_west_1/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_0([0xAA, 0xAA, 0xAA, 0x32])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_1([0xAA, 0xAA, 0xAA, 0x32]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
  if message.topic=="homeassistant/cover/enocean/rollo_west_2/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_0([0xAA, 0xAA, 0xAA, 0x35])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_1([0xAA, 0xAA, 0xAA, 0x35]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
  if message.topic=="homeassistant/cover/enocean/rollo_south_1/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_0([0xAA, 0xAA, 0xAA, 0x30])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_1([0xAA, 0xAA, 0xAA, 0x30]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
  if message.topic=="homeassistant/cover/enocean/rollo_south_2/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_0([0xAA, 0xAA, 0xAA, 0x34])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_1([0xAA, 0xAA, 0xAA, 0x34]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
  if message.topic=="homeassistant/cover/enocean/rollo_nord/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_1([0xAA, 0xAA, 0xAA, 0x33])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_0([0xAA, 0xAA, 0xAA, 0x33]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())

def connect_messages():
  for k in rollo_actors:
    mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors[k]+"/config",'{"name" : "'+rollo_actors[k]+'", "device_class" : "shutter", "command_topic" : "homeassistant/cover/enocean/'+rollo_actors[k]+'/set", "set_position_topic" : "homeassistant/cover/enocean/'+rollo_actors[k]+'/set_position", "position_topic" : "homeassistant/cover/enocean/'+rollo_actors[k]+'/position", "uniq_id" : "'+k+'", "avty_t" : "homeassistant/cover/enocean/'+rollo_actors[k]+'/availability", "exp_aft" : "600"}', retain=True)
    mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors[k]+"/availability","online",retain=True)
    mqttclient.subscribe([("homeassistant/cover/enocean/"+rollo_actors[k]+"/set", 0), ("homeassistant/cover/enocean/"+rollo_actors[k]+"/set_position", 0)])
  for k in rollo_actors_v:
    mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors_v[k]+"/config",'{"name" : "'+rollo_actors_v[k]+'", "device_class" : "shutter", "command_topic" : "homeassistant/cover/enocean/'+rollo_actors_v[k]+'/set", "set_position_topic" : "homeassistant/cover/enocean/'+rollo_actors_v[k]+'/set_position", "position_topic" : "homeassistant/cover/enocean/'+rollo_actors_v[k]+'/position", "uniq_id" : "'+k+'", "avty_t" : "homeassistant/cover/enocean/'+rollo_actors_v[k]+'/availability", "exp_aft" : "600"}', retain=True)
    mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors_v[k]+"/availability","online",retain=True)
    mqttclient.subscribe([("homeassistant/cover/enocean/"+rollo_actors_v[k]+"/set", 0), ("homeassistant/cover/enocean/"+rollo_actors_v[k]+"/set_position", 0)])

mqtt.Client.connected_flag=False
mqtt.Client.disconnected_flag=True
mqttclient = mqtt.Client(mqttClientId)
mqttclient.on_connect=on_mqtt_connect
mqttclient.on_disconnect=on_mqtt_disconnect
mqttclient.username_pw_set(username=mqttUsername,password=mqttPassword)
mqttclient.connect(mqttBroker)
mqttclient.loop_start()
mqttclient.on_message=on_mqtt_message

communicator = SerialCommunicator(enocean_port)
communicator.start()

# endless loop receiving radio packets
while communicator.is_alive():
  if mqttclient.disconnected_flag:
    connect_messages()
    print("Connect Messages sent")
    mqttclient.disconnected_flag=False
  while not mqttclient.connected_flag:
    print("Waiting for reconnect")
    time.sleep(1)
  try:
    # Loop to empty the queue
    packet = communicator.receive.get(block=True, timeout=1)
    if packet.packet_type == PACKET.RADIO_ERP1 and packet.rorg == RORG.VLD:
      packet.select_eep(0x05, 0x00)
      packet.parse_eep()
      if packet.sender_hex in rollo_actors_v:
        #print("*** Got rollo feedback --> :", rollo_actors_v[packet.sender_hex], packet.parsed['POS']['raw_value'])
        mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors_v[packet.sender_hex]+"/position", 100-packet.parsed['POS']['raw_value'],retain=False)
      elif packet.sender_hex in rollo_actors:
        #print("*** Got rollo feedback --> :", rollo_actors[packet.sender_hex], packet.parsed['POS']['raw_value'])
        mqttclient.publish("homeassistant/cover/enocean/"+rollo_actors[packet.sender_hex]+"/position", packet.parsed['POS']['raw_value'],retain=False)
      else:
        print("New unknown VLD telegram: ")
        for k in packet.parsed:
          print('%s: %s' % (k, packet.parsed[k]))
    if packet.packet_type == PACKET.RADIO_ERP1 and packet.rorg == RORG.BS4:
      print("New unknown BS4 telegram: ")
      for k in packet.parse_eep(0x02, 0x05):
        print('%s: %s' % (k, packet.parsed[k]))
    if packet.packet_type == PACKET.RADIO_ERP1 and packet.rorg == RORG.BS1:
      packet.select_eep(0x00, 0x01)
      packet.parse_eep()
      print("New unknown BS1 telegram: ")
      for k in packet.parsed:
        print('%s: %s' % (k, packet.parsed[k]))
    if packet.packet_type == PACKET.RADIO_ERP1 and packet.rorg == RORG.RPS:
      packet.parse_eep(0x02, 0x02)
      print("New unknown RPS telegram: ")
      for k in packet.parsed:
        print('%s: %s' % (k, packet.parsed[k]))
  except queue.Empty:
    continue
  except KeyboardInterrupt:
    break
  except Exception:
    traceback.print_exc(file=sys.stdout)
    break

if communicator.is_alive():
  communicator.stop()
  print("Communicator stoped.")

mqttclient.loop_stop() 
print("MQTT loop stoped")
mqttclient.disconnect()
print("MQTT client disconnected")

Nice script!

How do you run it?
I am using hass.io and could use pyscript or appdeamon to run python sripts.

You really have to run it on a console. It shows you a lot of information, for example not configured sender IDs of your sensors and actuators, so that you can add them in the script. The script can also be run on an other computer than the home-assistant system, it needs an enocean dongle and a connection to the MQTT broker.
In between I uploaded a new version: https://github.com/cgrueter/enohag
This version supports shutter actuators, light/switch actuators (Omnio UPS230, Omnio UPD230), window contacts and rocker.

1 Like

Hi all, hi cgrueter,

It seems to be a really good script !
I was using Domoticz for a while, and wanted to change for Home Assistant that has a nicer interface. Unfortunately, I have some Ubiwizz roller shutter module (very similar to NodOn modules, SIN-2-RS-01 using EEP D2-05-00), and it is not natively usable with Hassio.

This script seems to be a good alternative (I have read that FHEM could also be used with MQTT, but this python script seems easier to install).

Could you please explain how to use it ? As asked cubertt, can it be used with hassio, or should I install Home Assitant supervised ?

Many thanks in advance !

i think he is running the script on an additional raspberry or else.

i tried it, but it is not simple.

What i found out the last week, is that:

Homeassistant can use/install node-red as a addon (and integration, i believe)

Node-red has an addon for enocean.

So i am trying now to get the enocean addon/node running in node red (in the moment on an second raspberry) and then use it in hass.io with the hass.io node red addon and integration.

Here the links:
Example of using it:

link to the node red addon:

1 Like

That seems to be also a good alternative, thanks for sharing !

I have tried to start node-red (never used it to be honnest) add-on in Hassio directly.
After several tries, and some errors read, I got it running with the enocean add-on in Node-red.

Here is the configuration file I used in Hassio Node-red addon, for information:

credential_secret: 'secret_credential!'
dark_mode: false
http_node:
  username: ''
  password: ''
http_static:
  username: ''
  password: ''
ssl: true
certfile: certificate.pem
keyfile: privkey.pem
require_ssl: true
system_packages:
  - make
  - python3
  - g++
  - gcc
  - linux-headers
npm_packages:
  - nan
  - serialport
  - node-red-contrib-enocean
init_commands: []
log_level: info

I had to generate an SSL certificate, but you can avoid this task putting ā€œssl: falseā€ and ā€œrequire_ssl: falseā€.

Also, to have the enocean addon working properly, it is necessary to add the following code in the settings.js file, normally stored in /config/node-red

contextStorage: {
   default: {
       module: "localfilesystem"
   }
}

I will let you know if there is any other progress.

1 Like

Hi RCasa

Ok, I added some explanations on the above named github.

Our long term collective goal should be to help to improve the native enocean Home Assistant integration, so that we donā€™t need any additional tool or script. I would if could, but I canā€™t. :wink:

1 Like

Hi !

I completely agree with your point of view @cgrueter. The problem is that I have no skill in programing (or low level), so I am not able to help to improve the native enocean Home Assistant. Nevertheless, what I can do is trying to find alternative solutions that could be implemented easily ! (Or at least with a detailed procedure).

I had good progress on my side today: I was able to create the nodes in Node-red and get a status from my roller shutter when I moved it. I am not able to control it up to now, but I was able to see the communication between the roller shutter module using EEP D2-05-00 and the USB300 key connected to my raspberry.
For info: I already paired my module when I was using Domoticz.

I have same ā€œproblemā€:
Teach in was done with openhab, now i need to translate senderIDOfsett (from Openhab) to the sender IDā€™s from cgrueter / enocean python script.

Here a Question: in your description on github (thanks!) your write ā€œEvery enocean dongle has itā€™s ownd base IDā€ but in the script i am reading:

destination_id=[0xFF, 0xFF, 0xFF, 0xFF]
sender_id=[0xAA, 0xAA, 0xAA, 0x00]

should i change at least the first 3 ā€œnumbersā€ to the one i read from my dongle? (e.g. 0xFF,0xF6,0x9B,0xXX)

And of course these workarounds are just that, workarounds. Please devs, include a good enocean addon!

Correct, if you want to send a command to an actuator, then you have to get your base ID of your dongle and add the ā€œoffsetā€.

Following steps are needed to be able to send commands:

  1. Get your base ID, to do this by using the enohag.py python script, put the following line of python code into the enohag.py script after communicator.start()
print('Your base ID: %s.' % enocean.utils.to_hex_string(communicator.base_id))
  1. After starting the script, it will show you an output as the following example:
    Your base ID: FF:F6:9B:00.
    That means, that your valid sender IDs are FF:F6:9B:00, FF:F6:9B:01, FF:F6:9B:02 ā€¦ FF:F6:9B:FF
  2. Teach in one of this valid sender IDs in one of your actuator, then an other valid sender ID in another actuator and so on. You can use the above shown ā€œteach inā€ script to do this step, or any other teach in tool. As I understand you, you have done this step already.
    For example you teach in FF:F6:9B:01 in your fist roller shutter.
  3. The declaration
    destination_id=[0xFF, 0xFF, 0xFF, 0xFF]
    doesnā€™t matter, it simply means ā€œbroadcastā€ to all enocean receivers. All my enocean actuators accept that. I think that this is true for almost all enocean actuators. Anyway itā€™s radio communication and every actuator is listening to all communication.
  4. The declaration
    sender_id=[0xAA, 0xAA, 0xAA, 0x00]
    honestly also doesnā€™t really matter at this point, it will be overwritten by the sender IDs in the def on_mqtt_message function. You can put here your base ID for your documentation:
    sender_id=[0xFF, 0xF6, 0x9B, 0x00]
    but again, it does nothing.
  5. Most important step now is, that you adjust the def on_mqtt_message function:
  if message.topic=="homeassistant/cover/enocean/rollo_west_1/set":
    if message.payload.decode('UTF-8')=='OPEN':
      communicator.send(assemble_packet_press_a_0([0xFF, 0xF6, 0x9B, 0x01])) #Teached in sender ID for this shutter
      time.sleep(0.1)
      communicator.send(assemble_packet_release())
    if message.payload.decode('UTF-8')=='CLOSE':
      communicator.send(assemble_packet_press_a_1([0xFF, 0xF6, 0x9B, 0x01]))
      time.sleep(0.1)
      communicator.send(assemble_packet_release())

First, rollo_west_1 in homeassistant/cover/enocean/rollo_west_1/set must correspond with your description in the beginning of the script, and second, here you have to set two times, the correct teached in sender ID, in our example 0xFF, 0xF6, 0x9B, 0x01

1 Like

Regarding your installation, are you running 2 raspberry pi ? (One with Home Assistant, and another one with your MQTT broker, the Encoean dongle, and the script running ?).

If yes, do you think there any possibility to have everything running on the same raspberry ?

Three of them. :grin:

  1. Home Asssistant
  2. MQTT broker
  3. System with USB 300 enocean dongle, running the enohag.py script

You should be able to run all things together on one raspberry pi, I donā€™t see any reason why that shouldnā€™t work.