Code: Alles auswählen
val hueActions = getActions("hue","hue:0210:00178810d0dc:1")
hueActions.fadingLightCommand("color", new PercentType(100), new DecimalType(1000))
Code: Alles auswählen
val hueActions = getActions("hue","hue:0210:00178810d0dc:1")
hueActions.fadingLightCommand("color", new PercentType(100), new DecimalType(1000))
Code: Alles auswählen
val hueActions = getActions("hue","hue:0210:00178810d0dc:1")
Code: Alles auswählen
(function(context) {
'use strict';
/**
* Sends the message to email and notifications based on time of day.
* @param {string} message string to send out as an alert message
*/
context.sendAlert = function(message) {
var log = (context.logger === undefined) ? Java.type("org.slf4j.LoggerFactory").getLogger("org.openhab.model.script.Rules.sendAlert") : context.logger;
log.warn("ALERT: " + message);
var night = context.items["TimeOfDay"] == "NIGHT" || context.items["TimeOfDay"] == "BED";
if(!night){
// TODO add push notification
context.actions.get("mail", "mail:smtp:gmail").sendMail("rlkoshak@gmail.com", "openHAB 3 Alert", message);
}
else {
// TODO Only send emails at night
context.actions.get("mail", "mail:smtp:gmail").sendMail("rlkoshak@gmail.com", "openHAB 3 Night Alert", message);
}
}
Code: Alles auswählen
context.actions.get("hue","hue:0210:00178810d0dc:1").fadingLightCommand("color", new PercentType(100), new DecimalType(1000));
Code: Alles auswählen
var hueActions = actions.get("hue","hue:0210:00178810d0dc:1")
hueActions.fadingLightCommand("brightness", new PercentType(100), new DecimalType(1000));
Code: Alles auswählen
==> openhab.log <==
2022-01-02 20:14:08.220 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'aaaa': Fail to execute action: 2
Code: Alles auswählen
var hueActions = actions.get("hue",'hue:group:02648f68d9:14') hueActions.fadingLightCommand("brightness", 100, dimTime);
var hueActions = actions.get("hue",'hue:group:02648f68d9:14'); hueActions.fadingLightCommand("brightness", 100, dimTime);
var hueActions = actions.get("hue",'hue:group:02648f68d9:14').fadingLightCommand("brightness", 100, dimTime);