Plugin - Homewizard

Python and python framework

Moderator: leecollings

Post Reply
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Plugin - Homewizard

Post by Wobbles »

Hi all,

I started using Domoticz over a year ago, before that I was using homewizard as my domotica system. Since I discovered Domoticz I switched to using that but still have some hardware connected to my homewizard which I cannot move to domoticz. For this reason I have written a simple Python plugin (also my fist python experience) to integrate the homewizard.

Please have a look at it, give me comments and/or give me comments about it ;)

Github: https://github.com/rvdvoorde/domoticz-homewizard

All comments, good and bad are welcome.

Keep in mind, for the plugin system to work you need to have the latest Domoticz Beta running!
Last edited by Wobbles on Thursday 02 March 2017 19:52, edited 3 times in total.
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

@Wobble

Great initiative and initial setup completed within one minute !

I see all my HomeWizard switches and Temperature + Humidity sensors.

Still missing:
Wind
Rain
Smoke detector and other contacts (Door / Window)
Blinds
WaterMeter
Energymeters

In Domoticz log:

2017-02-28 08:45:20.486 (HomeWizard) 'Key':'Homewizard'
2017-02-28 08:45:20.486 (HomeWizard) 'HomeFolder':'/usr/local/domoticz/var/plugins/domoticz-homewizard/'
2017-02-28 08:45:20.595 (HomeWizard) Connected to the Homewizard
2017-02-28 08:45:20.595 (HomeWizard) Homewizard respone: ok
2017-02-28 08:45:20.595 (HomeWizard) Homewizard status: ok
2017-02-28 08:45:20.595 (HomeWizard) Homewizard version: 3.372
2017-02-28 08:45:20.796 (HomeWizard) Homewizard route: /telist
2017-02-28 08:45:20.858 (HomeWizard) Homewizard respone: ok
2017-02-28 08:45:20.859 (HomeWizard) Homewizard route: /enlist
2017-02-28 08:45:21.559 (HomeWizard) Homewizard respone: ok
2017-02-28 08:45:21.559 (HomeWizard) Homewizard route: /swlist
2017-02-28 08:45:21.562 Error: (HomeWizard) ----> Line 58 in /usr/local/domoticz/var/plugins/domoticz-homewizard/plugin.py, function onStart
2017-02-28 08:45:21.562 Error: (HomeWizard) ----> Line 223 in /usr/local/domoticz/var/plugins/domoticz-homewizard/plugin.py, function Switches
2017-02-28 08:45:30.194 (HomeWizard) Homewizard route: /get-status
..
2017-02-28 08:45:30.257 (HomeWizard) Homewizard route: /enlist
..
2017-02-28 08:45:40.309 (HomeWizard) Homewizard route: /get-status
..
2017-02-28 08:45:40.372 (HomeWizard) Homewizard route: /enlist
2017-02-28 08:46:20.182 (HomeWizard) Homewizard respone: ok
2017-02-28 08:46:20.182 (HomeWizard) Homewizard status: ok



Kind regards,
Rens
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Plugin - Homewizard

Post by Wobbles »

waaren wrote:@Wobble

2017-02-28 08:45:21.559 (HomeWizard) Homewizard route: /swlist
2017-02-28 08:45:21.562 Error: (HomeWizard) ----> Line 58 in /usr/local/domoticz/var/plugins/domoticz-homewizard/plugin.py, function onStart
2017-02-28 08:45:21.562 Error: (HomeWizard) ----> Line 223 in /usr/local/domoticz/var/plugins/domoticz-homewizard/plugin.py, function Switches
Hi Rens,

it seems you a a device which doesn't have the "status" key set. I have added a check for this key. After you use the last version you should also see the wind/rain meters and the energymeter.

Thanks for letting me know!
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

Hi Wobbles,

Thx for the update:

Small typo in line 97 of plugin.py (extra a after the : ) ; Wind and rain device are added after removing this and restarting Domoticz

Do you have any plans for adding the other stuff (detectors, blinds etc.) ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Plugin - Homewizard

Post by Wobbles »

Hi Waaren,

Thanks for letting me know the typo!

Yes, I plan to add more hardware for as far as I can test it. I'll keep this topic up-to-date when new things are added.
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

Sounds great,

please let me know if and how I can help testing. I still have quite a number of devices, meters and detectors connected and/or reporting to the HW
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Plugin - Homewizard

Post by Wobbles »

waaren wrote:Sounds great,

please let me know if and how I can help testing. I still have quite a number of devices, meters and detectors connected and/or reporting to the HW
Thanks for the offer and I will followup on it 8-)
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
brogen67
Posts: 17
Joined: Wednesday 01 March 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by brogen67 »

Hi guys,

Thanks Wobbles for the share ! I was looking for something like that for many months !

So, I want to try the plugin, but... I need some help :s Don't really know how to use a plugin...

I have a raspberry pi 3, with the domoticz rom.

I didn't have any "plugins". I created it on /home/pi/domoticz/ and then I created a "homewizard" directory too.

So I have now : /home/pi/domoticz/plugins/homewizard/plugin.py. I copy/pasted the content in the plugin.py.

After reboot, I have nothing... So i tried to follow : http://www.domoticz.com/wiki/Linux#Prob ... ing_Python

But after reboot, still nothing :s

Any advice please ?
hendrikus
Posts: 1
Joined: Wednesday 01 March 2017 20:27
Target OS: Linux
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by hendrikus »

sorry, ik kan het engels best lezen, maar niet schijven :(
maar ik ben ook er al weken mee bezig Domoticz en Homewizard te koppelen, dus het zou mooi zijn als dit werkt.
tevens ben ik op zoek naar een oplossing om Domoticz te laten praten/uitlezen van Eneco Toon.
daar kom ik ook niet helemaal uit.
je kan dan op de Toon ineens allerlei dingen extra doen, dat is erg leuk, alleen op welke manier is er communicatie met de Toon, is dat via Netwerk of via USB ? een serail zit er niet meer op, hooguit een 4-pins "telefoon"stekkertje.
maar allereerst wil ik Domoticz en Homewizard koppelen.

ik lees graag mee.

mvg Hendrikus
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

@brogen67,

there are different compiled versions of Domoticz. Are you sure you have a Domoticz version with Python PluginSystem ?
One way to check is to look at the first couple of lines in domoticz.log

2017-03-01 19:19:46.265 Domoticz V3.6800 (c)2012-2017 GizMoCuz
2017-03-01 19:19:46.265 Build Hash: e87eb0c-modified, Date: 2017-02-27 12:50:18
2017-03-01 19:19:46.266 Startup Path: /usr/local/domoticz/
2017-03-01 19:19:46.281 Sunrise: 07:27:00 SunSet:18:20:00
2017-03-01 19:19:46.281 EventSystem: reset all events...
2017-03-01 19:19:46.350 PluginSystem: Started, Python version '3.5.1'.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brogen67
Posts: 17
Joined: Wednesday 01 March 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by brogen67 »

Hi Waaren, thanks for reply.

Grr... It looks I don't have Python... Is there any way to get it ? Do I have to reinstall a new Rom :s ?

Code: Select all

2017-03-01 21:10:31.007 Domoticz V3.5877 (c)2012-2016 GizMoCuz
2017-03-01 21:10:31.010 Build Hash: 15b013c, Date: 2016-11-10 16:44:33
2017-03-01 21:10:31.012 System: Raspberry Pi
2017-03-01 21:10:31.013 Startup Path: /home/pi/domoticz/
2017-03-01 21:10:54.732 EventSystem: reset all events...
2017-03-01 21:10:54.854 WebServer(HTTP) started on address: :: with port 8085
2017-03-01 21:10:54.895 WebServer(SSL) started on address: :: with port 443
2017-03-01 21:10:54.897 Proxymanager started.
2017-03-01 21:10:54.899 TCPServer: shared server started...
2017-03-01 21:10:54.899 RxQueue: queue worker started...
2017-03-01 21:10:56.900 EventSystem: reset all events...
2017-03-01 21:10:56.901 EventSystem: reset all device statuses...
2017-03-01 21:10:56.942 EventSystem: Started
2017-03-01 21:10:57.110 RFLink: Using serial port: /dev/ttyUSB0
2017-03-01 21:10:57.400 OpenZWave: Starting...
2017-03-01 21:10:57.412 OpenZWave: Version: 1.4-2228-gbce4a88-dirty
2017-03-01 21:10:57.412 OpenZWave: using config in: /home/pi/domoticz/Config/
2017-03-01 21:10:57.623 OpenZWave: Driver Ready
2017-03-01 21:10:57.639 OpenZWave: All Nodes queried

User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

@brogen67,

If I understand the current status correctly you need the beta version of Domoticz to have the Python pluginsystem included.

You also need Python on your system.
You can check if and what version of Python is on your system by issuing the command Python --version
I am running Domoticz on a Synology NAS but I assume this conmand also works on your system.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brogen67
Posts: 17
Joined: Wednesday 01 March 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by brogen67 »

Waaren... Finally it was really more easier as I thought...

yes, the problem was because I wasn't in beta mode... but, it's really easy to switch on beta mode. For that, and for people have the same trouble, you can easly change this settings. I use this Link

So, finally, it looks all is worked for me !!!

It's totally awsome, Really. And thanks for that :-). Now I have all my domotic system in Domoticz :).

So, if I can help you by any way, ask me ^^.

EDIT : After 15 minutes... Can't login anymore on my domoticz system... Grr ^^ Going to have a look
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Plugin - Homewizard

Post by Wobbles »

Just added the doorbell, motion and contact sensors.

@brogen67, You have your system up and running again?
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
brogen67
Posts: 17
Joined: Wednesday 01 March 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by brogen67 »

Nice, thanks for update !

Mhh... Yes, system is up... but, now, can't install anymore the plugin xD. I followed same step as this morning, but impossible to get Homewizard back in hardware ^^ (it's a fresh install, with backing up the database) so, i'm looking for this problem at the moment ^^

Edit : I can Find Homewizard in the material list (but... at then end, of the list and not at the "h").And, when I choose it, i can't add it, and I don't have the "password" and "ip" fill ...
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

@Wobbles,

Great work !!

all my HomeWizard switches, dimmers, bells, wind, rain, thermometers + motion- and contact sensors are now visible and status is updated in Domoticz

Not yet: Smoke detection


"id": 10,
"name": "LM46 Rook",
"status": "no",
"type": "smoke868",
"favorite": "no",
"timestamp": "14:52",
"cameraid": null,
"lowBattery": "no",
"lastSeen": "2017-03-02 15:45:00"
}


Not yet: energylinks



"energylinks": [
{
"id": 0,
"favorite": "no",
"name": "EnergyLink",
"code": "108591",
"t1": "solar",
"c1": 1000,
"t2": "water",
"c2": 1,
"tariff": 1,
"s1": {
"po": 0,
"dayTotal": 0,
"po+": 0,
"po+t": "14:55",
"po-": 0,
"po-t": "00:01"
},
"s2": {
"po": 0,
"dayTotal": 13,
"po+": 10,
"po+t": "00:11",
"po-": 0,
"po-t": "00:01"
},
"aggregate": {
"po": 755,
"dayTotal": 0.68,
"po+": 2528,
"po+t": "00:44",
"po-": 430,
"po-t": "00:15"
},
"used": {
"po": 755,
"dayTotal": 0.68,
"po+": 2528,
"po+t": "00:44",
"po-": 430,
"po-t": "00:15"
},
"gas": {
"lastHour": 0.03,
"dayTotal": 0.03
},
"kwhindex": 0,
"wp": 0
}


response from HW on enlist query
{
"status": "ok",
"version": "3.372",
"request": {
"route": "/enlist"
},
"response": []
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brogen67
Posts: 17
Joined: Wednesday 01 March 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Plugin - Homewizard

Post by brogen67 »

I don't understand... impossible for me to get the plugin Back Oo
I made another fresh install, installed python 3.x and the lib...
All looks ok, I see "homewizard" and materials, but can't add id... don't have IP and Password fill... I have no more idea ^^

EDIT : So... Finally I tried to install Domoticz on my QNAP NAS... and here, it's working lol. PFff. I don't want Domoticz on my nas :(
So, it looks I have a problem. I have 2 dimming modules, and can't use is. There are in "utility" instead of "switches".

Here switches I don't have in domoticz

Code: Select all

    [b]Somfy[/b]
    {
      "id": 14,
      "name": "Bureau",
      "type": "somfy",
      "mode": 0,
      "favorite": "no"
    },
[b]    ITL-1000[/b]
    {
      "id": 15,
      "name": "Porte Garage",
      "type": "asun",
      "mode": 0,
      "favorite": "no"
    },
[b]    Dimmer[/b]
    {
      "id": 16,
      "name": "Salon Ventilo",
      "type": "dimmer",
      "status": "off",
      "dimlevel": 0,
      "favorite": "no"
    },
    [b]Virtual for WOL[/b]
    {
      "id": 17,
      "name": "Allumage NAS",
      "type": "virtual",
      "status": "off",
      "favorite": "no"
    },
Last edited by brogen67 on Friday 03 March 2017 20:20, edited 1 time in total.
Wobbles
Posts: 27
Joined: Thursday 03 March 2016 19:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Plugin - Homewizard

Post by Wobbles »

waaren wrote:@Wobbles,

Not yet: Smoke detection


Not yet: energylinks

Smoke detection is now added and since i don't have an energylink, thanks for posting the reply! Next step is to start with the energylink!
Raspberry PI 1, Raspberry PI 2 & Raspberry PI 3, RFXCom, Z-Wave(Aeotec ZW090 Z-Stick Gen5), Philips HUE and using the premium android app
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

Hi Wobbles,

just to let you know; I installed and tested version 2.0.0 and it's working like a charm.

Keep up the good work
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Plugin - Homewizard

Post by waaren »

Hi Wobbles,

some minutes (last occurrence 22 min after reactivation ) after starting or reactivating the plugin I see this message in domoticz.log for every cycle of the HomeWizard plugin and changes in the state of a switch in HomeWizard are not send to Domoticz.

2017-03-06 21:46:25.038 Error: PyDomoticz_Connect, connection request from 'HomeWizard' ignored. Transport is already connected.
2017-03-06 21:46:25.038 Error: (HomeWizard) Current transport is still connected, directive ignored.


Do you have an idea what might cause this ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests