OH3 Hue Scene Strings Hash?

Tags: #<Tag:0x00007f43359245a8> #<Tag:0x00007f43359246e8> #<Tag:0x00007f43359247b0>

Hello,
When I want to control a Scene from the Hue Bridge I have to transmit the string hashed?
instead of e.g. Scene „Abend" the hash “oyfFdwiMhCu5Opd”.

In the dashboard of the schematic model the names are displayed correctly.

Does anyone know how I can also enter the strings directly in Openhab3 in JavaScript without using the hash. Or does anyone know how I can create this hash? Unfortunately I don’t know how it was hashed… I was just guessing if it is a hash.

Thanks a lot :slight_smile:

Enclosed the example script controlled by a rule
Is a simple light control for the bathroom

  • Platform information:
    • Hardware: Raspi 4 / 8Gb
    • OS: Buster
    • Java Runtime Environment: –
    • openHAB version: 3.0.2 with Docker
  • Issue of the topic: please be detailed explaining your issue
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var ScriptExecution = Java.type("org.openhab.core.model.script.actions.ScriptExecution");
var ZonedDateTime   = Java.type("java.time.ZonedDateTime");

var timenow = ZonedDateTime.now();
//var nacht = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_Nacht_Start').getState().toString());
var auf = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_SonnenAufgang').getState().toString());
var aufende = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_SonnenAufgang_Ende').getState().toString());
var unter = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_Sonnenuntergang').getState().toString());
var unterende = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_Sonnenuntergang_Ende').getState().toString());
//var tag = DateTimeType.valueOf(itemRegistry.getItem('LokaleSonnendaten_Tag_Start').getState().toString());

var Bath_Timer;
var Bath_Dim_Timer;
var delaydim;
var delay;
logger.info('Badezimmer Regel Aktiv');
if (itemRegistry.getItem('BewegungsmelderBadezimmer_Bewegung').getState() == 'ON') {
  logger.info('Bewegung im Bad erkannt');
  this.delay = 600;
  this.delaydim = 0;
  if(timenow <= unter && timenow > aufende) 
  {
    logger.info('Bad Tag');
    events.sendCommand('Licht_Badezimmer_Scene', 'RKvPEeQ-5LFHxSN');
    this.delaydim = 120;
  }
  else if(timenow <= unterende && timenow >= unter) 
  {
    logger.info('Bad Abend');
    events.sendCommand('Licht_Badezimmer_Scene', 'oyfFdwiMhCu5Opd');
    this.delaydim = 180;
  }
  else if(timenow <= auf && timenow < aufende) 
  {
    logger.info('Bad Morgen');
    events.sendCommand('Licht_Badezimmer_Scene', 'oyfFdwiMhCu5Opd');
    this.delaydim = 180;
  }
  else
  {  
    logger.info('Bad Nacht');
    events.sendCommand('Licht_Badezimmer_Scene', 'SKlVi0Gqy5eCLW2');
    this.delaydim = 60;
  }
  this.Bath_Dim_Timer = ScriptExecution.createTimer(ZonedDateTime.now().plusSeconds(this.delay), function(){
       events.sendCommand('Licht_Badezimmer_Helligkeit', 20);});
  
  if (this.Bath_Timer !== undefined) {
    this.Bath_Timer.cancel();
    this.Bath_Timer = undefined;
  }
  if (this.Bath_Dim_Timer !== undefined) {
    this.Bath_Dim_Timer.cancel();
    this.Bath_Dim_Timer = undefined;
  }
}
if (itemRegistry.getItem('BewegungsmelderBadezimmer_Bewegung').getState() == 'OFF') 
{
    this.Bath_Dim_Timer = ScriptExecution.createTimer(ZonedDateTime.now().plusSeconds(this.delaydim), function(){
      events.sendCommand('Licht_Badezimmer_Helligkeit', 10);
      this.delay = 30 + delay;});
    if(this.delay != 600)
    {
      this.Bath_Timer = ScriptExecution.createTimer(ZonedDateTime.now().plusSeconds(this.delay), function(){
      events.sendCommand('Licht_Badezimmer_Schalter', OFF);});
    }   
}
 
  • Services configuration related to the issue
  • If logs where generated please post these here using code fences: