Updating device status

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Updating device status

Post by hplus »

Hi there,

I remember last time i used domotiga, there was one important missing feature:
Suppose i have a x10 device with a A7 code. If i set this device to on from domotiga, its status is turned to on.
But if i use an external device, lets say a remote control to set it to on, domotiga still say it is off. Even though domotiga clearly received the A7 Off through the RFXCOM.
Do you have any plan to change this behaviour?

Thanks

Hplus
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Updating device status

Post by RDNZL »

How did you configure the A7 X10 device in your database, as which devicetype and interface?

I think the problem is that RFXCom receiver will only set device A7 if it has "RFXCom receiver" as interface, and since X10 devices can be controlled by several different interfaces Heyu, RFXCom TX, or CTX35, this is often not the case.

Should we make it so that it change any X10 device value even if received by another X10 interface?

Apart from this can you enable RFXCom Receiver debug and post the lines where it detects the A7 status?
So I know which code is involved in this.
Regards, Ron.
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Re: Updating device status

Post by Alexander »

[offtopic]Ron, please give your plants some water! (help messages on twitter)[/offtopic]
Alexander
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Updating device status

Post by RDNZL »

[offtopic]
If that was the only issue I have with my plants... I haven't told you about their Pokon addiction yet :shock:
TIP: Never give your plants access to your twitter account...
[/offtopic]
Regards, Ron.
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Re: Updating device status

Post by hplus »

Sorry for the long delay,

I was really busy these last month and i was not working on my HA anymore.
My X10 device is configured on the RFXCOM transmitter in order to be able to control it..

Yes i think that it is coherent to update the status of an x10 device even if its received by another interface..
The only case i can imagine in which this behaviour can be not suitable is if you have a RF X10 device and a x10 over powerline device using the same code and no RF-powerline gateway. But in this case it is easy to cofigure these devices not to use the same code....

Do you agree?

I can send you the logs this week end.

Thanks
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Re: Updating device status

Post by hplus »

Hi,

Here is the log for a A04 device.
it is configured as a marmitek x10 module with a rfcom TX interface


2010/11/27 20:14:19 20609F38C72010/11/27 20:14:19 [Devices] Device 'X10' with address 'A04' and interface 'RFXCom Receiver' not found!*
A4-Off bits=32
2010/11/27 20:14:37 20609F18E72010/11/27 20:14:37 [Devices] Device 'X10' with address 'A04' and interface 'RFXCom Receiver' not found!
A4-On bits=32

thanks

hplus
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Updating device status

Post by RDNZL »

Hi,

In version 0.1.192 I introduced a Global X10 setting for Heyu, RFXComRX and CTX35, if enabled and that interface receives an X10 signal it will update the status of that device if it belongs to another X10 interface.
You have to be careful not to create loops.

Can you test it?
Regards, Ron.
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Re: Updating device status

Post by hplus »

Cool,

I'll do the test this Week end, I am not at home during the week.
I'll report the results in this thread.

Thanks again

Hplus
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Re: Updating device status

Post by hplus »

I've just tried...
it doesn't seem to work...
i've changed this

TRY rDevice = Main.hDB.Exec("SELECT devices.* FROM devices, interfaces WHERE devices.interface = interfaces.id and interfaces.type LIKE &1 AND devices.address LIKE &2 AND devices.enabled is TRUE LIMIT 1", "%" & sDevice, sAddress)

to this:

TRY rDevice = Main.hDB.Exec("SELECT * FROM devices WHERE address LIKE &1 AND devices.enabled is TRUE LIMIT 1", sAddress)

to make it work...

hplus
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Updating device status

Post by RDNZL »

Strange as i worked when I tested it :|

Your sql query will also find other non X10 devices like for PLCBUS, so thats not the correct way.

Can you give me some more detailed info, what interfaces.id and interfaces.type have for values for example?
Regards, Ron.
hplus
Starting Member
Starting Member
Posts: 43
Joined: Fri Jan 22, 2010 12:21 pm

Re: Updating device status

Post by hplus »

Hi,

What do you want me to do exactly?
I don't understand your question "what interfaces.id and interfaces.type have for values for example?"

I've done the tests on saturday and i remenber that the function
=> PUBLIC SUB FindNameForInterface(iInterfaceId AS Integer) AS String
was crashing because the interface id was never found, so i first added a safety check
=> IF NOT ERROR AND IF rInterface.Available THEN RETURN rInterface!name

then i noticed that the problem comes from before, and that the query was giving no results.
=>TRY rDevice = Main.hDB.Exec("SELECT devices.* FROM devices, interfaces WHERE devices.interface = interfaces.id and interfaces.type LIKE &1 AND devices.address LIKE &2 AND devices.enabled is TRUE LIMIT 1", "%" & sDevice, sAddress)
so i've changed the query to be less restrictive. I don't understand fully the initial query thats why i made it simple...


Do you expect me to check my database for interfaces.id and type?

Hplus
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Updating device status

Post by RDNZL »

Ok. Dont know if you are willing to email me a database backup. If so see email address in readme file of domotiga. You can create backup via tools db admin menu.
But will investigate this further anyway.
Regards, Ron.
Post Reply

Return to “DomotiGa Forum”