[SOLVED] Sending notification when a device changing its state

Evening,

I would like to send notification via openhab app when a device changes a state.
For example this item as below:

Light_GF_Living_Ceiling

I got this rule, but it does not behave as expected. What am I missing here ?

rule “Lamp ON notification”
when
    Item Light_GF_Living_Ceiling.state changed from OFF to ON
then
    sendNotification("andy.xxxx@gmail.com", “Test”)
    sendBroadcastNotification("Test")
end
.state

is not needed when defining a item trigger for your rule.

Try:

Item Light_GF_Living_Ceiling changed from OFF to ON

Tried this suggestion above but still not firing notification.
Any other clues ?

Any clue in the logs?

And your cloud connection is set up correctly?

Yes, it is complaining about that rule -

no viable alternative at input.

2019-01-14 22:52:43.636 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.rules' has errors, therefore ignoring it: [167,6]: no viable alternative at input '“'

Check your quote marks.

Thanks, corrected and works now - solved :wink:

1 Like