Any one can help to add button arm/disarm the alarm via Xiaomi gateway?

Hello,

After very long time, and help from guys here, I’m still cannot succeed to add the button to arm/disarm the alarm from switch button.

if anyone can share is code will be helpful:slight_smile:

Thanks!
MP

please tell us a little more what you are trying to do and what you have tried before.

Hi,

Do you refere to the sound system alarm that have the xiaomi smart gateway? or maybe you want arm/disarm alarm just by notification?

imagen

As @ReneTode told you, please be more specific, about your idea, that you want do it.

If I will press the switch button 2 time and alarm is arm right?

so I want to be able to do it via HA.

did you add anything from the Xiaomi gateway to homeassistant?
did you add the alarm to homeassistant?

what do you have so far?
And what have you tried so far?

Yes, all work fine with Xiaomi gateway, all sensor and i get notify from ha

i just want to be able to arm/ alarm via ha and not only via mi home…

i try all code that i find here, non is working for me…

i dont have the Xiaomi gateway myself, but doesnt it automaticly create sensors and switches?
if i look at the picture from @garvarma then he has a switch there

Thanks, this why i open this post :slight_smile: to get help from someone with Xiaomi gateway…

but people can only hellp if you show what you have working.
please show pictures from frontend and what you have in yaml, so people can tell you what to do.

but this not about what is not working or not, I don’t know what need to make in order to add arm via HA /

if you show what you have people can tell you what to add or do :wink:

you say gateway is working.
does the gateway know the alarm?
did it add anything from the alarm to HA?
are there any sensors that are shown in HA?
are there any switches that the gateway added to HA?

There’s is no arming or disarming of the gateway.

That’s only an automation, not a special mode.

To replicate it you need an automation with a trigger, condition and action.

Trigger being motion detected, condition being when you’re not at home, and the action being to play an alarm and set the gateway to red (or if you have yeelights use the police effect).

Exacly,

As @Artudst says, the alarm system arming/disarming of the xiaomi gateway not work in HA. The only possiblity is using imagination, and create automations.

For example:

 alias: SensorPuertaAbierto
hide_entity: True
trigger:
  platform: state
  entity_id: binary_sensor.door_window_sensor_158dXXXXXXXX
  to: 'on'
condition:
  condition: state
  entity_id: group.track_casa
  state: 'not_home'
action:
  service: notify.casa_viva
  data_template:
    title: "Puerta Cocina: "
    message: "Puerta Abierta"

And where action part, you must chage it by something like:

https://community.home-assistant.io/t/xiaomi-gateway-integration/8213/1939?u=garvarma

and

https://community.home-assistant.io/t/xiaomi-gateway-integration/8213/1940?u=garvarma

More info you can find it here:


https://community.home-assistant.io/t/xiaomi-gateway-integration/8213/2196?u=garvarma

or

https://community.home-assistant.io/t/xiaomi-gateway-integration/8213/2767?u=garvarma

Ones you have the automation that when someone is detected, you switch on the alarm sound, one automation to arm/disarm (as i have in my configuration) is this one:

1.- Create a inpot_boolean to arm/disarm
2.- In the automation about alarm, in the condition part, you must refer about this input_boolean.

soemthing like this:

alias: SensorMovComedorCocina
hide_entity: True
trigger:
  platform: state
  entity_id: binary_sensor.motion_sensor_158dXXXXXXX
  to: 'on'
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: group.track_casa
      state: 'not_home'
    - condition: state
      entity_id: input_boolean.alarma
      state: 'on'
action:
  service: notify.casa_viva
  data_template:
    title: "Sensor Cocina: "
    message: "Activado"

Hi again,

Here in this link you have a good info how to do it, and you have a automation included.

https://community.home-assistant.io/t/xiaomi-gateway-integration/8213/3014?u=garvarma

1 Like

OK, ManY tHANKS!