mvalla / openhab-addons

Add-ons for openHAB
Eclipse Public License 2.0
24 stars 16 forks source link

Support for group addresses (WHERE=#n) #35

Open Gozilla01 opened 5 years ago

Gozilla01 commented 5 years ago

Implement the commands: AMB - Environments GR - Groups GEN - General You could include them in the "Conversion" issue this #22

mvalla commented 5 years ago

These are not commands but "address groups": AMB, GR, GEN. The idea is that groups can be defined in OH2, but since there are physical buttons that control a group of devices, this should be supported as feedback status updates by the binding. For example if I have a physical "all lights ON/OFF" button, when I press the physical button, the lights items for WHEREs belonging to the group should be updated in OH2. See discussion: https://community.openhab.org/t/openwebnet-group-commands-where-n/58737

llegovich commented 5 years ago

Agree. They could also receive commands but the most important to cover would be updating the items belonging to the group. Thx

Gozilla01 commented 5 years ago

I ran you have to test and I posted an example.

llegovich commented 5 years ago

@Gozilla01 if I well understand you are issuing the group command via OH, but this is not what is requested in this issue. We expect the light status to update when a GEN command is fired by a physical switch. Did you try with a physical switch? Are the light statuses updated?

Gozilla01 commented 5 years ago

@llegovich I understand what you say. My example serves OH to OWN for all command groups. The GEN and AMB will subsequently be implemented differently with in the bus_on_off_switch. See table here.

julesbike commented 5 years ago

I'd also like to have groups, This worked with the old Bticino binding where I could do this: Switch Lt_office_group "All office"{bticino="if=webserver;who=1;what=0;where=#2"} I have one of my F411/2 which for some reason only accepts Group commands from Openwebnet so I can't use the new binding yet.

Gozilla01 commented 5 years ago

@julesbike Yes, we are also working on this implementation If you want you can install both bindings

julesbike commented 5 years ago

@Gozilla01 thanks - I was playing around last night and I've found that you can use Area instead of Groups. The new binding accepts a where=9 and I just put all the group into area = 9 Obviously groups would be more powerful! I like to use Groups because if I want to turn off Openhab I can still have some "intelligent" switches.

Gozilla01 commented 5 years ago

Implement a new bus_group to send AMB-GE-GEN commands for Linghing and Automation to the bus. It seems excessive to me to create two bus, one for WHO = 1 and one for WHO = 2 Param: who = 1or 2 (Linghing or Automatione) type integer where gruop = 'AMB' or 'GR' or 'GEN' type string Channel: switch with state 'ON' or 'OFF' or UNDEF shutter with state 'UP' or 'STOP' or 'DOWN' or UNDEF

Thing bus_group mygruop "bla" [ who=1, where="8", group="AMB" ] Thing bus_group1 mygruop "bla" [ who=2, where="9", group="GR" ]

In the sitemap you get buttons for mapping the various commands

Switch item=iLR_test label="bla" mappings=[ON="bla",OFF="bla"] Switch item=iLR_test label="bla" mappings=[UP="bla",STOP="bla", DOWN="bla"]

Operation State WHO=1 Command ON = ON > after 500ms > UNDEF Command ON = OFF > after 500ms > UNDEF

Operation State WHO=2 Command UP = UP > after 500ms > UNDEF Command DOWN = DOWN > after 500ms > UNDEF Command DOWN = STOP > after 500ms > UNDEF

State UNDEF is used to have a neutral state Schedule 500ms serves for two reasons:

Gozilla01 commented 5 years ago

I thought of another definition for the new bus group Implement a new bus_group to send AMB-GE-GEN commands for Linghing and Automation to the bus.

Param: who = 1or 2 (Linghing or Automatione) type integer, <required>, select with <options>...</options> where = as usual group = "AMB" or "GR" or "GEN" type string, <required>, select with <options>... </options> Channel: group = with values "ON" or "OFF" or "UP" or "STOP" or "DOWN" or "RELEASED", type string Each value change is set, after 500ms, a "RELEASED"

Values "ON" or "OFF" managed only with WHO = 1 Values "UP" or "STOP" or "DOWN" managed only with WHO = 2 Value "RELEASED" is used to have a neutral state Schedule 500ms serves for:

Inside the bus I also see FIX resolve issue #69

Example: Thing bus_group mygruop "bla" [ who=1, where="8", group="AMB" ] Thing bus_group1 mygruop1 "bla" [ who=2, where="9", group="GR" ]

String iLR_test "bla" { channel="openwebnet:bus_group:mybridge:mygruop:group"} String iLR_test1 "bla" { channel="openwebnet:bus_group:mybridge:mygruop1:group"}

In the sitemap you get buttons for mapping the various commands

Switch item=iLR_test label="bla" mappings=[ON="bla",OFF="bla"] Switch item=iLR_test1 label="bla" mappings=[UP="bla",STOP="bla", DOWN="bla"]

rule "GR 9 Rollshutters "
  when
    Item iLR_test1  changed
  then
    switch(iLR_test1 .state ) {
      case "UP": {
            logInfo("Rules" , "Rollshutters UP")
      }
      case "STOP": {
            logInfo("Rules" , "Rollshutters STOP")
      }
      case "DOWN": {
            logInfo("Rules" , "Rollshutters DOWN")
      }
    }
end
Gozilla01 commented 5 years ago

Assignee to me