Domoticz plugin

Questions and comments specific to a particular plugin should go here.
WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: Domoticz plugin

Post by WoLpH » Sun Apr 09, 2017 9:25 am

kgschlosser wrote:How is the support end of things??? are they quick to respond and actually try to figure out what the issue is?. or do they try to pass the buck all the time?
It varies, the developer is a bit grumpy at times and if he doesn't consider your issue an issue you're out of luck.

Other times he's pretty helpful, but as is the case with most developers, I think he's simply too busy
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: Domoticz plugin

Post by WoLpH » Sun Apr 09, 2017 9:39 am

kgschlosser wrote:i do have a question tho.... why the use of mqtt?? you can code a connector up in python for Domoticz and do a direct socket connection to a plugin made for EG.
That's would have been am option as well but it's more work and a lot heavier for Domoticz. Mqtt is natively supported and this would require starting a new python process for every event. Especially on a slow raspberry pi this can be noticeable
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

User avatar
kgschlosser
Site Admin
Posts: 5214
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Domoticz plugin

Post by kgschlosser » Sun Apr 09, 2017 2:18 pm

lol @ slow raspberry Pi. the raspberry pi is a supercomputer compared to the Vera
If you like the work I have been doing then feel free to Image

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: Domoticz plugin

Post by WoLpH » Sun Apr 09, 2017 2:50 pm

kgschlosser wrote:lol @ slow raspberry Pi. the raspberry pi is a supercomputer compared to the Vera
The Pi 2 and Pi 3 are pretty powerful but the Pi 1 is a huge pain to work on ;)

Although I should admit... I actually work _on_ the pi using ssh and vim ;)
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

User avatar
kgschlosser
Site Admin
Posts: 5214
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Domoticz plugin

Post by kgschlosser » Sun Apr 09, 2017 10:10 pm

I have a couple of pi 2' strictly to run hyperion. but I have mine setup to use xrdp. I wouldn't call it a speed demon. but it sure is a hell of a lot faster then my first computer LOL

8088 with 8086 mathco sporting a whopping 64K ram with a 64K expansion board (notice i didn't say card) and a 10 meg MFM HDD fill height 5.25 :shock: ¯\_(ツ)_/¯ Oh yeah. and it was a "laptop" LMAO., well it was portable more like lugging around a sewing machine. it had a 9" monochrome CRT built in and the keyboard clipped into it.. it even had a printer built into it...
If you like the work I have been doing then feel free to Image

Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Domoticz plugin

Post by Foune » Wed Apr 12, 2017 8:08 am

Hello,

I'm looking forward to

1 - Get domoticz events in eventghost : if I understand, I should start by installing a MQTT broker on my machine, then plug domoticz to this MQTT server and activate the service. Finally create a MQTT subscription in eventghost.

2 - Use Domoticz device states in my eventghost scripts : Is this plugin appropriate for this? I'd like to be able to write some python like if domoticzDevice[12]["state"] = "ON" , then ... .

Currently I use a global list in eg.global to store all my onewire temps, and my RF433 switches states. Eg is the master for these values, it send it to domoticz which is the slave.

Since I've just installed a Xiaomi Gateway with some sensors, my Domoticz is the master on these sensors, while eventghost is still totally blind as there is no Xiaomi plugin for eventghost (unfortunately). I've already written some json to get some domoticz device states, but it is not comfortable.

Any piece of advice will be greatly appreciated.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Domoticz plugin

Post by krambriw » Wed Apr 12, 2017 8:44 am

If you use MQTT, which is generally a good way of integrating various (IoT enabled) products from various vendors, I think there are some examples in previous posts that show you the typical format of domoticz events in EG. Whether this is good enough or not, well let's see. It is possible to enhance the MQTT Client plugin when needed.

So as you wrote, start with the basic and install the MQTT stuff you mention to get it going and we take it from there

PS depending on where you run domoticz, if it is in a raspberry Pi running Linux, you should install the mosquitto mqtt broker there, it will be the simplest for you. Then you connect the MQTT Client plugin to there.

Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Domoticz plugin

Post by Foune » Wed Apr 12, 2017 9:08 am

Thank you for your help. Domoticz, Eventghost are both running on the same windows machine. Eventghost has been my automation gateway for 8 years, Domoticz is running since the beginning of the year, mainly as a frontend for eventgost. Before I had some arduino and linux stuff talking with eventghost using XPL, it was rather efficient. I'll dig into this MQTT protocol.

Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Domoticz plugin

Post by Foune » Wed Apr 12, 2017 9:15 pm

Nice, I get domoticz events in Eg, wonderful. I still have to solve this bloody encoding... but it's a detail.

MQTT sends me :

MQTT.domoticz/out/RFXMeter/22 [255, 12, 'RFXMeter', '82022', 22, 'NAS FAN', 0, 'RFXMeter counter', '2129.0', 1]

This is what I do :

payloadArray = str(eg.event.payload).replace("'", "").replace(" ", "").split(",")

This is the event I trigger behind for my eg scripts :

Domoticz.RFXMetercounter.NASFAN u"2129.0;NAS FAN;22"


Here is what I get when using accents :

MQTT.domoticz/out/Lighting Limitless/Applamp/1/1 [255, 12, 'Lighting Limitless/Applamp', '1', 1, 'Milight G\xc3\xa9n\xc3\xa9ral', 1, 'RGBW', '0', 'On/Off', 0]

I tried the trick .encode("latin1").decode("utf-8") just as I do in other scripts, but didn't solve it.

payloadArray = str(eg.event.payload).encode("latin1").decode("utf-8").replace("'", "").replace(" ", "").split(",")

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: Domoticz plugin

Post by WoLpH » Wed Apr 12, 2017 9:44 pm

I'd personally recommend to use the actual data instead of converting it to strings first.

Try this instead to get a proper representation of the payload:

Code: Select all

import pprint

pprint.pprint(eg.event.payload)
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Domoticz plugin

Post by Foune » Wed Apr 12, 2017 9:57 pm

It makes sense, thank you.

User avatar
kgschlosser
Site Admin
Posts: 5214
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Domoticz plugin

Post by kgschlosser » Sun Apr 23, 2017 1:11 am

well I have officially begun the process of moving to Domoticz. I have my floor plans laid out. only have 2 devices added I have to add the rest. I am going to do that shortly. I do like the layout thus far.

I have encountered 3 bugs in the Domoticz program already and they are things that I believe should have been found/fixed already I am running the stable version. I am going to post about it not sure if i should try GitHub or their forums.
If you like the work I have been doing then feel free to Image

Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Domoticz plugin

Post by Foune » Sun Apr 23, 2017 7:09 am

Do you plan to move all your python scripts (based on events) to Domoticz?

Do you plan to create plugins in Domoticz if you need them ?

Currently I'm balanced between Domoticz and Eventghost. Keeping Eventghost as Master is becoming time-consuming each time I add a complex device in Domoticz. Next one will be a camera.

On the opposite, m'y custom interface based on Eventghost global variables and Web server is ten times faster than the Domoticz one.

User avatar
kgschlosser
Site Admin
Posts: 5214
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Domoticz plugin

Post by kgschlosser » Sun Apr 23, 2017 9:30 am

well looking into the bug reports for Domoticz it has quite a few problems. I am going to continue to run EG as the back end for controlling everything. EG is awesome in it's advanced simplicity. Advanced meaning limitless possibilities with how it's scripting system works. and simplicity is the event action system and GUI. it's very easy to follow whats going on. I haven't seen that kind of an interface from Domoticz tho I haven't gotten into it to much.

The web interface has a lot to be desired in terms of updating in a timely manner. Now this is from someone coming from a Vera which is the slowest lighting control system made and with that thing I would get reports into EG faster then it's own UI would. It appears the same goes for Domoticz. I have the polling time set on a switch for 10 seconds and it takes Domoticz about 30 before it updates the UI. Now I know this isn't the Z-Wave because when I had the Vera connected to EG. I would get an event in less then 100 milliseconds after i pressed the switch. I am hoping when i get this thing connected to EG the responses will be just as fast if not faster. I am going to be diving into that end of things soon.

How if the response time when using this plugin?


I also have way to much in EG to move it all as well. I have a central EG that controls 3 TV's, a projector, lighting scenes, 6 remotes, 12 micro controllers, 3 security cameras, 2 cell phones (geofencing), text messaging control over the system, centralized menu system that displays on every video screen. multi room audio, HVAC, couple of touch panels, security sensors. gas fireplaces.... and the list goes on and on.
If you like the work I have been doing then feel free to Image

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Domoticz plugin

Post by krambriw » Sun Apr 23, 2017 10:35 am

.... and the list goes on and on
...and EG just keeps on handling all this, yeah, that is impressive, one of many reasons we keep on improving!

Post Reply