Hello djsuszi,
i'll try to explain the structure of a configuration spript.
The setup i used was a 13-button backbox module, a relay, module, a ir-module and a LED dimmer module.
One configuration consists of several parts.
Part 1 defines all modules which should be part of the configuration (together with node-specific settings like ID, url, symbolic name, ...).
Part 2 defines messages to be send around (defined together with the sender and the condition when they should be send and a symbolic name).
Part 3 defines the actions to be done (defined together with the acting module and the action based on the defined messages).
>Can you give more example, I try to figure it out and I have problems :)
>Maybe you have your own configuration for your script ?
>I would like to use your hapconf to program my new installation.
>for examples
>
https://github.com/asicdruide/hapconf/b ... p3.hapconf
The example you're referring to is a quite old one.
In the beginning i've changed the syntax quite often until i found readability ok.
Please use a newer example (e.g. eval_board.hapconf) as reference.
>button_back_box13 ("bbb") <<<< it's name of module which I will see in HapCan Programer ?
Yes it is. It's written to address 0xF00030 of EEPROM.
> ->port_name ( 1 , "B1" )
>...
> ->port_name (13 , "B13")
>we have button with ports, it should me 0 or 14?
Sorry didn't got your question.
This statment assigns a symbolic name ('B13' in the above example) to port number 13.
The symbolic name should usually be more describing where the port is connected to
like bath.sw1 or living.presence.
The legal port numbers are depending on the version of the module.
The appropriate number is populated in lines 150..168 of button.pm.
Whenever you want to refer to a port you might use the symbolic name.
This allows remapping to another module/port without having to change each reference
and code readability is better, too.
> ->message ("4up" , "c" , "B7" )
> ->message ("5up" , "c" , "B8" )
> ->message ("6up" , "c" , "B9" )
> ->message ("7up" , "c" , "B10")
> ->message ("7down" , "o" , "B10")
>
>"o" is open, "c" is close ? but buttons have much more states.
>
http://hapcan.com/devices/universal/uni ... v_3-1-3-x/
>"7 types of button behaving is recognized: button pressed, released,
>pressed for 400ms, pressed for 4s, released within 400ms, released
>between 400ms and 4s, released after 4s"
This section assign symbolically named events (e.g. '4up' in the above example)
to a condition that trigger them.
All possible event triggers are summarized in lines 70..106 of button.pm.
You might change the existing ones or add you own ones.
The event name must be unique, the implementation (the byte array) does not need
to be unique.
E.g. the line
,":click" => [0xFC , undef , 0x10]
adds the event ':click' to the allowed ones having the same effect as ':co'.
The three groups describe the different situations, please see comment there.
Please note that different messages are sent depending on state of LED.
If you care about LED state, use the ':0c' or ':1c' event, if you don't care
about the LED state, use ':c' event.
> ->thermostat_threshold (22.0)
> ->thermostat_hysteresis( 1.0)
> ->temperature_offset ( 0.0)
>how to disable thermostat, and set sending temperature in 5 min loop ?
I'm not sure whether i've implemented thermostat messages completely.
To block sending temp messages you might set threshold to low value.
If you don't want them don't declare temp messages.
>what is this bellow ?
> ->message ("light2->on" , "->on" , "K2")
> ->message ("light2->off" , "->off" , "K2")
> ->message ("light5->on" , "->on" , "K5")
> ->message ("light5->off" , "->off" , "K5")
> ->message ("light6->on" , "->on" , "K6")
> ->message ("light6->off" , "->off" , "K6")
The relaymodule can sent messages when a relay is switched (as confimation
of action). The above declares those messages.
If you don't want them, don't declare them.
> ->box ("enabled" , "toggle" , "K2" , "5up" )
> ->box ("enabled" , "toggle" , "K4" , "7up" )
> ->box ("enabled" , "toggle" , "K4" , "7down")
>as I understood, when Button_nr8 is closed, It should toogle K2 ?
Yes, that's right.
>when I press button_nr_7 is should toogle (for example ring bell) K4, and when I release it, it will stop ringing ?
Yes except that the 7up and 7down messages are sent from port10 of button module.
I hope this helps understanding the concept.
In the next months i'll order my complete configuration (as building our
appartment approaches completion). I'll pick up development of hapconf than.
Best regards,
Klaus