Mysensor contact sensor not updating status!

Moderator: leecollings

Post Reply
bp968
Posts: 3
Joined: Friday 11 December 2015 9:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Mysensor contact sensor not updating status!

Post by bp968 »

I'm using the sketch for the binaryswitchsensor and it connects to the ESP8266 gateway and shows up as a switch but shows "Closed" and never seens to change its status. Watching the serial monitor I see the arduino picking up that im moving the magnet next to and away from the sensor, but the controller doesn't seem to "see" those changes!?

Here is what I see on the serial monitor (0=sensor touching, 1=sensor "open" not touching):

sensor started, id=3, parent=0, distance=1
send: 3-3-0-0 s=3,c=0,t=0,pt=0,l=0,sg=0,st=ok:
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=fail:1
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:1
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:1
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:1
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:1
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:0
send: 3-3-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=ok:1

It seems to default to Type as "Lighting 2" and Subtype "AC" in the devices section of Domoticz and I thought changing that might help but it doesn't seem to be possible to edit those values (I can't find them anywhere). I'll add 3 photos showing what I'm seeing in the various screens on Domoticz:

Image

Image

Image

I tried updating to the latest beta build as suggested over on the mysensors forum but that didn't help either. I also checked the serial monitor on the gateway and its getting open/closed updates from the contact sensor, it just doesn't seem to make it to Domonticz or Domoticz is ignoring it. Nothing in the logs on domoticz either!

Thanks for any help you can give!
malarcy
Posts: 50
Joined: Sunday 15 November 2015 13:36
Target OS: Linux
Domoticz version:
Contact:

Re: Mysensor contact sensor not updating status!

Post by malarcy »

Largely a guess here - but I know that the Mysensors code "uses" Lighting 2 "scheme" so thats why domoticz refers to the devices as "Lighting 2" - don't think you can change it and I suspect it doesn't matter in this case - but I don't know for sure - I have only spent about 20 mins in the mysensors code.

On to the problem - on the face of it seems like it should be OK - but I notice in your 3rd picture that the Last Seen time for Security Sensor is about an hour and 20 mins earlier than the temp/hum one.

Does that match the startup time of the sensor - I am wondering if the problem is in the mysensor code in the gateware.present section rather than in the gatway.send - i.e. if the sensor is presenting to domoticz then it may be ignoring the incoming "set" messages?

As I say - a guess - but perhaps there is something there - if the sensor is presenting correctly - then you should see the current time when you restart the sensor in the devices screen.

Hope this helps (and perhaps post your sketch for the sensor end?)
bp968
Posts: 3
Joined: Friday 11 December 2015 9:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mysensor contact sensor not updating status!

Post by bp968 »

Thanks so much for the help, your suggestions made me look at the gateway as the probable issue again since the sensors seemed to be sending data and the gateway seemed to be getting data but it wasn't making it domonticz and in addition the gateway was doing "weird" things like randomly rebooting. I build a standard ethernet gateway with a Arduino UNO and a WIZ5100 ethernet shield I had and it took right off and domonicz started "seeing" all the sensors!

I'd still like to figure out whats going on with the ESP8266 setups since it makes placement a little easier and requires less hardware, but I probably won't need more then 2 gateways anyway so I'm sure ill be able to figure something out!

Any ideas on why the ESP8266 is rebooting? I'm going to post about it in the 8266 thread over on mysensors.org.
malarcy
Posts: 50
Joined: Sunday 15 November 2015 13:36
Target OS: Linux
Domoticz version:
Contact:

Re: Mysensor contact sensor not updating status!

Post by malarcy »

Not had any experience with the ESP8266.

As a general rule of thumb when faced with random reboots I lean towards power supply - is it stable, is it giving enough power etc.

There's always the possibility of a faulty device - hard to figure out if you only have one but if you had another a simple swap might stop it driving you crazy.
bp968
Posts: 3
Joined: Friday 11 December 2015 9:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mysensor contact sensor not updating status!

Post by bp968 »

malarcy wrote:Not had any experience with the ESP8266.

As a general rule of thumb when faced with random reboots I lean towards power supply - is it stable, is it giving enough power etc.

There's always the possibility of a faulty device - hard to figure out if you only have one but if you had another a simple swap might stop it driving you crazy.
Way ahead of you on that one, I bought two of those ESP8266 NodeMCU boards from two different sellers. Both have the same issue with mysensors and rebooting but both also seem to handle other projects/tests fine. I wired it just like they show on mysensors.org so I didn't add a seperarate 3.3v supply, I just used the 3.3v line from the esp8266 like they did in the example.

Regardless, it *seems* to work fine with the WIZ5100 setup now. Except now I have a new issue I'll post a new question about.. :(
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest