I can control a relay via rule, but not via Paper UI

The rules work well, including those that control the relays.
So what I am missing is a switch that triggers a rule. Is that what you mean?
That actually sounds good.
Do you have an example?

Sure

rule "my first rule"
when
   myItem received command ON
then
   executeCommandLine( whateverItIsYouNeedToDoToTurnTheRelayOn )
end

I have now tried the rule:
rule “switch relay manually”

when
Greenhouse received command ON
then
executeCommandLine (/ usr / bin / python3 /etc/openhab2/scripts/relais.py 4 “ON”)
end

when
Greenhouse received command OFF
then
executeCommandLine (/ usr / bin / python3 /etc/openhab2/scripts/relais.py 4 “OFF”)
end

It doesn’t work yet, what do I write in the command line in things?
Is it correct to connect the channel input value with the item?

I saw in another amount that the command was set in “”, I did that but it doesn’t work yet.
In the log file I see that the command that was in the thinhs still appears. The thing is bound to the exec binding, must or can I change that?

Yes, you would need to check the syntax to use executeCommandLine

There are lots of examples in the forum, but be sure to use OH3 examples.

You’d probably use something like

 var results = executeCommandLine ( Duration.ofSeconds(5), "/usr/bin/python3/etc/openhab2/scripts/relais.py","4","ON")
 logInfo("exec", "results: " + results)

I do not understand. There are no channels involved this way.

the previous things is bound to the exec binding, where a command is required. is the things perhaps no longer needed? Can I only work with the item?

That’s right.

First of all, thank you so far, I have confused a lot and I have to sort myself out again, I will get back to you.

Hallo zusammen, ich habe das System jetzt am Laufen. Ich habe den Vorschlag von rossko57 aufgegriffen
und konnte ihn nach einigen Schwierigkeiten umsetzten.
Der erste Versuch hat ĂŒberhaupt nicht funktioniert.
Ich habe dann im Netz nach weiteren Hinweisen gesucht und auf einen Àhnlichen Fall gestossen. Die Lösung bestand darin, das der Cache gelöscht werden musste.

sudo systemctl stop openhab2
sudo openhab-cli clean-cache
sudo systemctl start openhab2

Danach konnten die Funktionen ausgefĂŒhrt werden.

Danke fĂŒr euere Hilfe.

English please, this is an international community.

Sorry, I wrote German again, here is the translation

Hello everyone, I have the system up and running now. I took up rossko57’s suggestion
and was able to implement it after some difficulties.
The first attempt didn’t work at all.
I then searched the net for further information and came across a similar case. The solution was that the cache had to be cleared.

sudo systemctl stop openhab2
sudo openhab-cli clean-cache
sudo systemctl start openhab2

After that, the functions could be executed.

Thank you for your help.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.