Question about the configuration for the sager binding

Hello,
in the configuration fo the sager binding it is written:

wind-speed-beaufort	input	Number	Wind speed expressed using the Beaufort scale

But i only get kph from my weather station and I have a item with a transformation to beaufort

Number  windbeaufort       "Wind"          [SCALE(kmh_beaufort.scale):%d]                            {channel="weewx"}

How can I use this now for the sager plugin?

Thanks

I would recommend doing the Beaufort transformation in a rule and send the result to the item linked to the wind-speed-beaufort channel.

How can I do this?

Something like this :

beaufort = transform("SCALE", "kmh_beaufort.scale", wind_kph.state.toString())
postUpdate(target_item, beaufort)

Is this correct

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 :slight_smile:

One other issue

this value

Number:Length	 number_sagercaster_rainspeed "Précipitation 1h [%.2f %unit%]" <rain> {channel="sagercaster:sagercaster:smarthome:input#rain-qtty" [profile="follow"]}
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

should be mm? but displayed in m

is this correct??

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.

can you elp me with a snipped i am new to this and tried to search a for a example

Exemples here
Documentation here

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

@glhopital Is there also a way to get a translation in other languages?? I can contributing with other languages if I know how :wink:

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))

…not tested but should be close to what you need

I still see m in my sitemap

Yes, because of the default SI definition of length that is “m”.
You can change the definition of your item this way :

Number:Length	 number_sagercaster_rainspeed "Précipitation 1h [%.2f mm]"  ......

And please, read the docs. I know there’s a lot but you will gain in autonomy and knowledge of the system.

For my understanding so it’s now automatically converted from cm to mm??

Translation into german:

get this error now:

2020-04-22 09:41:20.466 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'set number_sagercaster_rainamount1h': f != org.eclipse.smarthome.core.library.types.DecimalType

And the timestamp is not set …

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.

Hello @kiznik, I’m going to take a look at it.
Can you please share your items definition related to SagerCaster channels ?
Thanks

sure here they are, thank you very much…

nothing in log nothing in the timestamp, just in
SWC_velocity_beaufort and SWC_windevolution

sagercaster:sagercaster:triel "Sager Triel" @ "Outside" [location="50.0,14.6"]
Number                  House_Pressure_Sealevel         "Sea level [%s hPa]"    <pressure>  (gStore10, Graph_Pressure)    { channel="sagercaster:sagercaster:triel:input#pressure" }
Switch                  Weather_RainHelperSwitch                                                                          { channel="sagercaster:sagercaster:triel:input#is-raining"}
Number                  WS_Beaufort                     "Beaufort [MAP(beaufort.map):%s]" <wind>        (gStoreChange, gWeather)                                                        { channel="sagercaster:sagercaster:triel:input#wind-speed-beaufort"}
Number:Angle            WS_WindAngle                    "Wind Angle"                                    (gStoreChange, gWeather)                                                        { channel = "mqtt:topic:weatherstation:wind_degrees", channel="sagercaster:sagercaster:triel:input#wind-angle" [profile="follow"]}                                                             
Number:Length           WS_RainfallHourly               "Last Hour [%.1f mm]"           <rain>          (gStoreHourly, gWeather, Graph_Weather_Rainfall)    ["Measurement","Rain"]      { channel = "mqtt:topic:weatherstation:rainfallhour", channel="sagercaster:sagercaster:triel:input#rain-qtty" [profile="follow"]}
Number:Dimensionless    forecastCurrentCloudiness       "Cloudiness [%d %unit%]"  <clouds>        { channel="openweathermap:weather-and-forecast:api:local:current#cloudiness", channel="sagercaster:sagercaster:triel:input#cloudiness" [profile="follow"] }

and outputs for now default

// SAGER CASTER outputs
Group gSager
String  SWC_forecast            "Weather Forecast"                      (gSager)                {channel="sagercaster:sagercaster:triel:output#forecast"}
String  SWC_velocity            "Wind Velocity"                         (gSager)                {channel="sagercaster:sagercaster:triel:output#velocity"}
Number  SWC_velocity_beaufort   "Wind beaufort"                         (gSager)                {channel="sagercaster:sagercaster:triel:output#velocity-beaufort"}
String  SWC_wind_from           "Wind from"                             (gSager)                {channel="sagercaster:sagercaster:triel:output#wind-from"}
String  SWC_Wind_to             "Wind To"                               (gSager)                {channel="sagercaster:sagercaster:triel:output#wind-to"}
String  SWC_windevolution       "Wind Evolution"                        (gSager)                {channel="sagercaster:sagercaster:triel:output#wind-evolution"}
String  SWC_presstrend          "Pressure Trend"                        (gSager)                {channel="sagercaster:sagercaster:triel:output#pressure-trend"}
String  SWC_Temperature_trend   "Temperature Trend"                     (gSager)                {channel="sagercaster:sagercaster:triel:outpu#temperature-trend"}

DateTime SWC_ObservationTime    "Timestamp [%1$tH:%1$tM]"       <time>  (gSager)                {channel="sagercaster:sagercaster:triel:output#timestamp" }