MySensors - Gateway to Domoticz

Moderator: leecollings

Post Reply
joshmosh
Posts: 19
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MySensors - Gateway to Domoticz

Post by joshmosh »

Good morning,
I am Josh and quite new to all this. Up to know, I did all my home automatisation with homebrew stuff on my Raspi's, written in Python.
Now I found that a combination of MySensors and Domoticz is way better than what I did myself.

I have used MySensors USB serial gateway. Works fine. I thought that I could use the same gateway with the Arduino pro mini connecting
it directly to the serial port (/dev/ttyAMA0) of the Arduino, but this device cannot selected in Domoticz. Only /dev/ttyACM0 is shown.
For a number of reasons I would like to avoid USB-to-serial converter inbetween. Any suggestions how that could be done ?

Thank you very much for Domoticz, it is exactly what I was looking for !

Cheers
Josh
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

GMorning ;)

Could you try the following:
- try to create an udev rule (see the persistent devices wiki)
maybe that allows you access to the ttyAMA0 (if you route it to ttyUSB20 for example)

- for the ttyAMA0 to be available you have to free this port, as its normally used as serial console.
(one of the steps is to remove the ttyAMA0 reference in /boot/cmdline.txt)
see http://www.hobbytronics.co.uk/raspberry-pi-serial-port

Hope this works....
Quality outlives Quantity!
rachmat
Posts: 8
Joined: Wednesday 04 February 2015 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: MySensors - Gateway to Domoticz

Post by rachmat »

Hello,
I Think there is lot of bugs lately, domoticz sometimes create new device for exiting device, screenshoot attached it creates new lux sensor several times. and also with my humidity+temp dht11 device, domoticz often create exiting humidity and temp device separately. I use domoticz 2358
Attachments
Screen Shot 2015-04-06 at 19.16.50 (2).png
Screen Shot 2015-04-06 at 19.16.50 (2).png (316.54 KiB) Viewed 5914 times
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

Dont think this is an domoticz problem, seems your child id's are changing ? (or your node id's)
Atleast no issues here

Could also indicate problems with the serial gateway, you used the sketch as-is, or did you modify the sketch?
Could also indicate your nodes do not remember the ID ?
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

Another thing, yes temp/humidity could be created separate, depends on what it receives first.
Do you use the 'present' option in the setup to present the temp and humidity sensor?

Problem is, the 'present' will only be send when the node powers on, so if you restart domoticz, it could happen, but this is no big issue is it ?
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

New update for a combined Temp+Hum+Baro sensor, now using correct ID, and battery level
Quality outlives Quantity!
joshmosh
Posts: 19
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MySensors - Gateway to Domoticz

Post by joshmosh »

gizmocuz wrote:GMorning ;)

Could you try the following:
- try to create an udev rule (see the persistent devices wiki)
maybe that allows you access to the ttyAMA0 (if you route it to ttyUSB20 for example)

- for the ttyAMA0 to be available you have to free this port, as its normally used as serial console.
(one of the steps is to remove the ttyAMA0 reference in /boot/cmdline.txt)
see http://www.hobbytronics.co.uk/raspberry-pi-serial-port

Hope this works....
Thank you for your hint. Yes, it worked, but in a different way. Having read the wiki, I was a bit lost, because I had no idea how to set up a rule for a (dummy) USB device without manufacturer id, serial etc. So I used the example given and created a USB device with mknod -> ttyUSB22. After that I had still no idea how to set up a udev rule. Then I tried to define a second MySensors USB gateway with the freshly created ttyUSB22. Surprise, surprise: now not only ttyAMC0 and ttyUSB22 were shown but ttyAMA0 as well !
Next will be to connect one of my Arduino pro minis using the TX/RX pins directly.
Very good.
Thanks a lot
Josh
floris74
Posts: 75
Joined: Sunday 30 November 2014 8:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hoorn, Netherlands
Contact:

Re: MySensors - Gateway to Domoticz

Post by floris74 »

Hi,

The mysensors network is getting better and better. sometimes there is a failure switching a relay, which i can see in the serial monitor. It seems that domoticz doesn't get this information. Maybe, if domoticz can see that information, it can sent the switch-command once again, otherwise it will be out of sync. (maybe an idea, when it fails, domoticz tries 3 times, and when there is still not an 'ok´ message, domoticz will sent an failure-notification.

Floris
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

Would be better if this was handled in the controller.
I am not very much experienced with MySensors, but if i would send with the acknowledge option enabled, will this let the controller send it multiple times until it received an acknowledge back from the node ?
Quality outlives Quantity!
floris74
Posts: 75
Joined: Sunday 30 November 2014 8:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hoorn, Netherlands
Contact:

Re: MySensors - Gateway to Domoticz

Post by floris74 »

I ḿ sure that my knowledge is zero, about mysensors. I don't know how to implement it in the controller. Maybe you can implement the acknowledge option into domoticz. that would be great.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

No, maybe it is already part of the serial/ethernet controller.
(Would be a good thing)
Quality outlives Quantity!
andriej
Posts: 46
Joined: Tuesday 10 December 2013 22:27
Target OS: Linux
Domoticz version: beta
Contact:

Re: MySensors - Gateway to Domoticz

Post by andriej »

For sure there's a bug in (?) somewhat managing a multiple sensors.
For nodes (which didn't change anything by itself), after reset of gateway (serial/ethernet, doesn't matter), sometimes domoticz 'sees' a node as a seperate device (humidity or temperature).
Situation fixes after fewteen minutes and then domoticz gets report for both values in one sensor.

Anyway - thank you for ongoing development of MySensors - it's getting better all the time!
I'm actually wating for arrival of new sensors and will be deploying new nodes.
Would be nice if other sensors type could be implemented too.

Regards
Orange Pi (@ Debian) / MySensors Serial / GPIO / Custom Serial 433 MHz Transmitter (for plug switches and livolo wall switches) / JSON&Bash API scripts
rachmat
Posts: 8
Joined: Wednesday 04 February 2015 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: MySensors - Gateway to Domoticz

Post by rachmat »

gizmocuz wrote:Dont think this is an domoticz problem, seems your child id's are changing ? (or your node id's)
Atleast no issues here

Could also indicate problems with the serial gateway, you used the sketch as-is, or did you modify the sketch?
Could also indicate your nodes do not remember the ID ?
I didn't change the sketch, I use default sketch on mysensors web, I will try to log from gateway and compare it with the time in domoticz. Maybe the problem with my microcontroller, I will check it and update the info if the problem continue. anyway thank you very much for your respose.

regards,

Aditiya
hahi
Posts: 12
Joined: Wednesday 08 April 2015 18:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MySensors - Gateway to Domoticz

Post by hahi »

@gizmocuz

Hi, anyway to get the units set according to the settings --> Meters/Counters option for Temperature units? Metric == "M" or Fahrenheit == "I" ? Currently the controller only responds with "M" when a node requests the untis config from the controller.

http://sourceforge.net/p/domoticz/code/ ... e.cpp#l837

edit:

One of my nodes has a relay(s) and a "run time" (sprinklers) variable is defined as a custom V_VAR. I can see this is correctly set in the sqlite DB and the node can update/read this custom VAR correctly, but is there a way to update the value via the GUI? Maybe a lua script or a device config option?
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MySensors - Gateway to Domoticz

Post by gizmocuz »

Yes, indeed, so you use 'M' !
In domoticz you can set it to use 'Fahrenheit' and it will be real-time translated.
:mrgreen:
Quality outlives Quantity!
andriej
Posts: 46
Joined: Tuesday 10 December 2013 22:27
Target OS: Linux
Domoticz version: beta
Contact:

Re: MySensors - Gateway to Domoticz

Post by andriej »

I have a question about MySensors electric counter - why, even if node sends to GW the counter value (stored in VAR?), I can't see a momentum pulse counter?
So in example there would be possibility to show that current Watt's usage of house is X...

Now it just says 0 Watt all the time.
Orange Pi (@ Debian) / MySensors Serial / GPIO / Custom Serial 433 MHz Transmitter (for plug switches and livolo wall switches) / JSON&Bash API scripts
hahi
Posts: 12
Joined: Wednesday 08 April 2015 18:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MySensors - Gateway to Domoticz

Post by hahi »

Does the lua scripting have access to the MySensorsVars? I have tried dumping the keys for otherdevices_svalues and otherdevices but I don't see the custom V_VAR's listed. I have one set but I can't access it via lua?

sqlite> select * from MySensorsVars;
2|10|14|25|10
andriej
Posts: 46
Joined: Tuesday 10 December 2013 22:27
Target OS: Linux
Domoticz version: beta
Contact:

Re: MySensors - Gateway to Domoticz

Post by andriej »

Is anyone here using electric energy pulse meter (1000 imp/kWh)?
I'm using one and it looks like 'current usage' shown by Domoticz is not updated that often to show i.e. turned on heating or other high-usage device...

Also the chart is rather flatty, so values doesn't change often.

Earlier I had own protocol and I was able to send pulses to domoticz every minute with value of current usage, which gave more accurate view on usage.
What's more - kWh seems to be counted ok...

Anyone else can share their chart to compare?
Orange Pi (@ Debian) / MySensors Serial / GPIO / Custom Serial 433 MHz Transmitter (for plug switches and livolo wall switches) / JSON&Bash API scripts
joshmosh
Posts: 19
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MySensors - Gateway to Domoticz

Post by joshmosh »

Hi,
I am not sure if this is the right place for my question - if not, please bear with me.
If have set up a MySensors node with two sensors of type S_LIGHT. They are presented to Domoticz and show up in the device list - fine. My idea is to use the sensors as remote on/off switches. When I operate the switches in the switch tab (for testing, later by a script), I see that Domticz switches them on and off - fine.
My thinking was that in my sketch in the node I could check the status of the switches by sending a REQ to Domotcz and would get an answer. But this does not happen. Every 10 seconds I am sending a REQ, with the child id of one of the switches and V_LIGHT as type, but there is no reaction - I am monitoring the serial link between Domoticz and my gateway. Any idea what I am doing wrong or where my misunderstanding is ?
Thanks a lot for your help
Josh
Flyingdodo
Posts: 2
Joined: Sunday 10 November 2013 15:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: MySensors - Gateway to Domoticz

Post by Flyingdodo »

Hi Josh,

I think you can send REQ to other Mysensors devices, not directly to domoticz. I think it is possible to do a request to the gateway and the gateway makes a request to domoticz, but you need to implement this yourself.
If you look in the Mysensors API youll find this at the requesting data tab:

Requests a variable value from gateway or some other sensor in the radio network. Make sure to add callback-method in begin-method to handle request responses. If you send this request to some other sensor-node you must handle the reply message yourself in the destination node.

Code: Select all

void request(uint8_t childSensorId, uint8_t variableType, uint8_t destination);
childSensorId - The unique child id for the different sensors connected to this Arduino. 0-254.
variableType - The variableType to fetch.
destination - The nodeId of other node to request data from in radio network. Default is gateway.

So you need to handle the request yourself.
I hope this helps you.

Robbert
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest