Page 1 of 2
Domoticz and Arduino sensors over usb
Posted: Sunday 30 October 2016 19:11
by Sickboy
Hi,
I have some question: can i connect arduino with sensors to domoticz over usb? I dont need radio transmission - I have UTP cable over in my house (for Deimic IoT system). I just want connect some sensors (like ds 18b20) to arduino. Arduino connect to computer with fedora linux OS over usb. Next I want to show temp in domoticz.

- Zrzut ekranu z 2016-10-30 19-10-24.png (20.59 KiB) Viewed 16528 times
It is possible?
Re: Domoticz and Arduino sensors over usb
Posted: Sunday 30 October 2016 21:16
by Flopp
If you use MySensors it shall be possible with version 2.0. I am using version 1.5.4 so I have not tested it myself.
Re: Domoticz and Arduino sensors over usb
Posted: Monday 31 October 2016 8:17
by gizmocuz
If you use a raspberry pi, you can use 1-wire with the 18b20 sensors, you can take away the arduino
But do you have utp everywhere ? (Bathroom, cellar, on the roof, ...?)
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 01 November 2016 11:10
by Sickboy
Yeah, everywhere.
I think about raspberry, but it have only 20 outputs...arduino mega have much more...
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 01 November 2016 16:25
by Flopp
If you will use OneWire temperature sensor it only use one input
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 01 November 2016 17:31
by Sickboy
Ok, so tell me which skecht i must use to domoticz see my one-wire sensor...
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 01 November 2016 18:50
by antwan
No sketch, but use the build in 1 wire support under hardware
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 01 November 2016 23:03
by Derik
Why not espeasy?
Re: Domoticz and Arduino sensors over usb
Posted: Friday 06 January 2017 23:45
by still
This is what I also want to do.... I also have a PC that is my Domoticz controller that doesn't have any IO that I can connect any 1 wire units on... So it is not possible to do as Flopp and antwan suggests. And I don't want to use a RPi of a lot of reasons.
@Sickboy..
Did you get it working? Did you find out how to create a Arduino project?
Re: Domoticz and Arduino sensors over usb
Posted: Saturday 07 January 2017 7:42
by Flopp
still wrote:This is what I also want to do.... I also have a PC that is my Domoticz controller that doesn't have any IO that I can connect any 1 wire units on... So it is not possible to do as Flopp and antwan suggests. And I don't want to use a RPi of a lot of reasons.
Go to
www.mysensors.org and check how to build a gateway
https://www.mysensors.org/build/serial_gateway then build a temperature sensor node
https://www.mysensors.org/build/temp
Check on Build section and you see that you can build a node that can read almost any sensor, you can also combine different type of sensors to one node, and send the data to DZ.
If you have any questions about MySensors I can try to help you, check out MySensors forum
https://forum.mysensors.org/
Good luck
Re: Domoticz and Arduino sensors over usb
Posted: Sunday 08 January 2017 14:28
by still
@flopp
To use mysensor demands an Arduino that also must be a specific ones. I tried it with my Arduino micro pro but MySensor destroyed the bootloader + I don't have any need for a radio gateway.
So how to use MySensor without the radio interface and other "behind the scenes" things that happens in MySensors? Like only the serial interface?
Re: Domoticz and Arduino sensors over usb
Posted: Sunday 08 January 2017 14:31
by Flopp
still wrote:@flopp
To use mysensor demands an Arduino that also must be a specific ones. I tried it with my Arduino micro pro but MySensor destroyed the bootloader + I don't have any need for a radio gateway.
So how to use MySensor without the radio interface and other "behind the scenes" things that happens in MySensors? Like only the serial interface?
Hi, that I have not tried.
Search at MySensors forum and you will find information how to use MySensors in Domoticz without Gateway. I think it is still in development stage and I am now sure that DZ can handle that yet.
Re: Domoticz and Arduino sensors over usb
Posted: Friday 13 January 2017 10:42
by RidingTheFlow
MySensors serial protocol is extremely simple (
https://www.mysensors.org/download/serial_api_20). All you just need your Arduino sensor sketch to print simple strings like "12;6;0;0;3;My Light\n" to USB serial.
Then connect Arduinos to domoticz as mysensors serial gateways each. I also have most of my house using wired USB for sensor/actuator network and it works very well, and I don't even use mysensors library.
Re: Domoticz and Arduino sensors over usb
Posted: Thursday 02 February 2017 8:05
by still
That is also my expression and I have tried it but I can't get it working
I have a power meter there I count the flashing LED. That detection and calculation works
I can see on the serial device that the Arduino sends watt,kwh and the counter values to Domotics but only the two last ones are received.
$ sudo cat /dev/ttyACM-ElCounter
0;1;1;0;17;1892
0;1;1;0;24;580825
0;1;1;0;18;580.8250
The Domoticz Node display look like below
Some stange things.
It seems that I have both messages at the start but then the watt message is ignored
And one strange thing... wattMsg have ID 0000000 and kwhMsg has ID 0000001
Should I have different child id in the messages??
Its also looks that the only children (#1) inlcudes both data (watt and kwh)
And when using the library I have seen during debugging that the presentation() function is never called.
Any ideas? Where to start?
Re: Domoticz and Arduino sensors over usb
Posted: Thursday 09 February 2017 23:35
by RidingTheFlow
AFAIK node id 0 reserved for gateway - you should not use it for sensors.
I would recommend having different child Id per sensor, but same (non-zero) node Id - this should allow domoticz to know that they are for same meter.
Also I don't see the presentation message. Domoticz will try to auto-detect, but present is recommended on start to let it properly know that this is power measuring device.
And when using the library I have seen during debugging that the presentation() function is never called.
Can't help you with that, I don't use mysensors library - last time I've tried it, it didn't actually support such mode of operation (direct sensor connection), and its just a waste of memory for such simple use case, since it contains tons of unnecessary things (e.g. node discovery, routing, etc).
I just use a Serial.println

Re: Domoticz and Arduino sensors over usb
Posted: Thursday 16 March 2017 22:40
by still
@RidingTheFlow Thanks but sorry.. I haven't seen your answer until some days ago...
I tested your suggestion. Changing node id didn't help but using different child id showed that both data is actually used. It is just hard to understand that both watt and kwh values are used in the same diagram in Domoticz. I had seen both values but I have thought the program itself calculated the watt value..
So the values are fine
I have also tried the to send the presentation message and also schematics name & version message but there is no difference in the node/sensor presentations seen in Domoticz. It seems it doesn't care about it. I have also seen there is both a command presentation (I have used that) but also an internal subcommand I_PRESENTATION. What to use?
And then so one thing that is more annoying thing is that Domoticz doesn't answer on C_REQ for a VAR1 questions..
PS.
This about the library size.... I would like to modulize it but it seems that no one thinks that is needed....
Maybe its time to write an own "communication library" that only contain the communication part....
Re: Domoticz and Arduino sensors over usb
Posted: Monday 20 March 2017 12:46
by RidingTheFlow
Don't use I_PRESENTATION. Commands starting with I_ are sent between nodes and gateway.
When direct USB connect, you actually making a gateway (which has nodes inside it).
Re: Domoticz and Arduino sensors over usb
Posted: Tuesday 21 March 2017 22:18
by still
Ok that isn't easy to understand.. But how about the I_SKETCH_NAME and VERSION? Should I send them? In any case I don't get any different result. No indication in Domoticz. But it would be nice if I could see the version of the code....
One other this is this with C_REQ that doesn't seems to work. Domoticz doesn't answer

Re: Domoticz and Arduino sensors over usb
Posted: Wednesday 22 March 2017 15:45
by RidingTheFlow
I believe you can try sending sketch version, but it should be sent "from sensor" (not from gateway).
E.g.
Serial.println("1;1;3;0;12;2.0.1")
Not sure where domoticz will show it (and if it actually will show it anywhere at all).
mysensors seem to have lot of commands "for future use" that current domoticz does not (fully) support.
Re: Domoticz and Arduino sensors over usb
Posted: Wednesday 05 April 2017 12:30
by JohnnySK
Hi, did somebody solve something?
I want to have Arduino MEGA direct on Domoticz PC too..
It is some python-serial plugin with universal structure already developed or not?