- Platform information: Pi3
- openHAB version: openhabian
Hi guys, I am just trying to move over some DSL rules to scripts.
I am trying to send a notification of a battery level. The items is reading fine.
Is state.toString the way to send an item value to a broadcast notification? I can’t seem to get it to work.
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var NotificationAction = org.openhab.io.openhabcloud.NotificationAction;
var ScriptExecution = Java.type("org.openhab.core.model.script.actions.ScriptExecution");
if (itemRegistry.getItem('Test_Sw').getState() == 'ON')
{
NotificationAction.sendBroadcastNotification("GW battery is {}" + GPSTrackerGW_BatteryLevel.state.toString );
}