Hi again Vince and thank you also Tom. I agree to the point that the source 
for the overriden function "can't really afford to change" - but wouild 
assume any updated version however when I do update would include another 
copy of the same file so I'd have to go replace it each time with my own 
etc.... Rethinking this... even later extensions such as say to send to 
"Meteoservices" is also inherited from that original function so if I 
changed the original at that parent level it woiuld cap[ture those too?

I used to write alot of code in my previous life for trading systems on 
wall street but that was a long time ago - so that along with the fact this 
is on my spare time which I have very little of and I am new to Python and 
MQTT etc... not sure it it's worth the hassle to figure out how to do it in 
an elegant proper manner. I guess I'll continue to search high and low when 
I have the time to figure out how to, from within HA, to listen to the 
network traffic - which I don't think I will find - or as a second option 
to find some plugin that will scrape logs... sigh...

So.... while I look for a way for HA to listen to network traffic - do 
either of you guys know of any very lightweight processes I could put on 
the RPI to listent to traffic and publish to MQTT? The cron job is a good 
idea but that's still scraping the logs rather than listnining to traffic, 
correct?

On Wednesday, July 6, 2022 at 8:20:03 PM UTC-4 [email protected] wrote:

> This monkey patch would be pretty safe. The function process_record() is 
> intended to be overridden by subclasses, so it can't really afford to 
> change.
>
> Not to mention, log entries can change too!
>
> On Wed, Jul 6, 2022 at 1:48 PM vince <[email protected]> wrote:
>
>> Some creative syslog config file rewrite rules might be able to generate 
>> separate output file(s) and associated data in a format you can parse with 
>> HA, but how to do it depends on your os and which syslog daemon(s) you are 
>> running.
>>
>> Personally, I'd use a cron job to publish to MQTT every few minutes and 
>> simply have HA subscribe to those topics.
>>
>> If you do it by patching weewx, you'll have to keep that patch valid as 
>> weewx changes, so that's probably less good a direction to follow.
>>
>> On Tuesday, July 5, 2022 at 8:44:08 PM UTC-7 [email protected] wrote:
>>
>>> The below 3 lines (I put blank lines between them for readability) from 
>>> my weewx.log, regarding my AmbientWeather WS-2902C weather station:
>>>
>>> Jul 5 23:00:30 kruse-pi weewx[701] INFO weewx.restx:
>>> Windy: Published record 2022-07-05 23:00:00 EDT (1657076400)
>>>
>>> Jul 5 23:00:30 kruse-pi weewx[701] INFO weewx.restx: 
>>> WindGuru: Published record 2022-07-05 23:00:00 EDT (1657076400)
>>>
>>> Jul 5 23:00:30 kruse-pi weewx[701] INFO weewx.restx: CWOP: Published 
>>> record 2022-07-05 23:00:00 EDT (1657076400)
>>>
>>>
>>> There are many others but that is a simple example of three weather 
>>> sites where I am pushing weather data.
>>>
>>> This instance of Weewx is running on a Raspberry PI 4B 8GB running a 1TB 
>>> SSD (rather than a micro SD card) for performance reasons.
>>>
>>> Also on that same RPI, I have Home Assistant Supervised running in a 
>>> docker. 
>>>
>>> I don't care what the mechanism is other than something elegant (ideally 
>>> by listening to network traffic, not by log scraping), reliable and 
>>> lightweight, but I am trying to determine the best way to be notified 
>>> within Home Assistant the most recent time I have sent data to each of 
>>> these websites, being updated each time another API call is successfully 
>>> made.
>>>
>>> Home Assistant supports MQTT, but out of the box functionality for weewx 
>>> as I understand it MQTT is only available for sending the weather data to 
>>> destination/s via MQTT, not reporting when RESTful API calls are 
>>> successfully published, which is the notification I need. Is there an 
>>> extension for this or would it be something I need to create myself 
>>> (notifications about successful API calls)?
>>>
>>> Best Regards,
>>>
>>> -R. Kruse Ludington
>>>
>>> 📱(M): +1.201.925.4410 <(201)%20925-4410>
>>> 📞(O): +1.862.308.7040 <(862)%20308-7040>
>>> 📞(H): +1.201.857.8307 <(201)%20857-8307>
>>> 📠(F): +1.201.857.7188 <(201)%20857-7188>
>>>
>> -- 
>>
> 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].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/2265112d-89e2-4f51-91c2-0fa01d0ff98dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/2265112d-89e2-4f51-91c2-0fa01d0ff98dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/00d62d6f-5a24-4851-b1bd-f8749d718752n%40googlegroups.com.

Reply via email to