New Units and Unit Groups for MQTT

144 views
Skip to first unread message

Karen K

unread,
Jan 23, 2021, 9:18:28 PM1/23/21
to weewx-user
I installed MQTTSubscribe service. In this case it provides data about water level (unit cm) and water flow (unit cubic meter per second) of the near river.

As those units and unit group are not included in the standard weewx I have to assign them elsewhere.

Because I use the MQTTSubscribe service, there is no need to write an extension. On the other hand, no extension file means no place to put the assignment of the additional units and unit groups.

Could I declare those units and unit groups somewhere in weewx.conf?

Is there any other possibility?

weather list

unread,
Jan 23, 2021, 9:33:17 PM1/23/21
to weewx...@googlegroups.com
Karen,

When you have a moment I would be interested in the devices you are using to measure water level and flow.

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/6bb4393f-6685-4088-ae0a-90d2f79619b8n%40googlegroups.com.

bell...@gmail.com

unread,
Jan 23, 2021, 9:48:32 PM1/23/21
to weewx-user
I'll be interested in hearing if there is a better way, but here is what I did to add a new observation.
1. Wrote this service.

import weewx

import weewx.units
weewx.units.obs_group_dict['honeywell01'] = 'group_temperature'
weewx.units.obs_group_dict['honeywell02'] = 'group_temperature'
weewx.units.obs_group_dict['honeywell03'] = 'group_temperature'

class Noop(weewx.engine.StdService):
    pass

2. Updated weewx.conf
        prep_services = weewx.engine.StdTimeSynch , user.bellrichm.Noop

rich

Karen K

unread,
Jan 24, 2021, 10:57:47 AM1/24/21
to weewx-user
@Rich: Yes, I was afraid that that is the only way to do it. So I guess, I will do it the same way

@Weatherl: Oh, I did not install devices of my own. Instead I got permission to read the readings of the official level and flow meters from the government. They provide an API in the Internet here. If you register with them you can get the data live.

bell...@gmail.com

unread,
Jan 25, 2021, 12:09:55 AM1/25/21
to weewx-user
Karen, 
If you pst what you have done, I’d be willing to look at updating MQTTSubscribe to have a configuration option. If we get something working, perhaps a pull request to WeeWX might result.
rich

Karen K

unread,
Jan 28, 2021, 8:03:22 PM1/28/21
to weewx-user
I am not sure that I understood what I am expected to post. The units and unit group definition file I created is this:
roedl.py

bell...@gmail.com

unread,
Jan 28, 2021, 10:45:17 PM1/28/21
to weewx-user
Thanks, that is exactly what I was looking for. I know it is too late for you, but I thought other people might need to add units, unit groups, and observations. So, I was looking for a real world example. I’ve opened issue 118 to work on this in MQTTSubscribe.

Karen K

unread,
Feb 7, 2021, 11:05:57 AM2/7/21
to weewx-user
I extended the file by trend values. Look at the new file attached, please.
roedl.py

Karen K

unread,
Feb 19, 2021, 9:31:47 AM2/19/21
to weewx-user
The last version of the file is attached.

There is something added to use the data within a binding.
pegel.py
Reply all
Reply to author
Forward
0 new messages