Autor Thema: append to 'room' attribute  (Gelesen 1300 mal)

Offline franc

  • New Member
  • *
  • Beiträge: 39
append to 'room' attribute
« am: 27 Januar 2018, 11:22:45 »

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


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 ?


Offline KernSani

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2649
Antw:append to 'room' attribute
« Antwort #1 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
RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

Offline franc

  • New Member
  • *
  • Beiträge: 39
Antw:append to 'room' attribute
« Antwort #2 am: 27 Januar 2018, 12:12:24 »

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 20016
Antw:append to 'room' attribute
« Antwort #3 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.
Gefällt mir Gefällt mir x 1 Hilfreich Hilfreich x 1 Liste anzeigen

Offline abc2006

  • Sr. Member
  • ****
  • Beiträge: 756
Antw:append to 'room' attribute
« Antwort #4 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.

FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX