Page 1 of 1
[Plugin] Serial USB300 ESP3 EnOcean
Posted: Tuesday 14 March 2017 14:27
by St7ven
Hi,
I'm starting to write a plugging output serial data through an EnOcean USB300.
I will, and I have already met some trouble with coding this plugin. I decided to start this topic for who may want to help.
- Spoiler: show
- Please Help !

@Dnpwwo generously send me a template to start this plugin. see :
https://www.domoticz.com/forum/viewtopi ... 61&t=16545
1 -
- Spoiler: show
- First problem I met is setting the baudrate :
I replace Code: Select all
Domoticz.Transport("Serial", Parameters["SerialPort"], 115200)
with Code: Select all
Domoticz.Transport("Serial", Parameters["SerialPort"], "57600")
Because the 3rd input requiered a string not a int. And the USB300 works at 58823.
But in the log I get : Code: Select all
Transport set to: 'Serial', 'COM3', 115200.
How can I change the baudrate to 57600 ?
Solve : Code: Select all
Domoticz.Transport("Serial", Parameters["SerialPort"], Baud=57600)
2 -
- Spoiler: show
Code: Select all
def onMessage(Data, Status, Extra):
Domoticz.Log("onMessage called")
splittedData = Data.split()
Verify = Data[1]
Domoticz.log(str(splittedData))
Domoticz.Log("onMessage called2")
Domoticz.log(str(Verify))
Domoticz.Log("onMessage called3")
In the windows console, I get the following error :
Code: Select all
Error: <EnOcean_Debug> 'onMessage' failed 'AttributeError':'module 'Domoticz' has no attribute 'log''.
and domoticz crashed crash
But I know it has. Why does it lie to me
?
Solve : (Thanks zak45) Log and not log

3 - With this plugin, I will use the USB300 on port COM3. A problem comes when I also want to use the included ESP3 harware "EnOcean USB (ESP3) with the same port. Is there a way to do this ?
I was thinking to open port of my plugin only when I need to send specific data through USB300 (not handle with the EnOcean USB Domo...) and then give back the port to the native EnOcean USB domoticz driver. All messagse received by the EnOcean USB domoticz driver are in the log.
Is this solution seems possible to you ? It will requiere to read the log file
Re: [Plugin] Serial USB300 ESP3 EnOcean
Posted: Tuesday 14 March 2017 17:44
by zak45
Domoticz.log(str(splittedData))
maybe
Domoticz.Log(str(splittedData))
l vs L
Re: [Plugin] Serial USB300 ESP3 EnOcean
Posted: Tuesday 14 March 2017 18:26
by St7ven
Yes !! You are right. Well see and thank you.
What stupid mistake I did .... Shame on me.
Problem #2 Solved
Re: [Plugin] Serial USB300 ESP3 EnOcean
Posted: Monday 27 January 2020 10:57
by domopicz
Hi St7ven,
I am revamping this old thread because I am struggling to get my enocean hardware work with Domoticz, and I wonder if the plugin you were working on could potentially help me, or at least help me get started.
Basically, I am trying to get an enocean heater controller work. It does:
- 4 control (off/away/eco/confort modes) of the heater ("fil pilote" in french)
- returns the current mode set, and current power consumption
The enocean protocol is: D2-01-0C.
It does not seem to be supported by the standard hardware implementation in Domoticz (I could only make it work as a ON/OFF Switch with no away/eco mode, and no return on consumption), I was wondering if you could have implemented this protocol by chance, or if I could see if I could help improve your plugin to make it work (to not start from scratch)...
Any help you could provide?