Hue Ambience Bulbs / Rules / Groups

Yup, Paper UI showing thing and channels, (note nothing linked despite Brightness channel being in the .items file below.)

lights.items file

Dimmer      Spot_GF_LR_1_Brightness             "Spot GF LR Brightness"             {Channel="hue:0220:00178877b4a1:5:brightness"}

Groups.items file

Group:Dimmer    gSpots_LR_All      "Living Room Spots All"

Dummy Variable used to trigger rule

Switch      vSpotTest                "Spot Test"

Rule to trigger item

rule "Spot Test"
    when
        Item vSpotTest changed
    then
        if(vSpotTest.state == ON) 
        {
            logInfo(logName,"Spot Test")
            Spot_GF_LR_1_Brightness.sendCommand("100")
        }
end

LOG when triggering vSpotTest rule

2020-04-28 15:48:24.561 [INFO ] [clipse.smarthome.model.script.lights] - Spot Test
2020-04-28 15:48:24.569 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Spot Test': The name 'Spot_GF_LR_1_Brightness' cannot be resolved to an item or type; line 71, column 13, length 23

Touch the item file that has Spot_GF_LR_1_Brightness e.g. just use text editor and add a space to the end then save.

and then by group

Rule

rule "Spot Test"
    when
        Item vSpotTest changed
    then
        if(vSpotTest.state == ON) 
        {
            logInfo(logName,"Spot Test")
            gSpots_LR_All.sendCommand("100")
        }
end

LOG

2020-04-28 15:52:35.486 [INFO ] [clipse.smarthome.model.script.lights] - Spot Test

No change, same result :frowning:

What does openhab.log say about lights.items when you touch it?

Only one line…no errors…

2020-04-28 15:52:32.508 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'lights.rules'

Channel should be lower case in the item file.

Like this:

Dimmer      Spot_GF_LR_1_Brightness             "Spot GF LR Brightness"             {channel="hue:0220:00178877b4a1:5:brightness"}
1 Like

Events.log file when I trigger vSpotTest on my sitemap

With the item Rule

2020-04-28 15:52:32.878 [ome.event.ItemCommandEvent] - Item 'vSpotTest' received command ON
2020-04-28 15:52:32.885 [vent.ItemStateChangedEvent] - vSpotTest changed from OFF to ON
2020-04-28 15:52:33.895 [ome.event.ItemCommandEvent] - Item 'vSpotTest' received command OFF
2020-04-28 15:52:33.903 [vent.ItemStateChangedEvent] - vSpotTest changed from ON to OFF

With the groups rule

2020-04-28 15:52:35.472 [ome.event.ItemCommandEvent] - Item 'vSpotTest' received command ON
2020-04-28 15:52:35.481 [vent.ItemStateChangedEvent] - vSpotTest changed from OFF to ON
2020-04-28 15:52:35.493 [ome.event.ItemCommandEvent] - Item 'gSpots_LR_All' received command 100

Tried that, no change…:frowning:

Can you control the brightness from BasicUI? I didn’t see the white dot indicating the channel as linked…but not 100% sure if using items file that it’s needed. :thinking: Will need to check my own system to know for sure. :upside_down_face:

EDIT: There should be a white dot indicating the channel is linked.

Forget the Group ; stopchanging things before fixing the last problem ; the above is a pretty basic problem and obviously the group won’t work if its member doesn’t exist.

Is that error still appearing with this rule?

rule "Spot Test"
    when
        Item vSpotTest changed
    then
        if(vSpotTest.state == ON) 
        {
            logInfo(logName,"Spot Test")
            Spot_GF_LR_1_Brightness.sendCommand("100")
        }
end
1 Like

Nope, log:

2020-04-28 16:12:28.292 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Spot_GF_LR_1_Brightness' for widget org.eclipse.smarthome.model.sitemap.sitemap.Slider

Agree, no white dot in the channel, which is the problem…I link it in the lights.item file but it doesn’t seem to link it. I can, (and have way, way back in this post somewhere, done this through PaperUI and it all then works but that’s not the right way to do things)…

Yes,

2020-04-28 16:17:14.604 [INFO ] [clipse.smarthome.model.script.lights] - Spot Test
2020-04-28 16:17:14.608 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Spot Test': The name 'Spot_GF_LR_1_Brightness' cannot be resolved to an item or type; line 71, column 13, length 23

Comment out the item, create a new items file and move the item to it.

BINGO!

It’s there, linked in Paper UI, physical light turns on and off…what the hell is going on there then!!!

Glad you got it fixed. :+1:

Maybe the other item file got stuck in cache? I would just delete the old item file and continue on.

1 Like

So making this into a learning opportunity, anyone know what could have caused this?

Could be a number of things e.g. cache, tmp file not cleaned. I wouldn’t worry unless this continues to happen with other items.

You may also want to use openhabian-config tool to have the rules load after everything else when restarting OH.

Undoubtedly finger trouble, but you won’t want to hear that, like the Channel/channel.
One point of note - it takes a finite time for openHAB to spot and process any new/edited xxx.items xxx.rules files and so on, can be some time on a pi. Bang on with a test, only to find you’re still using old details etc.

1 Like

So patience is the answer :smiley: