Device classes?

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
cyr
Starting Member
Starting Member
Posts: 1
Joined: Sat Jul 04, 2009 1:07 pm
Location: Sweden
Contact:

Device classes?

Post 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?
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Device classes?

Post 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.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Device classes?

Post 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.
Post Reply

Return to “DomotiGa Forum”