Number number_sagercaster_beaufort "Beaufort [%d]" <beaufort> {channel="sagercaster:sagercaster:triel:input#wind-speed-beaufort" [profile="follow"] }
rule "set number_sagercaster_beaufort"
when
Item MQTT_number_weewx_windSpeed_kph changed
then
var beaufort = transform("SCALE", "kmh_beaufort.scale", MQTT_number_weewx_windSpeed_kph.state.toString())
postUpdate(number_sagercaster_beaufort, beaufort)
logInfo("set number_sagercaster_beaufort", number_sagercaster_beaufort.toString())
end
Yes, it seem correct. Note, you do not need the follow profile anymore on the item definition as you will be setting the value via rule. I also think it should be sendCommand instead of postUpdate.
Note 2 : if it works as expected, you’re welcome to enrich the Sager doc with your code snippet
rule "set number_sagercaster_rain1h"
when
Item MQTT_number_weewx_hourRain_cm received update
then
var rainrate = ((MQTT_number_weewx_hourRain_cm.state as Number) * 10)
number_sagercaster_rainspeed.sendCommand(rainrate)
logInfo("set number_sagercaster_rain1h", number_sagercaster_rainspeed.toString())
end
You are sending a Number value while it expects a Number:Length, so you’re omitting the unit (“mm”) in the sendCommand (please refer UoM usage in the forum, or in the OH documentation).
But in fact it does not heart so much, Sager only checks if its different of 0 to decide wether its raining or not.
I am confused can you help me with this rule how to do it correctly??
rule "set number_sagercaster_rain1h"
when
Item MQTT_number_weewx_hourRain_cm received update
then
var rainrate = ((MQTT_number_weewx_hourRain_cm.state as Number) * 10)
number_sagercaster_rainspeed.sendCommand(rainrate)
logInfo("set number_sagercaster_rain1h", number_sagercaster_rainspeed.toString())
end
This is the file you have to translate in order to have it in another language. You can make a pull request on openhab-addons repo or transfer me the file if you’re not used to.
You could do something like :
var rainrate = String::format(“%.1f cm”,(MQTT_number_weewx_hourRain_cm.state as Number))
Hello,
I have a question about how to determine if sager is working? Cos even after 12hours i have not yet populated output items and nothing in log so far.
is there anything i can debug?
yes, i have all inputs set, some items are populated like velocity-beaufort and wind-evolution but nothing else.
You have forget to set the follow profile on some input channels (pressure and raining switch).
Also to test, you could decrease the observation period on the thing (6h by default for testing purpose).
I don’t see any existing output channel named “timestamp”
=> got it, it’s an error in the document coming from an older version. I will correct this.
Maybe you should use MainUI to create / link your items and when it works, move to file configuration if you really think it’s needed.
ok i thought that profile follow is just for items which does have channel itself, i’ve removed that from items which are populated by rules… will try to add that back.
removed timestamp, let’s see after one hour.
maybe some kind of debug in log or log in openhab log if there is an error would be nice
Thank you
edit: documentation is missing input:temperature as well as I can see in channels via openhabUI
If they are populated by rules, that’s fine to remove the follow profile.
You can get logs by activated logs at debug level for this binding (see appropriate how-to in the forum).
I will push a PR to take in account our discussions, doc enhancement, a bit of more logging.
After the various tests I made, it seems to be predicting.
good morning,
after night, forecast is populated.
I guess it was missing temperature input (as it is missing from documentation) but i found it when I’ve added thing via UI.
As well there is “rain amount” as Number, but in doc you have Number:Lenght so i’ve created another summy with Number only and it works.