rule “Shelly”
when
Item Shelly_XXXXX1_Relay changed
then
if (receivedCommand == ON){
Shelly_XXXXX1_Relay.sendCommand(ON)
}
else if (receivedCommand == OFF){
Shelly_XXXXX1_Relay.sendCommand(OFF)
}
end
.sitemap
Switch item=Shelly_XXXXX1_Relay icon=“light”
the item is correctly created and the binding is active and online.
I can see in the openhab paperui the current firmware and how far the object is located.
So this must work I think
Log when i try to change the switch
2020-01-16 20:27:03.594 [ome.event.ItemCommandEvent] - Item ‘Shelly_XXXXX1_Relay’ received command ON
2020-01-16 20:27:03.600 [nt.ItemStatePredictedEvent] - Shelly_XXXXX1_Relay predicted to become NULL
2020-01-16 20:27:07.481 [ome.event.ItemCommandEvent] - Item ‘Shelly_XXXXX1_Relay’ received command OFF
2020-01-16 20:27:07.485 [nt.ItemStatePredictedEvent] - Shelly_XXXXX1_Relay predicted to become NULL
I don’t know, why the relay1 is not controlled by the switch.
Does someone know what I am doing wrong?
I think the binding is “newly” so I don’t find any useful stuff at google :o
probably the send command “on” is wrong, I cant find in the binding example what i need to send to power off or power on the relay1…
if (receivedCommand == ON){
shelly:shelly25-relay:XXXXX1:relay1#output.sendCommand(ON)
seems not correct to me
i know only that way
else if (receivedCommand == OFF){
Shelly_XXXXX1_Relay.sendCommand(OFF)
but both doesnt work, so i dont know
still trying with my first configuration, but with the changed 2.5 at the item:)
The question is, how can i trigger the relay to turn on
is “on” enough or did i need something else
if (receivedCommand == ON){
Shelly_XXXXX1_Relay.sendCommand(ON)
}
else if (receivedCommand == OFF){
Shelly_XXXXX1_Relay.sendCommand(OFF)
Don’t know or understand why you have a String Item, Only need the Switch with the correct channel definition. Evend don’t understand your rule in the first post, it is superfluent.
Please mark this thread as solved if it is working now.
yes, it has no real sense.
It’s only for me, for a better understanding with openhab and the syntax
In some weeks, I want to control a roller shutter with this shelly.
And now I just try some cases like turning on a lamp with a switch on the sitemap
then with an if argument and so on.