Google assistant and inverted Light (not switch), google assistant switch and two independent things (push buttons)

Hi there,
I am looking for easy way how to map inverted light for google assistant.
I have Niko Home Control (NHC) bindings in OH 3.2 working quite well with my Lights.

NHC push buttons mounted at walls with led indicators works in inverted way:

  • when “light is on” it means “LED on pushbutton is on and the light bulb is actually off”
  • when “light si off” it means “LED on pushbutton is off and the light bulb is actually on”

When assigning GA tags, you can do inverted mappings for switches, but not for lights.
I created virtual switch and 2 rules to simulate inverted behavior, unfortunately it will not reflect actual state of the bulb when someone push the button at the wall manually (it will unsync state of the bulb and state of the virtual light)
Anybody with the better approach please? It would be great to map inverted behaviour from thing to item directly somehow.

Another issue is a little bit different:
I have 2 things for main gate control:

  • thing_1_open_gate
  • thing_2_close_gate
    Those are just “push” action to send command to the gate motor, and are always ON when idle.
    To activate any action, you need to change state to OFF, wait some delay and change it back to ON

Thanks for any hint regarding this.

Just to report I have found a solution:

  1. for every inverted light a created a new rule (2 rules, one for every possible final state) to update virtual button state when state of the original item has changed

  2. for two actions (independent) things for controling main Gate I created 2 rules:

a) when virtual swich (Gate) changed to OFF, I triggered 3 actions: A) send command OFF to thing_1_open_gate, B) use ECMA sript for delay 500 ms : java.lang.Thread.sleep(500); c) send command ON to thing_1_open_gate (because final idle state for pushbutton is ON again)

b) when virtual switch (Gate) changed to ON, I triggered 3 actions: A) send command OFF to thing_2_close_gate, B) use ECMA sript for delay 500 ms : java.lang.Thread.sleep(500); c) send command ON to thing_2_close_gate (because final idle state for pushbutton is ON again)

Hope it will help someone.

I find that most of my solutions for “need Google Assistant to do something” involve a virtual switch and a rule.

I’m confused as to why you’re doing the exact same thing regardless of whether the virtual switch changes to ON or OFF. I’m guessing that there were supposed to be more edits to the second statement after copying it.

Hi,

those are not the same for GATE controlling, first triggers “thing_1_open_gate” , second “thing_2_close_gate” :slight_smile: There was just mistype “thing_1_… → thing_2_…”