Page 1 of 1

Device classes?

Posted: Sat Jul 04, 2009 1:52 pm
by cyr
Hi.

I have been looking for software to base my home automation project on for a long time, but now I have pretty much settled on using DomotiGa.

I would like to add support for some new devices (OWFS/OWserver, Z-Wave, LIRC...). I have a question about the internal design of DomotiGa before I start hacking away at it...

How are the different types of devices organized (if at all) ?

For example, is there a "Light" or "DimmableLight" device class with a common set of attributes and functions that each specific type of lamp module/dimmer implements?

Having only played with the software for a few minutes it looks like each type of hardware (i.e. Maker ABC, Device XYZ) is an entirely separate kind of device?

Device classes?

Posted: Sat Jul 04, 2009 4:46 pm
by RDNZL
Hi,

No, all devices have the same database fields, see beginning of Devices.modules code, no classes are used.

They have a devicetype defined (in table devicetypes) and they are linked to an interface (table interface), with that a protocol (X10, DSC, EIB etc) is also defined.

The devicename must be unique the address can be used multiple times (with different interfaces).

Setting a values of a switchable/dimable device is done by Devices.SetDevice() just filling values (temp, humid etc) is done by Devices.ValueUpdate()

Best is to copy a class/device of a protocl already present (for example COneWire.class and work from there.

This is also some documentation here:
http://www.domotiga.nl/projects/domotig ... evelopment

Contact me if you are stuck.

I had starting with owfs support myself but my DS9*** adapter broke down, it doesn't find any 1-wire devices anymore...

Regards,
Ron.

Device classes?

Posted: Sat Jul 04, 2009 5:06 pm
by Digit
Very much hardware of a certain producer/type have a lot in common. It's always good to encapsulate similar behavior/functionality of certain hardware into specific classes. This reduces code size, maintenance, simplifies introducing new features etc. etc. I'd say you can't live without it.