- Platform information:
- Hardware: Raspberry Pi 4
- OS: Openhabian
- Java Runtime Environment: 11.0.13
- openHAB version: 3.1.0
I am trying to get basic light scenes like in https://demo.openhab.org/. Is the demo source available somewhere? I only found this old thread: Where do I find openHAB Demo sitemap/UI implementation - #4 by ThomDietrich but all links to the demo sources there are outdated.
As far as I understood it, there are rules which define when certain events are triggered, and these events may be script executions or actions specified in the rule.
Based on Scenes - how to create scene in OH3? - #4 by yfre, I tried the following rule:
triggers: []
conditions: []
actions:
- inputs: {}
id: "1"
label: hellesLicht
configuration:
type: application/javascript
script: sendCommand(WohnzimmerlampeHelligkeit,100);
type: script.ScriptAction
Unfortunately, if I define a button like this:
[...]
slots:
default:
- component: oh-button
config:
text: hellesLicht
action: rule
actionRule: hellesLicht
the rule does not get found and events.log
does not contain any information.
Furthermore, I tried to define a script which does this:
import java.awt.Color
logInfo("Helligkeit ist ", WohnzimmerlampeHelligkeit)
sendCommand('WohnzimmerlampeHelligkeit', 100)
WohnzimmerlampeHelligkeit.sendCommand(100)
wohnzimmerlampeHelligkeit.postUpdate(100)
val newColor = new Color(100, 0, 0)
WohnzimmerlampeFarbe.postUpdate(new HSBType(newColor))
Unfortunately, even if I directly click “Run Now” in the surface (and not use the button), nothing happens (also nothing in events.log
).
Could you give me an hint how to achieve basic brightness / color temperature /color changing in a rule? (Or at least get error messages, if something is misconfigured).