Page 1 of 1

PLCBUS updating status

Posted: Sun Dec 19, 2010 8:46 am
by vdoucet
Hi Ron,
I read another thread initiated by hplus regarding the update of a device status when triggered externaly. Actually, I'm looking for the same in PLCBUS but it may be a bit different since in my case devices could be triggered by a local switch.
However, this is what the polling is meant for, I think.
When going through CPLCBUS.class I noticed the following (note I'm running a modified code with the address conversion (http://www.domoticaforum.eu/viewtopic.php?f=38&t=5777) and checksum on last byte(http://www.domoticaforum.eu/viewtopic.php?f=38&t=5735)):
- I have devices on different home addresses :

Code: Select all

[PLCBUS] Found PLCBUS device(s) with home address(es): B A
- When executing the polling routine it only checks for the firt one (B)

Code: Select all

2010/12/19 07:34:04 [PLCBUS] > 02 05 FA 10 1C 00 00 03
2010/12/19 07:34:04 [PLCBUS] > 02 05 FA 10 1C 00 00 03
2010/12/19 07:34:04 [PLCBUS] > 02 05 FA 00 1C 00 00 03
2010/12/19 07:34:04 [PLCBUS] > 02 05 FA 00 1C 00 00 03
2010/12/19 07:34:04 [PLCBUS] < 02 06 FA 10 1C 00 00 1C B6 
2010/12/19 07:34:05 [PLCBUS] < 02 06 FA 10 1C 00 FF 40 93 Addr: B01 Cmd: GET_ALL_ID_PULSE Data1: 00 Data2: FF GET ALL ID PULSE UNITS: 00000000 11111111
2010/12/19 07:34:05 [PLCBUS] > 02 05 FA 10 1D 00 00 03
2010/12/19 07:34:05 [PLCBUS] > 02 05 FA 10 1D 00 00 03

2010/12/19 07:34:05 [PLCBUS] < 02 06 FA 10 1D 00 00 1C B5 
2010/12/19 07:34:05 [PLCBUS] < 02 06 FA 10 1D 00 C8 40 C9 Addr: B01 Cmd: GET_ONLY_ON_ID_PULSE Data1: 00 Data2: C8 GET ONLY ON ID PULSE UNITS ON: 00000000 11001000
which is correct since B4, B7 and B8 are ON.
Then I trigger manually B1 for example (local switch):

Code: Select all

2010/12/19 07:41:05 [PLCBUS] < 02 06 FA 10 1D 00 C9 40 C8 Addr: B01 Cmd: GET_ONLY_ON_ID_PULSE Data1: 00 Data2: C9 GET ONLY ON ID PULSE UNITS ON: 00000000 11001001
so B1 is well detected as being ON by the polling routine.
However, it is not reported in the device status.

So I see the two following issues :
- polling is not run on all home addresses
- polling is not interpreted to update devices status

Do you agree ? I will try to propose a fix but I'm not too sure since I'm just starting with Gambas.

Re: PLCBUS updating status

Posted: Tue Dec 28, 2010 11:06 am
by RDNZL
I implemented updating device statuses, when an answer on a polling packet is received.

A bit silly that you only have on or off. So Dimmed devices are shown as on, but you don't want to set the status from dim xx% to on.

What to do?
Can you request the Dim level of a single device?

If so the only way to get it right is:
send GET ALL ID PULSE UNITS request
send GET_ONLY_ON_ID_PULSE request
only set status of all found devices which are off to off.
only set status of only the switches which are on to on
poll every single dimmer for separate level and set it's status.

Really, plcbus is on my list of weird, false implemented protocols now (not many left, only KNX is on it)

Or have i overlooked something? (I hope so)