hi,
I query my VU+ SATreceiver via http:
items:
String VU_Sendung “Aktuelle Sendung [%s]” (VU)|{ http="<[http://192.168.1.150:80/web/getcurrent:3000:REGEX(.?(.?).)]" }
String VU_Kanal “Sender [%s]” (VU)|{ http="<[http://192.168.1.150:80/web/getcurrent:3000:REGEX(.?(.?).)]" }
this is working great, but most of the time the VU+ is offline, so the events.log from openhab is filled with errormessages…
finding some hints in the forum, I could use a virtual switch to check whether the VU+ is on or offline.
so, but how do I implement a rule that continiously runs as long as the VU+ is online?
the rule just fires once when the receiver turns on, but if I switch the channel the rule somehow has to run again to get updates.
please use code fences (one of the buttons on the right) - makes it easier to read rules and items.
Do I understand correctly, that your usecase is to query the SatReceiver on the current channel and current segment to be written in a String? I guess, the Receiver isn’t capable of sending those information “onchange” by itself - so you have to make a rule, which makes that querys periodically-
Change the trigger of the rule to a cron interval of your Needs
place the SATreceiver == ON in a if clause within the then section
rule "VU auslesen"
when
Time cron "0 0/5 * * * ?" //every 5 minutes
then
if (SATreceiver.state == ON) {
var Sendung = http="<[http://192.168.1.150:80/web/getcurrent:3000:REGEX(.*?<e2eventname>(.*?)</e2eventname>.*)]"
var Kanal = http="<[http://192.168.1.150:80/web/getcurrent:3000:REGEX(.*?<e2servicename>(.*?)</e2servicename>.*)]" }
VU_Sendung.postUpdate(Sendung)
VU_Kanal.postUpdate(Kanal)
end
the error shows:
2018-02-22 10:55:00.646 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘VU auslesen’: An error occurred during the script execution: Couldn’t invoke ‘assignValueTo’ for feature JvmVoid: (eProxyURI: VUnotification.rules#|::0.2.1.2.0.0.1.0.0.2::0::/1)
I tried to replace var with val without success. can you decipher that message?