KSKENYON <[email protected]> writes:

> I'm stumped.  wxMesh.py v0.2 runs fine with b7 and python3 after a few 
> small tweaks.
>
> Now matter what or how I send data from mosquitto I get this weewx error 
> about being unable to convert to float.  I've tried every format I can 
> think of on the publish line and everything is rejected.  I must be missing 
> something obvious about the format for the publish data.  Any ideas?
>
> Jan 05 17:49:12 mythtv /weewxd[173413]: wxMesh: dateTime 1578264552
>
> Jan 05 17:49:12 mythtv /weewxd[173413]: *wxMesh: cannot read value for 
> 'weewx': could not convert string to float: "b'{time:0}\\n\\n'"*

MQTT defines how to send a value on a topic, but does not declare how
values must be formatted -- so it is part of an application-level
protocol specification, but not the whole thing.

Someplace, someone should have written down what topics are in use and
how the values should be formatted.  Then, for wxMesh as a receiver,
there can be a notion of what is correct to transmit.  I would suggest
that doing that in arrears is a useful exercise to resolve your issue,
even though it may appear like too much work and unfun.

In your log, it's really hard to tell whether the value is

  b'{time:0}\\n\\n'

which looks like python 3 source code for a string with something that
looks sort of like json in it, or

  {time:0}

which looks like json, except that time is not quoted.

It seems very likely that your issue is a lack of agreement between the
sender and receiver about these sorts of things.


I am not using wxMesh, but I am using the MQTT publish extension, using
the aggregate method to publish a json dictonary, which begins

  {"monthET": "0.06", ......

and that is read by Home Assistant (using a template sensor to extract
the value for a key) just fine.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/rmilfql4gsw.fsf%40s1.lexort.com.

Reply via email to