Page 1 of 1

S_LOCK device

Posted: Monday 21 September 2015 20:36
by fets
Hello,
Please forgive my english which is not my native language : I'm french
I'm new to the forum and domoticz (which seems to be quite powerfull) and young too with mysensors.

I would like to control my garage door using domoticz/mysensors.
In order to open/close my door, I have to use a relay and close the contacts for a second or 2.
So I created a node : S_LOCK.
But, in domoticz device interface, it appears as Lighting 2 :shock:
I managed to change type using EDIT feature but can't find something matching my expectation.
What have I wrong ?
What domoticz type do I have to use ?
I tried Push Off Button but my arduino sketch received a message with type V_LIGHT (2) instead of V_LOCK_STATUS (36) which not seems good.
Does somebody experienced the same issue ?

In a second time I would like to send the door status (open or closed) obtained using reed switches in order to see the current state in domoticz interface.
So I plan to use a message typed V_LOCK_STATUS and send it according the reed switch state.
How could I do that ?

Thanks for any answer.
Regards

Re: S_LOCK device

Posted: Sunday 27 September 2015 11:19
by gizmocuz
which version of domoticz are you using?

There have been many changes for mysensors recently.

You should get a light switch, you can set the type to 'door' if you want, or just add a custom icon and leave it as an on/off switch

when you send a switch command from domoticz, it should send the message with V_LOCK_STATUS

Re: S_LOCK device

Posted: Sunday 27 September 2015 12:43
by fets
Hi thanks for your answer gizmocuz
I'm running V2.2969 on a raspberry pi2.

My node present itself as :
send: 11-11-0-0 s=2,c=0,t=19,pt=0,l=0,sg=0,st=ok:
t=19 means S_LOCK

Indeed by default on domoticz, I have a light switch which I changed to Door Lock
this is my node output by hitting 2 times the door button:
1st time : read: 0-0-11 s=2,c=1,t=2,pt=0,l=1,sg=0:1
2nd time : read: 0-0-11 s=2,c=1,t=2,pt=0,l=1,sg=0:0
something change on the data part 0:1 and 0:0
but the receive type is t=2 meaning V_LIGHT or V_STATUS

Do you think this issue is fixed in a newer release ?

Re: S_LOCK device

Posted: Sunday 27 September 2015 12:54
by gizmocuz
well I am unable to debug right now, but looking at the code:

Code: Select all

				std::string lState = (light_command == light2_sOn) ? "1" : "0";
				if (FindChildWithValueType(node_id, V_LOCK_STATUS) != NULL)
				{
					//Door lock
					SendCommand(node_id, child_sensor_id, MT_Set, V_LOCK_STATUS, lState);
				}
				else if ((FindChildWithValueType(node_id, V_SCENE_ON) != NULL) || (FindChildWithValueType(node_id, V_SCENE_OFF) != NULL))
				{
					//Scene Controller
					SendCommand(node_id, child_sensor_id, MT_Set, (light_command == light2_sOn) ? V_SCENE_ON : V_SCENE_OFF, lState);
				}
				else
				{
					//normal
					SendCommand(node_id, child_sensor_id, MT_Set, V_STATUS, lState);
				}
if your node has a child with V_LOCK_STATUS, it should work.... otherwise please try to debug with for example visual studio, ir codelite

Re: S_LOCK device

Posted: Thursday 01 October 2015 21:36
by tbowmo
Hmm.. just updated to domoticz 2.3220

Using nodered to mock up a sensors, and inject the following

Code: Select all

100;255;3;0;11;LockTest
100;255;3;0;12;0.1
100;1;0;0;19;Door lock
Then in domoticz a mysensor device with the id of 0064 turns up, with the type of "Lighting 2", and on the LightSwitch page it turns up as a bulb.. Shouldn't this be a door, or a lock?

It does send the correct V_LOCK_STATUS to the nodes, when activating the device in domoticz. However, it seems that it inverts the status, so 0 means locked, and 1 means open.. While the mysensors API states that 1 is locked, and 0 is open.

Re: S_LOCK device

Posted: Friday 02 October 2015 8:14
by gizmocuz
Press edit on the switch and change it's type to door lock (from the switches page)

Re: S_LOCK device

Posted: Friday 02 October 2015 20:18
by tbowmo
I know, but wouldn't it make sense to auto assign the door icon, when it's a lock?

Anyways, if I use the door symbol, then the state is inverted, so that 0 is shown as door locked, and 1 is shown as door open. While the mysensors api states the opposite.

S_LOCK device

Posted: Wednesday 30 March 2016 19:04
by Flopp
I have same type of wrong name. It show up as Lightning_2 , AC

I am sending S_DOOR and V_TRIPPED

What does Lightning_2 mean?
What does AC mean?

Re: S_LOCK device

Posted: Wednesday 30 March 2016 19:46
by gizmocuz
It is just a internal type, forget about it
Just edit the switch, and select the correct type as you have done

Re: S_LOCK device

Posted: Wednesday 30 March 2016 19:49
by Flopp
Ok