Save current Lamp state

Hi there

i’m actually playing with plex binding and trying to dimming my lights at playing a movie.
This is actually working!

My Question is:

Is it possible to get the current Settings of the Hue Lamps to save it in a Var and later (at stopping the movie) goes back to this settings?

var String hueApiCallSceneKino = "curl@@-X@@PUT@@-d@@{\"scene\": %s }@@http://10.0.0.109/api/xxxxxx/groups/5/action"
val String hueApiCallScenePause = "curl@@-X@@PUT@@-d@@{\"scene\": %s }@@http://10.0.0.109/api/xxxxxx/groups/5/action"
val String hueApiCallbacktonormal = "curl@@-X@@PUT@@-d@@{\"on\": false}@@http://10.0.0.109/api/xxxxxx/groups/5/action"

rule "Kino: Play"
when
 Item PlexTVStatus changed from Stopped to Buffering
 or
 Item PlexTVStatus changed from Stopped to Playing
 or
 Item PlexTVStatus changed from Paused to Playing
then
executeCommandLine(String::format(hueApiCallSceneKino, '"gXAXwbMRRwp5ysf"'))
end

rule "Kino: Pause / Stop"
when
Item PlexTVStatus changed from Playing to Paused
then
executeCommandLine(String::format(hueApiCallSceneKino, '"U82WteSqMRD5IjR"'))
end

rule "Kino: Stop"
when
Item PlexTVStatus changed from Playing to Stopped
or
Item PlexTVStatus changed from Paused to Stopped
then
executeCommandLine(String::format(hueApiCallbacktonormal))
end

so, i want to save the current state of the Lamps in the Var “hueApiCallbacktonormal”

is that possible and if, how i can do that?

thank you

maybe you should have a look at this: Persistence based, GUI reconfigurable scenes

Maybe this helps
https://docs.openhab.org/addons/bindings/hue1/readme.html#indirectly-using-a-livingcolors-remote-or-hue-dimmer-switch

.getHue()
.getSaturation()
.getBrightness()

https://docs.openhab.org/addons/actions.html#event-bus-actions

See the storeStates and restoreStates Actions.

1 Like