No idea what those packets are. The ip observer works by displaying a summery of all the data on a HTML page that can be fetched and scraped for the data. A simple GET request and you have all the data locally with no cloud and updated every 12 seconds. I don’t
Know of any other weather station that is in the same price range and can do that at the same time it uploads to weather underground.
OK Thanks.
Something I had in mind as possible also is use a NodeMCU or ESP32 module to accept the Ecowitt packets and convert to MQTT for HA (if not via the native ESPhome API). Those modules cost as little as $4.
Unfortunately while I can see the chain of hardware/code required, it’s too big a knowledge stretch for me to create that code myself. If we go into lock-down again here I might have the time to learn…
Sorry, don’t know that - this is question for weeWX community…
I was looking to add the data from my weather startion directly to the DB in HA. Found the homeassistant_ecowitt intergration in Community HACS. If you’ve got the WS View app you can configure the connection in the Customized Server tab to point the data at your HA IP and chosen port.
Hey guys,
my weewx wont’s start, any ideas why?
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** File "/usr/share/weewx/user/interceptor.py", line 427, in __init__
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** iface, pcap_filter, promiscuous)
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** File "/usr/share/weewx/user/interceptor.py", line 469, in __init__
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** self.sniffer.open_live(iface, snaplen, pval, timeout_ms)
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** File "/usr/lib/python2.7/dist-packages/pcap.py", line 108, in open_live
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** def open_live(self, *args): return _pcap.pcapObject_open_live(self, *args)
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL weewx.engine: **** TypeError: in method 'pcapObject_open_live', argument 2 of type 'char *'
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL __main__: Unable to load driver: in method 'pcapObject_open_live', argument 2 of type 'char *'
Jun 24 10:50:56 raspberrypi weewx[1404] CRITICAL __main__: **** Exiting...
Weewx config file problem…
Try to update weewx platform and go line by line in configuration…
Also it seems that you do not have installed all used add-ons in weewx. Where do you run weewx?
It happened after an apt upgrade. I think something broke during the install, might be some python incompatibility.
Running it on a raspberry pi 3.
Solved uninstalling and cleaning up everything related to python3.
Question, is there a way to use our own wx station data to populate the weather card? It would be awesome to have such an option.
For Proxmox users here is clone of up-to-date (20.04.2022) Raspberrian OS with working weeWX image.
Username:
homeassistant
Password:
virtualclone2020_weeWX%
Proxmox image:
https://www.vseznalec.si/homeassistant/weewx.vma.zst
MySQL database:
https://www.vseznalec.si/homeassistant/weewx.sql
sensor:
- platform: mqtt
name: "Relativna vlažnost"
icon: mdi:water-percent
state_topic: "weather/outHumidity"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "%"
- platform: mqtt
name: "Pritisk (višinomer)"
icon: mdi:gauge
state_topic: "weather/altimeter_mbar"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mBar"
- platform: mqtt
name: "Pritisk"
icon: mdi:gauge
state_topic: "weather/pressure_mbar"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mBar"
- platform: mqtt
name: "Stopnja padavin"
icon: mdi:umbrella-outline
state_topic: "weather/rainRate_cm_per_hour"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm/h"
- platform: mqtt
name: "Stopnja padavin (zadnja ura)"
icon: mdi:umbrella
state_topic: "weather/hourRain_cm"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm/h"
- platform: mqtt
name: "Padavine (danes)"
icon: mdi:umbrella
state_topic: "weather/rain24_cm"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm"
- platform: mqtt
name: "Temperatura"
state_topic: "weather/outTemp_C"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "°C"
- platform: mqtt
name: "Sončno sevanje"
icon: mdi:radioactive
state_topic: "weather/radiation_Wpm2"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "watts/m²"
- platform: mqtt
name: "UV"
icon: mdi:sunglasses
state_topic: "weather/UV"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "index"
- platform: mqtt
name: "Hitrost vetra"
icon: mdi:weather-windy
state_topic: "weather/windSpeed_kph"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "km/h"
- platform: mqtt
name: "Sunek vetra"
icon: mdi:weather-windy-variant
state_topic: "weather/windGust_kph"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "km/h"
- platform: mqtt
name: "Smer vetra"
icon: mdi:wind-turbine
state_topic: "weather/windDir"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "°"
How to edit config file:
USR - Username
PW - Password
XXX - Missing data
MySQL data:
MQTT data:
Additional settings:
For additional info and settings how to make DNAT forwarding check step 2:
BR,
Simon
please, help me: first steps into Home Assistant
Weewx running, MQTT working, I copied KSLB configuration into HA configuration file,and I can succesfully verify the config, but I can’t obtain the sensors.
here’s my complete config.yaml
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
wundergroundpws:
api_key: xxxxxxxxxxxxxxxxxxxxxxxxx
pws_id: xxxx
numeric_precision: none
# Required to generate HASS weather Entity for weather forecast card
weather:
- platform: wundergroundpws
# Required if you wish to add sensors
sensor:
- platform: wundergroundpws
monitored_conditions:
- humidity
- precipRate
- precipTotal
- pressure
- temp
- windSpeed
media_source:
# Terrazzo
- platform: foscam
ip: xxxxxxxxxx
port: xx
username: !secret camera_login
password: !secret camera_psw
name: Terrazzo
# Veranda
- platform: foscam
ip: xxxxxxxxxxxxxx
port: xxxx
username: !secret camera_login
password: !secret camera_psw
name: Veranda
# Cucina
- platform: foscam
ip: xxxxxxxxxxxxxxx
port: xxxxxx
username: !secret camera_login
password: !secret camera_psw
name: Cucina
# Garage
- platform: foscam
ip: xxxxxxxxxxx
port: xxx
username: !secret camera_login
password: !secret camera_psw
name: Garage
- platform: mqtt
name: "Relativna vlažnost"
icon: "mdi:water-percent"
state_topic: "weather/outHumidity"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "%"
- platform: mqtt
name: "Pritisk (višinomer)"
icon: mdi:gauge
state_topic: "weather/altimeter_mbar"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mBar"
- platform: mqtt
name: "Pritisk"
icon: mdi:gauge
state_topic: "weather/pressure_mbar"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mBar"
- platform: mqtt
name: "Stopnja padavin"
icon: mdi:umbrella-outline
state_topic: "weather/rainRate_cm_per_hour"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm/h"
- platform: mqtt
name: "Stopnja padavin (zadnja ura)"
icon: mdi:umbrella
state_topic: "weather/hourRain_cm"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm/h"
- platform: mqtt
name: "Padavine (danes)"
icon: mdi:umbrella
state_topic: "weather/rain24_cm"
value_template: '{{ value | round(0) }}'
unit_of_measurement: "mm"
- platform: mqtt
name: "Temperatura"
state_topic: "weather/outTemp_C"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "°C"
- platform: mqtt
name: "Hitrost vetra"
icon: mdi:weather-windy
state_topic: "weather/windSpeed_kph"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "km/h"
- platform: mqtt
name: "Sunek vetra"
icon: mdi:weather-windy-variant
state_topic: "weather/windGust_kph"
value_template: '{{ value | round(1) }}'
unit_of_measurement: "km/h"
thanks
Looks like you are using the old format for Mqtt sensors.
They should be similar to the below:
mqtt:
sensor:
- name:
I have an AmbientWeather WS-2902C which is sending data to weewx running on a RPI 4B 8Gg Ram running on a 1TB SSD. I have Home Assistant Supervised running on the same RPI, and I am also using the AmbientWeather integration in HA. As I wanted to do alot more with the weather station such as sending all the raw data to weather web sites all over the world (AWEKAS example below), I am also running weewx on that same RPI and it is listening to the console data being sent to ambientweather utilizing the “customized” AWNET connection feeding to weewx. To track the continuous success or failure or REST api calls made by weewx to the weather web sites, I have changed the weewx.log file location to:
/usr/share/hassio/share/weewx.log
- which then makes that log file visible within the HA container for tailing with GREP - and I have command line sensors with pretty complex logic to track the weewx transmissions as they take place (to numerous weather web sites as shown below) so that I can track the status of the those transmissions. Here is what the lovelace card for that looks like (“Cnsl” is the AmbientWeather console):
For example, the logic for the AWEKAS (although I am in NJ this web site for my weather station is in Germany LOL) and their website if my favorite, graphically:
anyway, the AWEKAS command-line sensor coniguration.yaml is:
- platform: command_line
name: WEEWX_LAST1_SENT_TO_AWEKAS
command: "grep 'AWEKAS: Published' /share/weewx.log | tail -1 | cut -c-255"
scan_interval: 30
command_timeout: 5
value_template: >
{% set data = value | regex_findall('\(([0-9]+)\)') | first | int | as_datetime | as_local %}
{% set ts = data.year ~ ' ' ~ (value | regex_findall('(.+)kruse-pi weewx') | first).strip() %}
{% set time = strptime(ts, '%Y %b %d %H:%M:%S', data) | as_local %}
{% set str = time.strftime('%a %-m/%-d %-I:%M:%S%p') ~ ' (5 min)' %}
{% set indx = str.find("M (") %}
{% set oldstr = str[indx-1:indx+1] %}
{{ str.replace(oldstr,oldstr.lower()) }}
unique_id: WEEWX_LAST1_SENT_TO_AWEKAS
And the most nightmarish one is “Last Weewx Error:” which has to look at the logic for all of the other sensors to see when they each last had an error, and then report on the most recent one - IF it is still in an error state (and this was a nightmare to figure out):
- platform: command_line
name: WEEWX_LAST1_REST_CALL_FAILURE
command: "grep 'ERROR weewx.restx:' /share/weewx.log | tail -1 | cut -c-255"
scan_interval: 60
command_timeout: 5
value_template: >
{% set data = value | regex_findall('\(([0-9]+)\)') | first | int | as_datetime | as_local %}
{% set errortime = strptime(now().year ~ ' ' ~ ' '.join(value.split(' ')[0:3]),'%Y %b %d %H:%M:%S',data) | as_local %}
{% set errordestination = (((value | regex_findall('(.+): Failed to publish') | first).strip() | regex_findall(': (\w+)') | first).strip()).lower() %}
{% set sensortoretry = 'sensor.weewx_last1_sent_to_' + errordestination %}
{% set thisyear = now().year %}
{% set statessensorretry = states(sensortoretry) %}
{% set joiner1 = ' '.join(states(sensortoretry).split(' ')[0:3]) %}
{% set joiner2 = now().year ~ ' ' ~ joiner1 %}
{% set sensorretriedtime = strptime(joiner2,'%Y %a %m/%d %I:%M:%S%p',data) | as_local %}
{% if (sensorretriedtime > errortime) %}
{{ 'No current errors' }}
{% else %}
{% set ts = data.year ~ ' ' ~ (value | regex_findall('(.+)kruse-pi') | first).strip() %}
{% set time = strptime(ts, '%Y %b %d %H:%M:%S', data) | as_local %}
{{ time.strftime('%a %-m/%-d %-I:%M:%S%p') }}, {{ (value|regex_replace(find='EDT \(([0-9]+)\):', replace='EDT:', ignorecase=False)).split("weewx.restx: ",1)[1] }}
{% endif %}
unique_id: WEEWX_LAST1_REST_CALL_FAILURE
Anyway, here is my question. Although I am using an SSD, I would much rather reduce all the ‘log scraping’ (which is really amatueurish (sp?) in my opinion!) and instead have MQTT messages for each of those transmissions as they take place, sent from weewx to home assistant instead. I will also eventually need to do this instead of the log scraping as I add more functionality (video monitoring etc) to Homa Assistant the RPI at that point won’t be enough hardware (and I would use the RPI only for weewx then) - so such MQTT messages would need to be sent over the network from separate weewx & HA machines. So how do I get the MQTT functionality working from weewx to HA to feed the same data into those what are currently command line sensors - just the information about the restx transmissions - without scraping the log from within weewx to send the message across?
If I understand your question, first you need to add MQTT extension to weewx.
Then add your Mqtt sensors into home assistant
# Temperatures
- name: "VP2 Outside Temperature"
state_topic: "weewx/outTemp_C"
unit_of_measurement: "°C"
value_template: "{{ (value | round(2) | float) }}"
- name: "VP2 Inside Temperature"
state_topic: "weewx/inTemp_C"
unit_of_measurement: "°C"
value_template: "{{ (value | round(2) | float) }}"
# Humidity
- name: "VP2 Outside Humidity"
state_topic: "weewx/outHumidity"
unit_of_measurement: "%"
value_template: "{{ (value | round(0) | float) }}"
- name: "VP2 Inside Humidity"
state_topic: "weewx/inHumidity"
unit_of_measurement: "%"
value_template: "{{ (value | round(0) | float) }}"
# Winds
- name: "VP2 Wind Direction"
state_topic: "weewx/windDir"
unit_of_measurement: "°"
value_template: "{{ (value | round(1) | float) }}"
- name: "VP2 Wind Gust Direction"
state_topic: "weewx/windGustDir"
unit_of_measurement: "°"
value_template: "{{ (value | round(1) | float) }}"
# Winds
- name: "VP2 Wind Gust"
state_topic: "weewx/windGust_kph"
unit_of_measurement: "KPH"
value_template: "{{ (value | round(1) | float) }}"
- name: "VP2 Wind Speed"
state_topic: "weewx/windSpeed_kph"
unit_of_measurement: "KPH"
value_template: "{{ (value | round(0) | float) }}"
Hope that helps.
Thank you @atomic10, I also read through the link… However the topics in your example on the HA side as well as the weewx data are only sending and receiving weather station measurements themselves (which I already have in HA from the AmbientWeather integration)…
FYI an example of the weewx.log entry for the results of sending data, (to AWEKAS as that is our example in the original post, looks like this):
Apr 25 09:45:24 kruse-pi weewx[513] INFO weewx.restx: AWEKAS: Published record 2023-04-25 09:45:00 EDT (1682430300)
So - is it possible to just publish once (with success results) for each successful or unsuccessful data transmission attempt from weewx to weather websites - reporting that to Home Assistant in a smilar manner to what is shown in the lovelace card screen snapshot in my earlier post?
I dont believe weewx natively records that via mqtt, it just publishes weather data.
You could write yet another log scraper to look for those errors, and publish something via MQTT outside of HA, but that doesnt add a heap of value and is still scraping logs.
Thank you I thought as much. I figured out where to make changes in the WEEWX source code to grab this information to publish, but never went any further down that rabbit hole because it would be overwritten the next time a new version comes out!
You could always submit a PR for your change
Works perfectly. Thank you
Hey guys,
for who might be interested (@mtaliesin), I did post a working weewx config some time ago:
Also, please pay attention to the note regarding packages further down. @mtaliesin your example with all definitions in one file is not ideal…