Mqtt subscriber values zero.

85 views
Skip to first unread message

Alex Slaets

unread,
Apr 7, 2021, 5:36:04 PM4/7/21
to weewx-user

Mqtt from reading PV .

Service receives topic
DEBUG user.MQTTSubscribe: (Service) MessageCallbackProvider data-> incoming topic: sunnybeam, QOS: 0, retain: 0, payload: b'\n{"time": "2021-04-07 22:53:34", "device":"140049694", "pac":0.00, "e_today":2.56, "e_total":19139.73}'

Data is not parsed value is zero’

DEBUG user.MQTTSubscribe: (Service) TopicManager data-> incoming sunnybeam: dateTime: 2021-04-07 22:56:48, device: 140049694.0, eToday1: 0.0, eTotal1: 0.0, pacInv1: 0.0

If course zero in, zero out.

DEBUG user.MQTTSubscribe: (Service) TopicManager data-> outgoing sunnybeam: dateTime: 1617829041.0, device: 140049694.0, eToday1: 0.0, eTotal1: 0.0, pacInv1: 0.0, usUnits: 16

Accumulator 
[Accumulator] 
 [[pacInv1]] 
 accumulator = scalar adder = add merger = minmax extractor = avg
 [[eToday1]] 
 accumulator = scalar adder = add merger = minmax extractor = last 
 [[eTotal1]] accumulator = scalar adder = add merger = minmax extractor = last

  [[topics]] 
 unit_system = METRIC 
 datetime_format = "%Y-%m-%d %H:%M:%S" 
 [[[Message]]]
 type = json keyword_separator = ":"
 [[[sunnybeam]]] 
 [[[[time]]]] 
 name = dateTime 
 conversion_type = none
 [[[[pac]]]] 
 contains_total = False 
 units = watt 
name = pacInv1 
 [[[[e_today]]]]
 contains_total = True 
 units = kilowatt_hour 
 name = eToday1
 [[[[e_total]]]] 
 contains_total = True 
 units = kilowatt_hour 
 name = eTotal1

vince

unread,
Apr 7, 2021, 5:55:38 PM4/7/21
to weewx-user
Is there a question there ?

Alex Slaets

unread,
Apr 8, 2021, 1:40:24 AM4/8/21
to weewx-user

;-) Ah ... brevity.
Question is, values in payload should go to packet. They are not, apart from the id. 
Op woensdag 7 april 2021 om 23:55:38 UTC+2 schreef vince:

Alex Slaets

unread,
Apr 8, 2021, 1:57:34 AM4/8/21
to weewx-user
OMG!
Something hits me as a rock here: Do I have to quote the numeric too, or is it a setting I overlooked ?


Op donderdag 8 april 2021 om 07:40:24 UTC+2 schreef Alex Slaets:

Alex Slaets

unread,
Apr 8, 2021, 4:11:50 AM4/8/21
to weewx-user

SOLVED:      Got confused by the setting   keyword_separator = "=" in the [[[Message]]] stanza. 
Thougt I had to replace that with a colon ":" . BAD IDEA. 


Op donderdag 8 april 2021 om 07:57:34 UTC+2 schreef Alex Slaets:

bell...@gmail.com

unread,
Apr 8, 2021, 10:05:07 AM4/8/21
to weewx-user

Glad you got it working. But, I am a bit puzzled. Since that option is not used for json messages, it should be ignored. This is how it works in my development environment.
Also, based on using the ‘message’ stanza, it looks like you are running one of the pre-releases. Heads up, this functionality did not make it into 2.0.0. I felt it hadn’t been tested enough. Your use of it helps on the testing front. Thanks!
rich

Alex Slaets

unread,
Apr 8, 2021, 12:40:56 PM4/8/21
to weewx-user
This is the version: VERSION = '2.0.0-rc06'  - a "release candidate indeed' .
I pulled . Now VERSION = '2.0.0'
Thanks ! 




Op donderdag 8 april 2021 om 16:05:07 UTC+2 schreef bell...@gmail.com:
Reply all
Reply to author
Forward
0 new messages