Xiaomi Door Sensor, channel, item group --> Window open alarm


(Jan) #1

Hi everybody

I equiped all of my doors and windows with Xiaomi door/window sensors a year a go. It works great! As winter arrives quite fast and the heating works heavily, I would like to use the timer functionality of the sensors to alarm, when a window remains open for longer than 5 minutes.

Therefore I set the Item

Number WindowSwitch_AlarmTimer <clock> { channel="mihome:sensor_magnet:<ID>:isOpenAlarmTimer" }

via system start rule to 5 minutes for every sensor.

When using the alarm in a rule, rule trigger seems to be

Channel "mihome:sensor_magnet:<ID>:isOpenAlarm" triggered ALARM

–> a channel and not an item.

Because I have a lot of sensors, I intended to use the group item and functions for grouping these channels and write the notification rule once (makes adding new items easier).

As groups work for Items now my question:

Is ist possible to define an Item like?

Something Xi_TFS_Eingang_Alarm "Eingangsalarm"  <contact> (gTFS) { channel="mihome:sensor_magnet:158d00027b3547:isOpenAlarm" }

What would be the type of the item?

Thanks a lot in advance

Jan


(Vincent Regaud) #2

You will see this in the PaperUI under the channel

For example:

image

This channel can be liked to a Switch item


(Jan) #3

Hello vzorglub

Thanks a lot for your help.

Unfortunately this is not possible… Under my thing, I see all the possible channels. All of them are likable to an Item except isOpenAlarm… linking is denied.

I have defined all things and items manually in .things and .items files… I could try to define manually… but I don’t want to shoot the server…

Thx Jan


(Dimalo) #4

hi @dark_mc, you cannot group event channels. easiest way would be to write the rule with “or” conditions:

rule "<RULE_NAME>"
when
    <TRIGGER_CONDITION> [or <TRIGGER_CONDITION2> [or ...]]
then
    <SCRIPT_BLOCK>
end

(Jan) #5

Hi Dimalo

Thanks a lot for your reply… I did it finally with OR as you are suggesting. Unfortunately this has the disadvantage, that I’m not able to identify within the rule, which of the channels has fired to write a specific message like “Window A open for too long” or “Window B open for too long”.

Maybee I have to write a rule for every channel for specific messages…

Jan