MQTT not updating with unit knot
Closed this issue · 1 comments
al-9000 commented
hi
using knot unit for mqtt:
[StdRESTful]
[[MQTT]]
server_url = *********************
topic = weather
unit_system = METRIC
binding = archive, loop
aggregation = aggregate
[[[inputs]]]
[[[[windSpeed]]]]
units = knot
[[[[windGust]]]]
units = knot
cause both windspeed/wingust not updating on the page.
in ./js/belchertown.js.tmpl line 1555 and below, _knot simply doesn't exist. adding:
if ( data.hasOwnProperty("windSpeed_knot") ) {
jQuery(".curwindspeed").html( parseFloat(parseFloat(data["windSpeed_knot"])).toLocaleString("$system_locale_js", {minimumFractionDigits: unit_rounding_array["windSpeed"], maximumFractionDigits: unit_rounding_array["windSpeed"]}) );
}
if ( data.hasOwnProperty("windGust_knot") ) {
jQuery(".curwindgust").html( parseFloat(parseFloat(data["windGust_knot"])).toLocaleString("$system_locale_js", {minimumFractionDigits: unit_rounding_array["windGust"], maximumFractionDigits: unit_rounding_array["windGust"]}) );
}
solved the issue.
best regards
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.