tnemrap
(Michael Parment)
January 19, 2019, 10:34pm
1
I have a channel type
<channel-type id="forecasted-wind-speed">
<item-type>Number:Speed</item-type>
<label>Forecasted Wind Speed</label>
<description>Forecasted wind speed.</description>
<category>Wind</category>
<state readOnly="true" pattern="%.1f %unit%" />
</channel-type>
This is now displaying km/s and i want it in m/s.
I do not understand how to do according to https://www.eclipse.org/smarthome/documentation/concepts/units-of-measurement.html
/Mike
rlkoshak
(Rich Koshak)
January 20, 2019, 2:44am
2
I believe you need to define your Item as Number:Speed
and in the label use [%d m/s]
. Unfortunately I don’t know how to use them in Rules as well. @vzorglub , do you have an example handy? You are the foremost UoM expert I know on the forum.
vzorglub
(Vincent Regaud)
January 20, 2019, 8:14am
3
I have never dealt with UoM in things definitions. I use the GUI for things.
km/s is surprising though because the default unit is km/h
What does the binding return as a raw value? Is is in m/s or what unit?
Celaeno1
(Alex)
January 20, 2019, 8:50am
4
@tnemrap
According to documentation above it should be:
Number:Speed windspeed "Windspeed [%.1f m/s]" { channel="...#wind-speed" }
tnemrap
(Michael Parment)
January 20, 2019, 9:37am
5
Sorry i meant km/h.
m/s
I thought that i could do something with Number:Speed to get other Units, otherwise i can just use Number.
/Mike
tnemrap
(Michael Parment)
January 20, 2019, 9:54am
6
I am also wondering if i can get the System State Channel Types
<channel id="ws" typeId="system.wind-speed" />
to display in m/s or do i have to create a channel-type?
/Mike
vzorglub
(Vincent Regaud)
January 20, 2019, 11:11am
7
That’s up to the user.
If you provide a channel with the default unit (ie. km/h) then it’s up to the user to convert in m/s or knots or moot/fortnight
tnemrap
(Michael Parment)
January 20, 2019, 11:15am
8
I want it to display correct even it is automatic created in PaperUi.
/Mike
vzorglub
(Vincent Regaud)
January 20, 2019, 11:17am
9
You are giving yourself more work, let the system work for you