Textual thing configuration for creating items in habapp

i actually try to start with textual thing configuration. until now i always used textbased config files for things and items.

if i understand correct for the textual thing configuration i keep my *.things files and create in habapp a thing_???.yml file in the config folder.

so for example one thing i want habapp to create the item is

bus_thermo_zone               EK_Fbh_Bad_Sensor           "EK_Fbh_Bad_Sensor"             @ "Temperatur"  [ where="3", standAlone=false ]

till now my manually created *.items file is

Number:Temperature iEK_Fbh_Bad_Sensor "Bad Ist-Temperatur[%.1f %unit%]" <temperature> (iG_EK_Heizung) { unit="°C", channel="openwebnet:bus_thermo_zone:bticino:EK_Fbh_Bad_Sensor:temperature" }

the textual thing yml i created now like this:

test: True

filter:
  thing_type: openwebnet:bus_thermo_zone
  thing_label: 'EK_.+'

channels:
  - filter:
      channel_type: openwebnet:temperature
    link items:
      - type: Number
        name: '{thing_label}'
        label: '{thing_label, _.*?, } Ist-Temperatur[%.1f %unit%]'
        icon: temperature
        metadata:
          unit: '°C'
        groups: ['iG_EK_Heizung']

and if i save then habapp creates this *.items file in the config folder:

Number  EK_Fbh_Bad_Sensor       "EKFbhBadSensor Ist-Temperatur[%.1f %unit%]"      <temperature> (iG_EK_Heizung)   {channel = "openwebnet:bus_thermo_zone:bticino:EK_Fbh_Bad_Sensor:temperature",       unit="°C"}

i see that the instead of Number:Temperature there is only Number now, if i try to add the :Temperature to the type i recieve an error.

and i added a regex in the label, i wanted to substitute all _ with a space, but dont know how to do that (eg tried to add " " after the second comma but this does not work). final goal would be to change from this
EK_Fbh_Bad_Sensor
to this result
Bad Sensor

any help is higly appreciated, thanks

Yes - that’s correct.

Just to clarify - this file is just so you can easily check what will be / was created.


Yes - when I implemented this the UoM was of no use so I still have to work on a fix :confused: . Sorry.


Why don’t you use spaces in your thing label instead of “_”, that way it should work since if I remember correctly spaces get replaced with an underscore in the item name

bus_thermo_zone               EK_Fbh_Bad_Sensor           "EK Fbh Bad Sensor"             @ "Temperatur"  [ where="3", standAlone=false ]
test: True

filter:
  thing_type: openwebnet:bus_thermo_zone
  thing_label: 'EK_.+'

channels:
  - filter:
      channel_type: openwebnet:temperature
    link items:
      - type: Number
        name: '{thing_label}'
        label: '{thing_label, ^\w+\s+\w+(.+)$ } Ist-Temperatur[%.1f %unit%]'
        icon: temperature
        metadata:
          unit: '°C'
        groups: ['iG_EK_Heizung']
1 Like

oh stupid me :see_no_evil: its so easy but i did not realize, thank you for the hint!