append to 'room' attribute

Begonnen von franc, 27 Januar 2018, 11:22:45

Vorheriges Thema - Nächstes Thema

franc


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

KernSani

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
RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

franc


rudolfkoenig

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.

abc2006

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
FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX