FHEM Forum

FHEM => English Corner => Thema gestartet von: franc am 27 Januar 2018, 11:22:45

Titel: append to 'room' attribute
Beitrag von: franc am 27 Januar 2018, 11:22:45

I uses name conventions for different types of Dummy Variables that I have, e.g

    Bedroom_Temperature
    Bedroom_Humidity
    Study_Temperature
    Study_Humidity

I would like to be able to define the rooms these are in based on a regex, e.g

    attr Study_.* room Study
    attr .*_Temperature room Temperature

is this possible ?

thanks
Titel: Antw:append to 'room' attribute
Beitrag von: KernSani am 27 Januar 2018, 11:32:04
Yes, that should work, however be aware that existing room assignments will be overwritten.
To append rooms, have a look at the roomadd cmdalias https://wiki.fhem.de/wiki/Cmdalias
Titel: Antw:append to 'room' attribute
Beitrag von: franc am 27 Januar 2018, 12:12:24
thanks!
Titel: Antw:append to 'room' attribute
Beitrag von: rudolfkoenig am 27 Januar 2018, 23:11:06
I just implemented the -a and -r options for the attr command, so you can add some devices to further rooms with one command:

attr -a Bedroom.* room ,Bedroom

To remove them use:

attr -r Bedroom.* room ,Bedroom

The comma (,) at the beginning is necessary, as rooms are separated with comma.
In all other cases a space will be inserted automatically.

The -a is not necessary if the device has no rooms assigned yet.
Titel: Antw:append to 'room' attribute
Beitrag von: abc2006 am 17 Juli 2018, 17:51:00
I discovered that the order is different from using the room attribute list with mouse, the new one is just appended.


Second, i realized, that a room is added twice, if (accidentially) the command is executed twice.
Don't know if its correct or could cause other Problems.

Stephan