Need a new state type "not_state"

I’m trying to use the new zanzito app and a FIND server to setup indoor location services so i know which room everyone is in the house. I have 6 family members and 7 rooms that have been mapped out. I have this all working great when its just me. But when i start adding extra family members into the mix it doesnt work as well. For example when i walk into my office everything turns on and when i walk out of the office everything turns off. But if my wife is already in the office and i walk out everything in the office turn off on her.

This is what ive been working on so far

- id: igps_office_occupied
  alias: iGPS Office Occupied
  trigger:
    platform: state
    entity_id:
      - sensor.igps_james
      - sensor.igps_kathy
      - sensor.igps_charles
      - sensor.igps_ann
      - sensor.igps_seth
      - sensor.igps_cheyanne
    to: 'office'
  action: 
    service: switch.turn_on
    entity_id:
      - switch.tv
      - switch.receiver
      - switch.fan
      - switch.normal_lights

- id: igps_office_vacant
  alias: iGPS Office Vacant
  trigger:
    platform: state
    entity_id:
      - sensor.igps_james
      - sensor.igps_kathy
      - sensor.igps_charles
      - sensor.igps_ann
      - sensor.igps_seth
      - sensor.igps_cheyanne
    from: 'office'
  action:
    - service: light.turn_off
      entity_id:
        - light.hue_front
        - light.hue_left
        - light.hue_right
    - service: switch.turn_off
      entity_id:
        - switch.tv
        - switch.fan

feels like i need an and condition for “if not” or “not_state” something like

  condition:
    condition: and
    conditions:
      condition: state
      entity_id:
        - sensor.igps_james
        - sensor.igps_kathy
        - sensor.igps_charles
        - sensor.igps_ann
        - sensor.igps_seth
        - sensor.igps_cheyanne
      not_state: 'office'

how about a template sensor:

{{not(is_state("sensor.igps_jame","office")) and not(is_state("sensor.igps_kathy","office".....}}
1 Like

You can also use !=

could you explain or link me to something that can?

Im not at my computer right now but I know I have some similar that works:

condition:
    condition: and
    conditions:
      - condition: template
        value_template: ‘{{ states.sensor.igps_james.state != “office” }}’
      - condition: template
        value_template: ‘{{ states.sensor.igps_kathy.state != “office” }}’

so the != pretty much means NOT?

The ! stands for not, so its not (!) equal (=).

thanks that helps clear it up a bit. Should help later down the road as well.