Domoticz full integration
-
@bjornhallberg did you call for a c++ ninja? ;-)
@Yveaux Haha, yeah, but in all honestly I'm not expecting or suggesting anyone here do their work for them. If they had any sense they would have had support for MQTT and such years ago. And an infrastructure in place for user plugins. I'm such a sad sod that I actually subscribe to the RSS feed for Domoticz commits (for a few months now, as I do with many of these HA software) and I can't say I'm often surprised by anything they put into the code.
On the other hand Domoticz has a lot going for it, including pretty decent graphs that work out of the box. It has blockly. And it has native code. And its JSON API isn't half bad either. I mean, I did try the script by @epierre for a while and I could have settled for hard coding sensor input into Domoticz ... but now I've scrapped the serial gateway due to issues brought up in the other thread and I'm back to either the MQTT or Ethernet gateway so no more Domoticz input. Unless I get a new single-board computer or NUC or whatever to interface with.
-
@Yveaux Haha, yeah, but in all honestly I'm not expecting or suggesting anyone here do their work for them. If they had any sense they would have had support for MQTT and such years ago. And an infrastructure in place for user plugins. I'm such a sad sod that I actually subscribe to the RSS feed for Domoticz commits (for a few months now, as I do with many of these HA software) and I can't say I'm often surprised by anything they put into the code.
On the other hand Domoticz has a lot going for it, including pretty decent graphs that work out of the box. It has blockly. And it has native code. And its JSON API isn't half bad either. I mean, I did try the script by @epierre for a while and I could have settled for hard coding sensor input into Domoticz ... but now I've scrapped the serial gateway due to issues brought up in the other thread and I'm back to either the MQTT or Ethernet gateway so no more Domoticz input. Unless I get a new single-board computer or NUC or whatever to interface with.
@bjornhallberg What do you mean by :
but now I've scrapped the serial gateway due to issues brought up in the other thread and I'm back to either the MQTT or Ethernet gateway so no more Domoticz input. Unless I get a new single-board computer or NUC or whatever to interface with.Domoticz is perfect for 433Mhz users supported by the rfxtrx, which is its origin. Here you need to code, flash, wire, power, find a box... not for the faintest of heart... clearly not a plug and play philosophy of Domoticz. This is why I'm wopndering so many people ask for the integration but actually don't report questions on sketches or issues, are there are many...
-
@bjornhallberg What do you mean by :
but now I've scrapped the serial gateway due to issues brought up in the other thread and I'm back to either the MQTT or Ethernet gateway so no more Domoticz input. Unless I get a new single-board computer or NUC or whatever to interface with.Domoticz is perfect for 433Mhz users supported by the rfxtrx, which is its origin. Here you need to code, flash, wire, power, find a box... not for the faintest of heart... clearly not a plug and play philosophy of Domoticz. This is why I'm wopndering so many people ask for the integration but actually don't report questions on sketches or issues, are there are many...
@epierre I just meant that I used to have an Arduino Nano + NRF24 PA LNA connected to my Raspberry, but due to some issue or another (I'm not sure) it wouldn't work properly. Perhaps the power draw on the 3.3V. Perhaps the two extra walls between the Raspberry and where I currently have the MQTT gateway. Perhaps interference from some other piece of electronic inside the cramped camera housing. Who knows.
Of course moving away from serial gateway means a world of trouble as most controllers and such have plugins made with that gateway in mind. IF I get a new computer to host a serial gateway, it would have to be many, many times faster than the Raspberry and preferably x86. With only slightly higher idle power consumption. Only the latest generation i3 and i5 NUCs match that description.
Right now I'm looking into paho-mqtt for python and making a script much like yours that uses the JSON API to update virtual sensors inside Domoticz. I'm almost there I hope. It's not pretty but trying to get some of these other HA solutions to work is like banging your head against a brick wall. At least with Domoticz you have a great deal going for you out of the box. Like graphing which I mentioned above. Seeing all these new and fantastic JS graphing solutions, you sort of get a bit spoiled. Domoticz has some of the best graphs imo, even if that isn't saying much.
-
@epierre I just meant that I used to have an Arduino Nano + NRF24 PA LNA connected to my Raspberry, but due to some issue or another (I'm not sure) it wouldn't work properly. Perhaps the power draw on the 3.3V. Perhaps the two extra walls between the Raspberry and where I currently have the MQTT gateway. Perhaps interference from some other piece of electronic inside the cramped camera housing. Who knows.
Of course moving away from serial gateway means a world of trouble as most controllers and such have plugins made with that gateway in mind. IF I get a new computer to host a serial gateway, it would have to be many, many times faster than the Raspberry and preferably x86. With only slightly higher idle power consumption. Only the latest generation i3 and i5 NUCs match that description.
Right now I'm looking into paho-mqtt for python and making a script much like yours that uses the JSON API to update virtual sensors inside Domoticz. I'm almost there I hope. It's not pretty but trying to get some of these other HA solutions to work is like banging your head against a brick wall. At least with Domoticz you have a great deal going for you out of the box. Like graphing which I mentioned above. Seeing all these new and fantastic JS graphing solutions, you sort of get a bit spoiled. Domoticz has some of the best graphs imo, even if that isn't saying much.
@bjornhallberg intel is not the only way... for $50 there is the banana-pi ... I've moved from raspi to a cubie 2 in urgency, latest domoticz updates made it impossible to live on a raspi... with only rfxtrx and JSON updates... the cubie 2 is a bi-core A20 and my cpuload is 10% at worse... in raspi it was 100%... for a better community support the odroid is way faster and better supported (quad core, the samsung S3 ekynos processor just to name it) but is twice the price.
-
In the quest for Domoticz full integration, I have been doing some prototyping in Python. Domoticz has very capable JSON support and virtual device types so we can do without "full integration" .
My python script is built around a 'dictionary' based Database with a hardcoded MySensor-Domoticz translation. The script is running stable with 20+ sensor/actuators and limited cpu load on raspberry pi (15%).What is next:
- dynamic sensor inclusion i.s.o. fixed nodes.
- more sensor types and support for combined devices (e.g. Temp, Hum, Baro)
- (sqlite i.s.o. python dictionary)
dependencies: requests, json
anybody interested?
You can find the attempt at: Domoticz-MySensors
all suggestions welcome.. -
In the quest for Domoticz full integration, I have been doing some prototyping in Python. Domoticz has very capable JSON support and virtual device types so we can do without "full integration" .
My python script is built around a 'dictionary' based Database with a hardcoded MySensor-Domoticz translation. The script is running stable with 20+ sensor/actuators and limited cpu load on raspberry pi (15%).What is next:
- dynamic sensor inclusion i.s.o. fixed nodes.
- more sensor types and support for combined devices (e.g. Temp, Hum, Baro)
- (sqlite i.s.o. python dictionary)
dependencies: requests, json
anybody interested?
You can find the attempt at: Domoticz-MySensors
all suggestions welcome.. -
In the quest for Domoticz full integration, I have been doing some prototyping in Python. Domoticz has very capable JSON support and virtual device types so we can do without "full integration" .
My python script is built around a 'dictionary' based Database with a hardcoded MySensor-Domoticz translation. The script is running stable with 20+ sensor/actuators and limited cpu load on raspberry pi (15%).What is next:
- dynamic sensor inclusion i.s.o. fixed nodes.
- more sensor types and support for combined devices (e.g. Temp, Hum, Baro)
- (sqlite i.s.o. python dictionary)
dependencies: requests, json
anybody interested?
You can find the attempt at: Domoticz-MySensors
all suggestions welcome..@AWI That would be pretty awesome!
If I can help anyhow, just say so.Currently I'm running Domoticz with custom-built gateway on MEGA, but could probably start switching whole thing to MySensors as whole setup use nRF24L01 :-)
How can I help? Or is it ready for tests?
-
@AWI That would be pretty awesome!
If I can help anyhow, just say so.Currently I'm running Domoticz with custom-built gateway on MEGA, but could probably start switching whole thing to MySensors as whole setup use nRF24L01 :-)
How can I help? Or is it ready for tests?
-
@andriej It is ready for test. Just edit the your setup in the header and adapt "Sensor_DB" to your setup. Nothing really fancy.
@AWI I'm after first test and that's what I get just after running the code:
# python mysensors-dom.py 2015-01-17 02:59:41 Start ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) 0;0;3;0;14;Gateway startup complete. ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',))Are these desired messages?
What I'm supposed to do later on? -
@AWI I'm after first test and that's what I get just after running the code:
# python mysensors-dom.py 2015-01-17 02:59:41 Start ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',)) 0;0;3;0;14;Gateway startup complete. ('Wrong/No input from MySensors gateway', ValueError('No JSON object could be decoded',))Are these desired messages?
What I'm supposed to do later on?I've managed to get it to work.
First issue - since always I've reported temperature and humidity altogether (from DHT sensors).
Currently I can't specify one IDX for two values and I can't see in code where I could put two values to report in Domoticz at once.
They use to be reported in one URL. -
Good to see you are taking the jump... What you see in the first test is are generic error messages which can be generated in many place. There is a "catch-all" exception handler on the main loop, I suggest you take out the word "ValueError". After that the script will come to a halt and indicate where it went wrong.
I am 'almost' in the next major update. I hope to upload today .
Good luck!
-
@hek I am almost done with the python -Domoticz "full integration" but strugling with a few message types. The code for Vera is a good source for information but it is hard to determine the role of the controller in the construction/routing of the network. For now I assumed only node numbering and keeping track of the sensors. Is the controller supposed to do something with the relay nodes? what is the function of the I_CHILDREN message?
-
I've managed to get it to work.
First issue - since always I've reported temperature and humidity altogether (from DHT sensors).
Currently I can't specify one IDX for two values and I can't see in code where I could put two values to report in Domoticz at once.
They use to be reported in one URL.@andriej I will be posting a new version tomorrow which adds maximum functionality for Domoticz (from my view): combined sensors (trick), node numbering, inclusion and an external database in JSON. I will keep it running tonight to test the stability. ...
-
Major update (but still very beta...,) supports:
- dynamic sensor inclusion i.s.o. fixed nodes.
- more sensor types and support for combined domoticz devices (e.g. Temp, Hum, Baro)
- external JSON database
The python script is built around a 'dictionary' based Database with the MySensor-Domoticz translation. The script is running stable with 20+ sensor/actuators and limited cpu load on raspberry pi (15%).
Known issues:
- You need to edit the JSON database yourself if you need combined Domoticz devices eg. (Temp/Hum/Baro). Not difficult
- Need to create Switch types yourself in Domoticz , then assign these in the database
- Usage/power not supported yet (need a "multiple value" trick..)
You can find the attempt at: Domoticz-MySensors with a small instruction in the first few lines
all suggestions welcome..
-
Domoticz:
Starting with a native implementation, thanks to Ad for providing the RF interfaces.
Maybe best (for domoticz) to continue on the forum,
i need serial logs of all possible combinations and meaningnode-id;child-sensor-id;message-type;ack;sub-type;payload
we developers probably have to do some special tricks to get some nice sensors
for instance, it would be nice if there where subtypes for:
- Temp+Hum
- Temp+Hum+Baro
- Kwh+Watt
- Wind+Gust+Direction
I can not watch this forum, if you want to contribute, plz use the domoticz forum
-
Domoticz:
Starting with a native implementation, thanks to Ad for providing the RF interfaces.
Maybe best (for domoticz) to continue on the forum,
i need serial logs of all possible combinations and meaningnode-id;child-sensor-id;message-type;ack;sub-type;payload
we developers probably have to do some special tricks to get some nice sensors
for instance, it would be nice if there where subtypes for:
- Temp+Hum
- Temp+Hum+Baro
- Kwh+Watt
- Wind+Gust+Direction
I can not watch this forum, if you want to contribute, plz use the domoticz forum
-
In latest release of Domoticz I can see first implementations of MySensors!
Maybe it's worth a shot for someone to register on Domoticz forum and help their team out?