On Wednesday, January 30, 2019 at 12:20:37 AM UTC-8, Andy Hudson-Smith 
wrote:

> Below is the snip in case it also helps anyone else. Easy when you know 
> how :)
>
>        
>        
>         topic = downhamweather
>         binding = loop
>         unit_system = METRICWX
>         [[[inputs]]]
>         [[[[windSpeed]]]]
>         name = windSpeed_mph
>         format = %.1f
>         units = mile_per_hour
>
>
>
Hmmm - this doesn't make sense.  Name is optional.

If you look at the docs for the MQTT extension 
(https://github.com/weewx/weewx/wiki/mqtt) there are examples of how to set 
the units for a particular element.  Read the paragraph under the examples 
code snippet carefully.

   - If you set units, the extension publishes to a MQTT topic with the 
   default name of windSpeed, just in mph rather than your system default 
   of metric
   
   - If you supersede the name, it publishes to a new MQTT topic ala 
   windSpeed_mph that you mentioned
   
   - the 'name' can be totally bogus - if you set name="xyzzy" then it 
   would create a MQTT topic windSpeed_xyzzy
   

   - if you set units 'and' a name, it publishes to a new topic with 
   altered units

I suspect what was happening all along is weewx was probably working 
correctly, unless you actually got errors.  You didn't provide the usual 
logfile excerpts so it's hard to say for certain.

My guess is you actually 'had' windSpeed publishing in MQTT in mph, but you 
were 'subscribing' on the consumer side to a different name for that MQTT 
topic.  So your MQTT 'subscriber' side was likely looking for a topic name 
that the 'publishing' side - ie, the weewx extension - didn't publish.

Note also that Matthew uses weewx-ish syntax on his web page, and the word 
'upload'.   If you think MQTT-centric, the terminology is 
publish/subscribe.  The extension publishes data to MQTT topics.  Your 
consuming code (Belchertown skin?) subscribes to the topics it want.  You 
have to have the MQTT topic name lined up on both sides.


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to