Get weather data from LAN based ObserverIP PWS  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Get weather data from LAN based ObserverIP PWS

Post by eddieb »

Hi,
I run a local weather station in my LAN which sends its data to weather underground.
Besides that the weather station is reachable in my LAN by accessing it's webpage.
The data in this pages refreshes every minute and I would like to fetch it directly into domoticz.
The screen looks like this :
Screen Shot 2019-08-27 at 15.36.41.png
Screen Shot 2019-08-27 at 15.36.41.png (279.35 KiB) Viewed 3117 times
Data seems to be plain html like for example :

Code: Select all

 
   <tr>
      <td bgcolor="#EDEFEF"><div class="item_1">Indoor Temperature</div></td>
      <td bgcolor="#EDEFEF"><input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="24.3" maxlength="5" /></td>
   </tr>
As I am not familiar with LUA, any help in getting this to work would be appreciated.
Eddie.
Last edited by eddieb on Wednesday 28 August 2019 10:45, edited 2 times in total.
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by waaren »

eddieb wrote: Tuesday 27 August 2019 15:46 I run a local weather station in my LAN which sends its data to weather underground.
Besides that the weather station is reachable in my LAN by accessing it's webpage.
From what I read on the ambient home page there is an option to retrieve the data from the weather station using a JSON key. I cannot access the documentation page and I do not own thi weather station but using JSON will be by far the easiest solution. in Lua, dzVents or any other script- or Shell programming.
So may I suggest you contact ambient customer support on how to get the required API key and how to access the JSON / API documentation?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

Hi,
the problem is NOT getting data from ambiantweather or weatherunderground.
I want to parse the data on the local webinterface of the weatherstation. It contains more info than ambiantweather or weatherunderground.
the local webinterface is plain html and requestable from http://<local-ip>/livedata.htm
That is the screenshot I posted ..

Eddie
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by waaren »

eddieb wrote: Tuesday 27 August 2019 20:02 the problem is NOT getting data from ambiantweather or weatherunderground.
I want to parse the data on the local webinterface of the weatherstation. It contains more info than ambiantweather or weatherunderground.
I understood that part but was under the impression that you also could access the data in weatherstation itself via a JSON / API call
Some systems of this type with an web interface do have that. For example the Youless does have a webinterface but also returns a JSON if you use curl http://<Youless IP>/e
and processing such a JSON would be much easier to code.

If you want I can help with prototyping something to retrieve the values using dzVents I would need the complete livedata.htm as returned by a curl and the required fields.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

below the result of curl http://lan-ip/livedata.htm

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>LiveData</title>
        <link href="axcss0.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2" align="right" bgcolor="#0088F7">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="20" height = "80">&nbsp;</td>                                             
                            <td ><img src="img/1.jpg" width="74" height="80" ></td>
							<td width="10">&nbsp;</td>
                           	<td class="txtstyle_1" >AmbientWeather 4.5.7</td>                                   
                        </tr>
                </table></td>
            </tr>
            <tr> 
                <td colspan="2" align="right" bgcolor="#60B7FF">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" align="left" bgcolor="#C0C0C0">
                    <table width="20" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="bscsetting.htm">Local Network</a></div></td>
                            <td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="weather.htm">Weather Network</a></div></td>
                            <td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="station.htm">Station Settings</a></div></td>
                            <td bgcolor="#EDEFEF"><div class="menuitem_1"><a href="livedata.htm">Live Data</a></div></td>
                            <td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="correction.htm">Calibration</a></div></td>     
                        </tr>
                    </table>
                </td>
            </tr>
            <form name="livedata" method="POST" onsubmit="return chkForm(0);">  
                <tr>
                    <td colspan="2" bgcolor="#EDEFEF">&nbsp;</td>
                </tr> 
                <tr>
                    <td colspan="2" bgcolor="#EDEFEF"><div class="subitem_1">Live Data</div></td>
                </tr>   
                 <tr>
                    <td width="448" bgcolor="#EDEFEF"><div class="item_1">Receiver Time:</div></td>
                    <td width="352" bgcolor="#EDEFEF">                    
                    <input name="CurrTime" disabled="disabled" type="text" class="item_2" style="WIDTH: 120px" value="20:34 8/27/2019" maxlength="16"/></td>
                </tr>

                <tr>
                    <td width="448" bgcolor="#EDEFEF"><div class="item_1">Indoor Sensor ID and  Battery </div></td>
                    <td width="352" bgcolor="#EDEFEF">
                    <input name="IndoorID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x17" maxlength="5" />
                    <input name="inBattSta" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="Normal" maxlength="12" />
                    </td>
                </tr>                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Outdoor Sensor ID and Battery</div></td>
                    <td bgcolor="#EDEFEF">                    
                        <input name="Outdoor1ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0xef" maxlength="5" />
                        <input name="outBattSta1" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="Normal" maxlength="12" />
                    </td>
                </tr>                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Outdoor2 Sensor ID and Battery</div></td>
                    <td bgcolor="#EDEFEF">                    
                        <input name="Outdoor2ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x--" maxlength="5" />
                        <input name="outBattSta2" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="- -" maxlength="12" />
                    </td>
                </tr>             

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Indoor Temperature</div></td>
                    <td bgcolor="#EDEFEF"><input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="24.9" maxlength="5" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Indoor Humidity</div></td>
                    <td bgcolor="#EDEFEF"><input name="inHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="59" maxlength="3" /></td>
                </tr>
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Absolute Pressure </div></td>
                    <td bgcolor="#EDEFEF"><input name="AbsPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1012.90" maxlength="6" /></td>
                </tr>	
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Relative Pressure </div></td>
                    <td bgcolor="#EDEFEF"><input name="RelPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1010.90" maxlength="6" /></td>
                </tr>	
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Outdoor Temperature</div></td>
                    <td bgcolor="#EDEFEF"><input name="outTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="22.9" maxlength="5" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Outdoor Humidity </div></td>
                    <td bgcolor="#EDEFEF"><input name="outHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="87" maxlength="3" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Wind Direction </div></td>
                    <td bgcolor="#EDEFEF"><input name="windir" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="166" maxlength="5" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Wind Speed </div></td>
                    <td bgcolor="#EDEFEF"><input name="avgwind" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.0" maxlength="5" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Wind Gust </div></td>
                    <td bgcolor="#EDEFEF"><input name="gustspeed" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.0" maxlength="5" /></td>
                </tr> 
  				
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Max Daily Gust </div></td>
                    <td bgcolor="#EDEFEF"><input name="dailygust" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="20.2" maxlength="5" /></td>
                </tr> 
                                        
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Solar Radiation </div></td>
                    <td bgcolor="#EDEFEF"><input name="solarrad" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.00" maxlength="12" /></td>
                </tr>
                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">UV </div></td>
                    <td bgcolor="#EDEFEF"><input name="uv" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1" maxlength="12"></td>
                </tr>
                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">UVI </div></td>
                    <td bgcolor="#EDEFEF"><input name="uvi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0" maxlength="3"></td>
                </tr>
                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">PM2.5</div></td>
                    <td bgcolor="#EDEFEF"><input name="pm25" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="----" maxlength="8" /></td>
                </tr>

                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Hourly Rain Rate</div></td>
                    <td bgcolor="#EDEFEF"><input name="rainofhourly" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.00" maxlength="8" /></td>
                </tr>
                
                <tr>
                    <td bgcolor="#EDEFEF"><div class="item_1">Event Rain</div></td>
                    <td bgcolor="#EDEFEF"><input name="eventrain" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" /></td>
                </tr>
            
				<form name="Rain_1" method="POST" onsubmit="return chkForm(0);">  

	               <tr>
	                    <td bgcolor="#EDEFEF"><div class="item_1">Daily Rain</div></td>
	                    <td bgcolor="#EDEFEF"><input name="rainofdaily"  type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" />
                    <span id="rainofdaily_msg" class="errMsg0"></span></td>
	                </tr>

	                <tr>
	                    <td bgcolor="#EDEFEF"><div class="item_1">Weekly Rain</div></td>
	                    <td bgcolor="#EDEFEF"><input name="rainofweekly"  type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" />
                        <span id="rainofweekly_msg" class="errMsg0"></span></td>
	                </tr>

	                <tr>
	                    <td bgcolor="#EDEFEF"><div class="item_1">Monthly Rain</div></td>
	                    <td bgcolor="#EDEFEF"><input name="rainofmonthly"  type="text" class="item_2" style="WIDTH: 80px" value="58.80" maxlength="8" />
                        <span id="rainofmonthly_msg" class="errMsg0"></span></td>
	                </tr>

	                <tr>
	                    <td bgcolor="#EDEFEF"><div class="item_1">Yearly Rain</div></td>
	                    <td bgcolor="#EDEFEF"><input name="rainofyearly"  type="text" class="item_2" style="WIDTH: 80px" value="475.80" maxlength="8" />
                        <span id="rainofyearly_msg" class="errMsg0"></span></td>
	                </tr>
              
	                <tr>
	                    <td colspan="2" bgcolor="#EDEFEF">&nbsp;</td>
	                </tr>
	                <tr align="center">
	                    <td colspan="2" bgcolor="#EDEFEF"><input name="Apply" type="submit" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" onclick="setSubmitType(1)" value="Apply" />
	                        <input name="Cancel" type="reset" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" value="Cancel" /></td>
	                </tr>
            	</form>                

                <tr>
                    <td colspan="2" bgcolor="#EDEFEF">&nbsp;</td>  
                </tr>

                <tr>
                    <td colspan="2" align="center" bgcolor="#EDEFEF">
                     	<input name="rain_Default" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;"  onclick="raindef()" value="Rain Reset">
                        <input  id="refresh_st" type="button" class="item_4" style="WIDTH: 110px; HEIGHT: 24px;"  onclick="uiCtrl(this.value);" value="Refresh" />
                        <input  id="refresh_sp" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;"  onclick="uiCtrl(this.value);" value="Stop Refresh"  />
                    </td>
                </tr>
            </form>
            <tr>
                <td colspan="2" bgcolor="#EDEFEF">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" bgcolor="#C0C0C0">&nbsp;</td>
            </tr>
        </table>

		<script src="axjs0.js" type="text/javascript"></script>
        <script language="JavaScript" type="text/javascript">
            <!--
            var rfTaskRuningFlag = 0, rfTimeId;
            uiCtrl('Refresh');

			function uiCtrl(uiCmd)
			{
			    if (uiCmd=='Refresh'){
			        document.getElementById('refresh_st').disabled = true;
			        document.getElementById('refresh_sp').disabled = false;
			        rfTaskRuningFlag = 1;
			        rfTaskState = 0;
			        rfTimeId = setInterval("ss()", 16000);					
			    }else if (uiCmd=='Stop Refresh'){
			        document.getElementById('refresh_st').disabled = false;
			        document.getElementById('refresh_sp').disabled = true;
			        rfTaskRuningFlag = 0;
			        clearInterval(rfTimeId);
			    }
			}

			function ss()
			{
			    if (rfTaskRuningFlag)
			    {			
				   window.location.reload();
			    }
			}
			-->
		</script>
    </body>
</html>
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

as you can see, all rows like
<input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="24.9" maxlength="5" />
contain data which I would like to use in domoticz. In this line the indoor temp = 24.9 degrees
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by Toulon7559 »

@eddieb
The data in this pages refreshes every minute and I would like to fetch it directly from domoticz.
Reading the thread, there seems to be some misunderstanding?

If I correctly read the first 3 lines of your first message, you want to fetch data of your PWS for application in Domoticz, and are requesting help with development of a lua-script which pulls the data from the PWS.
Is that correct understanding?
And what is next intended application once you have the data in Domoticz?

If we know what you intend to do with the data, perhaps a shorter route can be found.

Your next messages give the impression that you want to extract the data from the html-pages produced by the PWS' software:
that is 'not direct', ;) to express it mildly ........

In that perspective, the suggestion to apply an available JSON-call to the PWS-software is very valid, because the resulting file usually is an ordered & labelled list of the data.
Once you have that JSON-result, it can much easier be dissected & translated for application within Domoticz.
Therefore, first try to get the JSON-call which triggers the PWS to send the JSON-file:
that JSON-call usually has the layout of a weblink.
Last edited by Toulon7559 on Wednesday 28 August 2019 8:58, edited 6 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

sorry, my fault, typo
I want to read the data from the PWS directly and put that data into domoticz
I edited the 1st post
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by Toulon7559 »

@ eddieb

Have a look in this section:
https://ambientweather.docs.apiary.io/# ... altime-api
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

@Toulon7559 sorry that is NOT what I want. The PWS is sending data to that website and that part works.
BUT, the PWS has a lot more data than availiable at ambient or WU. I want to read the PWS directly. It is far more accurate than ambient or WU
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by waaren »

eddieb wrote: Tuesday 27 August 2019 21:30 as you can see, all rows like
<input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="24.9" maxlength="5" />
contain data which I would like to use in domoticz. In this line the indoor temp = 24.9 degrees
Please state your domoticz / dzVents versions
Find below a first dzVents prototype based on test data.

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."


1st. step: change your IP to the actual one and see if the scripts executes without errors and save the relevant loglines
2nd. step: (if no errors in 1st step): change testHTM in the 2 for loops to item.data and see if the scripts executes without errors and save the relevant loglines

If anything is not clear yet do not hesitate to ask.

Code: Select all

local scriptVar  =  'ambiantWeather'

return
{
    on = 
    { 
        timer = { 'every minute' },
		httpResponses = { scriptVar }, 
    },
   
    logging =   
    {
        level = domoticz.LOG_DEBUG,
        marker = scriptVar,
    },

    execute = function(dz, item)
        
        local ambiantWeatherStationIP = 'xxx.xxx.xxx.xxx' -- change to IP of your weatherstation
        
        local function getambiantWeatherStationData()
            local url = 'http://' .. ambiantWeatherStationIP .. '/livedata.htm'
            dz.openURL  ({ url = url, callback = scriptVar })
        end
        
        local function processHTM()
            local shortFieldNames = {    
                                        inTemp="Indoor Temperature",
                                        inHumi="Indoor Humidity",
                                        AbsPress="Absolute Pressure",
                                        RelPress="Relative Pressure",
                                        outTemp="Outdoor Temperature",
                                        outHumi="Outdoor Humidity",
                                        windir="Wind Direction",
                                        avgwind="Wind Speed",
                                        gustspeed="Wind Gust",
                                        dailygust="Max Daily Gust",
                                        solarrad="Solar Radiation",
                                        uv="UV",
                                        uvi="UVI", 
                                        pm25="PM2.5", 
                                        rainofhourly="Hourly Rain Rate",
                                        eventrain="Event Rain",
                                        rainofdaily="Daily Rain", 
                                        rainofweekly="Weekly Rain",
                                        rainofmonthly="Monthly Rain", 
                                        rainofyearly="Yearly Rain",
                                    }

            local testHTM = '"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>LiveData</title><link href="axcss0.css" rel="stylesheet" type="text/css" /></head><body><table width="800" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td colspan="2" align="right" bgcolor="#0088F7">&nbsp;</td></tr><tr><td colspan="2" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="20" height = "80">&nbsp;</td> <td ><img src="img/1.jpg" width="74" height="80" ></td> <td width="10">&nbsp;</td> <td class="txtstyle_1" >AmbientWeather 4.5.7</td> </tr></table></td></tr><tr> <td colspan="2" align="right" bgcolor="#60B7FF">&nbsp;</td></tr><tr><td colspan="2" align="left" bgcolor="#C0C0C0"><table width="20" border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="bscsetting.htm">Local Network</a></div></td><td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="weather.htm">Weather Network</a></div></td><td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="station.htm">Station Settings</a></div></td><td bgcolor="#EDEFEF"><div class="menuitem_1"><a href="livedata.htm">Live Data</a></div></td><td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="correction.htm">Calibration</a></div></td> </tr></table></td></tr><form name="livedata" method="POST" onsubmit="return chkForm(0);"> <tr><td colspan="2" bgcolor="#EDEFEF">&nbsp;</td></tr> <tr><td colspan="2" bgcolor="#EDEFEF"><div class="subitem_1">Live Data</div></td></tr> <tr><td width="448" bgcolor="#EDEFEF"><div class="item_1">Receiver Time:</div></td><td width="352" bgcolor="#EDEFEF"> <input name="CurrTime" disabled="disabled" type="text" class="item_2" style="WIDTH: 120px" value="20:34 8/27/2019" maxlength="16"/></td></tr><tr><td width="448" bgcolor="#EDEFEF"><div class="item_1">Indoor Sensor ID and Battery </div></td><td width="352" bgcolor="#EDEFEF"><input name="IndoorID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x17" maxlength="5" /><input name="inBattSta" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="Normal" maxlength="12" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Outdoor Sensor ID and Battery</div></td><td bgcolor="#EDEFEF"> <input name="Outdoor1ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0xef" maxlength="5" /><input name="outBattSta1" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="Normal" maxlength="12" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Outdoor2 Sensor ID and Battery</div></td><td bgcolor="#EDEFEF"> <input name="Outdoor2ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x--" maxlength="5" /><input name="outBattSta2" disabled="disabled" type="text" class="item_2" style="WIDTH: 100px" value="- -" maxlength="12" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Indoor Temperature</div></td><td bgcolor="#EDEFEF"><input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="24.9" maxlength="5" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Indoor Humidity</div></td><td bgcolor="#EDEFEF"><input name="inHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="59" maxlength="3" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Absolute Pressure </div></td><td bgcolor="#EDEFEF"><input name="AbsPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1012.90" maxlength="6" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Relative Pressure </div></td><td bgcolor="#EDEFEF"><input name="RelPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1010.90" maxlength="6" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Outdoor Temperature</div></td><td bgcolor="#EDEFEF"><input name="outTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="22.9" maxlength="5" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Outdoor Humidity </div></td><td bgcolor="#EDEFEF"><input name="outHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="87" maxlength="3" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Wind Direction </div></td><td bgcolor="#EDEFEF"><input name="windir" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="166" maxlength="5" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Wind Speed </div></td><td bgcolor="#EDEFEF"><input name="avgwind" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.0" maxlength="5" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Wind Gust </div></td><td bgcolor="#EDEFEF"><input name="gustspeed" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.0" maxlength="5" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Max Daily Gust </div></td><td bgcolor="#EDEFEF"><input name="dailygust" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="20.2" maxlength="5" /></td></tr> <tr><td bgcolor="#EDEFEF"><div class="item_1">Solar Radiation </div></td><td bgcolor="#EDEFEF"><input name="solarrad" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.00" maxlength="12" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">UV </div></td><td bgcolor="#EDEFEF"><input name="uv" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1" maxlength="12"></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">UVI </div></td><td bgcolor="#EDEFEF"><input name="uvi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0" maxlength="3"></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">PM2.5</div></td><td bgcolor="#EDEFEF"><input name="pm25" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="----" maxlength="8" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Hourly Rain Rate</div></td><td bgcolor="#EDEFEF"><input name="rainofhourly" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.00" maxlength="8" /></td></tr><tr><td bgcolor="#EDEFEF"><div class="item_1">Event Rain</div></td><td bgcolor="#EDEFEF"><input name="eventrain" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" /></td></tr> <form name="Rain_1" method="POST" onsubmit="return chkForm(0);"> <tr> <td bgcolor="#EDEFEF"><div class="item_1">Daily Rain</div></td> <td bgcolor="#EDEFEF"><input name="rainofdaily" type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" /><span id="rainofdaily_msg" class="errMsg0"></span></td> </tr> <tr> <td bgcolor="#EDEFEF"><div class="item_1">Weekly Rain</div></td> <td bgcolor="#EDEFEF"><input name="rainofweekly" type="text" class="item_2" style="WIDTH: 80px" value="8.70" maxlength="8" /><span id="rainofweekly_msg" class="errMsg0"></span></td> </tr> <tr> <td bgcolor="#EDEFEF"><div class="item_1">Monthly Rain</div></td> <td bgcolor="#EDEFEF"><input name="rainofmonthly" type="text" class="item_2" style="WIDTH: 80px" value="58.80" maxlength="8" /><span id="rainofmonthly_msg" class="errMsg0"></span></td> </tr> <tr> <td bgcolor="#EDEFEF"><div class="item_1">Yearly Rain</div></td> <td bgcolor="#EDEFEF"><input name="rainofyearly" type="text" class="item_2" style="WIDTH: 80px" value="475.80" maxlength="8" /><span id="rainofyearly_msg" class="errMsg0"></span></td> </tr> <tr> <td colspan="2" bgcolor="#EDEFEF">&nbsp;</td> </tr> <tr align="center"> <td colspan="2" bgcolor="#EDEFEF"><input name="Apply" type="submit" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" onclick="setSubmitType(1)" value="Apply" /> <input name="Cancel" type="reset" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" value="Cancel" /></td> </tr> </form> <tr><td colspan="2" bgcolor="#EDEFEF">&nbsp;</td> </tr><tr><td colspan="2" align="center" bgcolor="#EDEFEF"> <input name="rain_Default" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;" onclick="raindef()" value="Rain Reset"><input id="refresh_st" type="button" class="item_4" style="WIDTH: 110px; HEIGHT: 24px;" onclick="uiCtrl(this.value);" value="Refresh" /><input id="refresh_sp" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;" onclick="uiCtrl(this.value);" value="Stop Refresh" /></td></tr></form><tr><td colspan="2" bgcolor="#EDEFEF">&nbsp;</td></tr><tr><td colspan="2" bgcolor="#C0C0C0">&nbsp;</td></tr></table> <script src="axjs0.js" type="text/javascript"></script><script language="JavaScript" type="text/javascript"><!--var rfTaskRuningFlag = 0, rfTimeId;uiCtrl("Refresh"); function uiCtrl(uiCmd) { if (uiCmd=="Refresh"){ document.getElementById("refresh_st").disabled = true; document.getElementById("refresh_sp").disabled = false; rfTaskRuningFlag = 1; rfTaskState = 0; rfTimeId = setInterval("ss()", 16000); }else if (uiCmd=="Stop Refresh"){ document.getElementById("refresh_st").disabled = false; document.getElementById("refresh_sp").disabled = true; rfTaskRuningFlag = 0; clearInterval(rfTimeId); } } function ss() { if (rfTaskRuningFlag) { window.location.reload(); } } --> </script></body></html>"'
            local lines = {}
            local counter = 0
            for s in string.gmatch( testHTM, "[^%s, ]+" ) do
                if string.find(s,'name=') then 
                    dz.log(s:gsub('name=',''),dz.LOG_DEBUG) 
                    lines[counter] = {}
                    lines[counter].name =  s:gsub('name=','')
                    counter = counter + 1
                end
            end
            counter = 1
            for s in string.gmatch( testHTM, "[^%s, ]+" ) do
                if string.find(s,'value=') then 
                    dz.log(s:gsub('value=',''),dz.LOG_DEBUG)
                    if lines[counter] == nil then lines[counter] = {} end
                    lines[counter].value =  s:gsub('value=','')
                    counter = counter + 1
                end
            end
            dz.utils.dumpTable(lines)
        end
            
        
        if item.isTimer then
            getambiantWeatherStationData()
        elseif item.ok then -- statusCode == 2xx
            dz.log(item.data,dz.LOG_DEBUG)
            processHTM(item.data)
        else
            dz.log('Could not get (good) data from ' .. scriptVar,dz.LOG_ERROR)
            dz.log(item.data,dz.LOG_DEBUG)
        end

    end
}

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

Hi @waaren, tnx for your time so far.
I am currently running V4.11229 on rpi.
Later this morning I will try to implement your script and let you know.
regards,
Eddie
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

below the result of step 1

Code: Select all

2019-08-28 08:14:01.033 Status: dzVents: Debug: ambientWeather: "Refresh"
2019-08-28 08:14:01.033 Status: dzVents: Debug: ambientWeather: "Stop
2019-08-28 08:14:01.033 Status: dzVents: > 1:
2019-08-28 08:14:01.033 Status: dzVents: > name: "CurrTime"
2019-08-28 08:14:01.033 Status: dzVents: > value: "20:34
2019-08-28 08:14:01.033 Status: dzVents: > 2:
2019-08-28 08:14:01.033 Status: dzVents: > name: "IndoorID"
2019-08-28 08:14:01.033 Status: dzVents: > value: "0x17"
2019-08-28 08:14:01.033 Status: dzVents: > 3:
2019-08-28 08:14:01.033 Status: dzVents: > name: "inBattSta"
2019-08-28 08:14:01.033 Status: dzVents: > value: "Normal"
2019-08-28 08:14:01.033 Status: dzVents: > 4:
2019-08-28 08:14:01.033 Status: dzVents: > name: "Outdoor1ID"
2019-08-28 08:14:01.033 Status: dzVents: > value: "0xef"
2019-08-28 08:14:01.033 Status: dzVents: > 5:
2019-08-28 08:14:01.033 Status: dzVents: > name: "outBattSta1"
2019-08-28 08:14:01.033 Status: dzVents: > value: "Normal"
2019-08-28 08:14:01.033 Status: dzVents: > 6:
2019-08-28 08:14:01.033 Status: dzVents: > name: "Outdoor2ID"
2019-08-28 08:14:01.033 Status: dzVents: > value: "0x--"
2019-08-28 08:14:01.033 Status: dzVents: > 7:
2019-08-28 08:14:01.033 Status: dzVents: > name: "outBattSta2"
2019-08-28 08:14:01.034 Status: dzVents: > value: "-
2019-08-28 08:14:01.034 Status: dzVents: > 8:
2019-08-28 08:14:01.034 Status: dzVents: > name: "inTemp"
2019-08-28 08:14:01.034 Status: dzVents: > value: "24.9"
2019-08-28 08:14:01.034 Status: dzVents: > 9:
2019-08-28 08:14:01.034 Status: dzVents: > name: "inHumi"
2019-08-28 08:14:01.034 Status: dzVents: > value: "59"
2019-08-28 08:14:01.034 Status: dzVents: > 10:
2019-08-28 08:14:01.034 Status: dzVents: > name: "AbsPress"
2019-08-28 08:14:01.034 Status: dzVents: > value: "1012.90"
2019-08-28 08:14:01.034 Status: dzVents: > 11:
2019-08-28 08:14:01.034 Status: dzVents: > name: "RelPress"
2019-08-28 08:14:01.034 Status: dzVents: > value: "1010.90"
2019-08-28 08:14:01.034 Status: dzVents: > 12:
2019-08-28 08:14:01.034 Status: dzVents: > name: "outTemp"
2019-08-28 08:14:01.034 Status: dzVents: > value: "22.9"
2019-08-28 08:14:01.034 Status: dzVents: > 13:
2019-08-28 08:14:01.034 Status: dzVents: > name: "outHumi"
2019-08-28 08:14:01.034 Status: dzVents: > value: "87"
2019-08-28 08:14:01.034 Status: dzVents: > 14:
2019-08-28 08:14:01.034 Status: dzVents: > name: "windir"
2019-08-28 08:14:01.034 Status: dzVents: > value: "166"
2019-08-28 08:14:01.034 Status: dzVents: > 15:
2019-08-28 08:14:01.034 Status: dzVents: > name: "avgwind"
2019-08-28 08:14:01.034 Status: dzVents: > value: "0.0"
2019-08-28 08:14:01.034 Status: dzVents: > 16:
2019-08-28 08:14:01.034 Status: dzVents: > name: "gustspeed"
2019-08-28 08:14:01.034 Status: dzVents: > value: "0.0"
2019-08-28 08:14:01.034 Status: dzVents: > 17:
2019-08-28 08:14:01.034 Status: dzVents: > name: "dailygust"
2019-08-28 08:14:01.034 Status: dzVents: > value: "20.2"
2019-08-28 08:14:01.034 Status: dzVents: > 18:
2019-08-28 08:14:01.034 Status: dzVents: > name: "solarrad"
2019-08-28 08:14:01.035 Status: dzVents: > value: "0.00"
2019-08-28 08:14:01.035 Status: dzVents: > 19:
2019-08-28 08:14:01.035 Status: dzVents: > name: "uv"
2019-08-28 08:14:01.035 Status: dzVents: > value: "1"
2019-08-28 08:14:01.035 Status: dzVents: > 20:
2019-08-28 08:14:01.035 Status: dzVents: > name: "uvi"
2019-08-28 08:14:01.035 Status: dzVents: > value: "0"
2019-08-28 08:14:01.035 Status: dzVents: > 21:
2019-08-28 08:14:01.035 Status: dzVents: > name: "pm25"
2019-08-28 08:14:01.035 Status: dzVents: > value: "----"
2019-08-28 08:14:01.035 Status: dzVents: > 22:
2019-08-28 08:14:01.035 Status: dzVents: > name: "rainofhourly"
2019-08-28 08:14:01.035 Status: dzVents: > value: "0.00"
2019-08-28 08:14:01.035 Status: dzVents: > 23:
2019-08-28 08:14:01.035 Status: dzVents: > name: "eventrain"
2019-08-28 08:14:01.035 Status: dzVents: > value: "8.70"
2019-08-28 08:14:01.035 Status: dzVents: > 24:
2019-08-28 08:14:01.035 Status: dzVents: > name: "Rain_1"
2019-08-28 08:14:01.035 Status: dzVents: > value: "8.70"
2019-08-28 08:14:01.035 Status: dzVents: > 25:
2019-08-28 08:14:01.035 Status: dzVents: > name: "rainofdaily"
2019-08-28 08:14:01.035 Status: dzVents: > value: "8.70"
2019-08-28 08:14:01.035 Status: dzVents: > 26:
2019-08-28 08:14:01.035 Status: dzVents: > name: "rainofweekly"
2019-08-28 08:14:01.035 Status: dzVents: > value: "58.80"
2019-08-28 08:14:01.035 Status: dzVents: > 27:
2019-08-28 08:14:01.035 Status: dzVents: > name: "rainofmonthly"
2019-08-28 08:14:01.035 Status: dzVents: > value: "475.80"
2019-08-28 08:14:01.035 Status: dzVents: > 28:
2019-08-28 08:14:01.035 Status: dzVents: > name: "rainofyearly"
2019-08-28 08:14:01.035 Status: dzVents: > value: "Apply"
2019-08-28 08:14:01.035 Status: dzVents: > 29:
2019-08-28 08:14:01.035 Status: dzVents: > name: "Apply"
2019-08-28 08:14:01.035 Status: dzVents: > value: "Cancel"
2019-08-28 08:14:01.035 Status: dzVents: > 30:
2019-08-28 08:14:01.036 Status: dzVents: > name: "Cancel"
2019-08-28 08:14:01.036 Status: dzVents: > value: "Rain
2019-08-28 08:14:01.036 Status: dzVents: > 31:
2019-08-28 08:14:01.036 Status: dzVents: > name: "rain_Default"
2019-08-28 08:14:01.036 Status: dzVents: > value: "Refresh"
2019-08-28 08:14:01.036 Status: dzVents: > 32:
2019-08-28 08:14:01.036 Status: dzVents: > value: "Stop
2019-08-28 08:14:01.036 Status: dzVents: > 0:
2019-08-28 08:14:01.036 Status: dzVents: > name: "livedata"
2019-08-28 08:14:01.036 Status: dzVents: Info: ambientWeather: ------ Finished ambientweather 
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

after step 2

Code: Select all

2019-08-28 08:18:01.041 Status: dzVents: Debug: ambientWeather: "Refresh"
2019-08-28 08:18:01.041 Status: dzVents: Debug: ambientWeather: "Stop
2019-08-28 08:18:01.042 Status: dzVents: > 1:
2019-08-28 08:18:01.042 Status: dzVents: > value: "08:17
2019-08-28 08:18:01.042 Status: dzVents: > name: "CurrTime"
2019-08-28 08:18:01.042 Status: dzVents: > 2:
2019-08-28 08:18:01.042 Status: dzVents: > value: "0x17"
2019-08-28 08:18:01.042 Status: dzVents: > name: "IndoorID"
2019-08-28 08:18:01.042 Status: dzVents: > 3:
2019-08-28 08:18:01.042 Status: dzVents: > value: "Normal"
2019-08-28 08:18:01.042 Status: dzVents: > name: "inBattSta"
2019-08-28 08:18:01.043 Status: dzVents: > 4:
2019-08-28 08:18:01.043 Status: dzVents: > value: "0xef"
2019-08-28 08:18:01.043 Status: dzVents: > name: "Outdoor1ID"
2019-08-28 08:18:01.043 Status: dzVents: > 5:
2019-08-28 08:18:01.043 Status: dzVents: > value: "Normal"
2019-08-28 08:18:01.043 Status: dzVents: > name: "outBattSta1"
2019-08-28 08:18:01.043 Status: dzVents: > 6:
2019-08-28 08:18:01.043 Status: dzVents: > value: "0x--"
2019-08-28 08:18:01.043 Status: dzVents: > name: "Outdoor2ID"
2019-08-28 08:18:01.043 Status: dzVents: > 7:
2019-08-28 08:18:01.043 Status: dzVents: > value: "-
2019-08-28 08:18:01.043 Status: dzVents: > name: "outBattSta2"
2019-08-28 08:18:01.043 Status: dzVents: > 8:
2019-08-28 08:18:01.043 Status: dzVents: > value: "23.0"
2019-08-28 08:18:01.043 Status: dzVents: > name: "inTemp"
2019-08-28 08:18:01.043 Status: dzVents: > 9:
2019-08-28 08:18:01.044 Status: dzVents: > value: "65"
2019-08-28 08:18:01.044 Status: dzVents: > name: "inHumi"
2019-08-28 08:18:01.044 Status: dzVents: > 10:
2019-08-28 08:18:01.044 Status: dzVents: > value: "1012.10"
2019-08-28 08:18:01.044 Status: dzVents: > name: "AbsPress"
2019-08-28 08:18:01.044 Status: dzVents: > 11:
2019-08-28 08:18:01.044 Status: dzVents: > value: "1010.10"
2019-08-28 08:18:01.044 Status: dzVents: > name: "RelPress"
2019-08-28 08:18:01.046 Status: dzVents: > 12:
2019-08-28 08:18:01.046 Status: dzVents: > value: "20.0"
2019-08-28 08:18:01.046 Status: dzVents: > name: "outTemp"
2019-08-28 08:18:01.046 Status: dzVents: > 13:
2019-08-28 08:18:01.046 Status: dzVents: > value: "80"
2019-08-28 08:18:01.046 Status: dzVents: > name: "outHumi"
2019-08-28 08:18:01.046 Status: dzVents: > 14:
2019-08-28 08:18:01.046 Status: dzVents: > value: "151"
2019-08-28 08:18:01.046 Status: dzVents: > name: "windir"
2019-08-28 08:18:01.046 Status: dzVents: > 15:
2019-08-28 08:18:01.046 Status: dzVents: > value: "0.0"
2019-08-28 08:18:01.046 Status: dzVents: > name: "avgwind"
2019-08-28 08:18:01.046 Status: dzVents: > 16:
2019-08-28 08:18:01.046 Status: dzVents: > value: "0.0"
2019-08-28 08:18:01.046 Status: dzVents: > name: "gustspeed"
2019-08-28 08:18:01.047 Status: dzVents: > 17:
2019-08-28 08:18:01.047 Status: dzVents: > value: "4.0"
2019-08-28 08:18:01.047 Status: dzVents: > name: "dailygust"
2019-08-28 08:18:01.047 Status: dzVents: > 18:
2019-08-28 08:18:01.047 Status: dzVents: > value: "55.35"
2019-08-28 08:18:01.047 Status: dzVents: > name: "solarrad"
2019-08-28 08:18:01.047 Status: dzVents: > 19:
2019-08-28 08:18:01.047 Status: dzVents: > value: "283"
2019-08-28 08:18:01.047 Status: dzVents: > name: "uv"
2019-08-28 08:18:01.047 Status: dzVents: > 20:
2019-08-28 08:18:01.047 Status: dzVents: > value: "1"
2019-08-28 08:18:01.047 Status: dzVents: > name: "uvi"
2019-08-28 08:18:01.047 Status: dzVents: > 21:
2019-08-28 08:18:01.047 Status: dzVents: > value: "----"
2019-08-28 08:18:01.047 Status: dzVents: > name: "pm25"
2019-08-28 08:18:01.047 Status: dzVents: > 22:
2019-08-28 08:18:01.047 Status: dzVents: > value: "0.00"
2019-08-28 08:18:01.047 Status: dzVents: > name: "rainofhourly"
2019-08-28 08:18:01.048 Status: dzVents: > 23:
2019-08-28 08:18:01.048 Status: dzVents: > value: "0.00"
2019-08-28 08:18:01.048 Status: dzVents: > name: "eventrain"
2019-08-28 08:18:01.048 Status: dzVents: > 24:
2019-08-28 08:18:01.048 Status: dzVents: > value: "0.00"
2019-08-28 08:18:01.048 Status: dzVents: > name: "Rain_1"
2019-08-28 08:18:01.048 Status: dzVents: > 25:
2019-08-28 08:18:01.048 Status: dzVents: > value: "8.70"
2019-08-28 08:18:01.048 Status: dzVents: > name: "rainofdaily"
2019-08-28 08:18:01.048 Status: dzVents: > 26:
2019-08-28 08:18:01.048 Status: dzVents: > value: "58.80"
2019-08-28 08:18:01.048 Status: dzVents: > name: "rainofweekly"
2019-08-28 08:18:01.048 Status: dzVents: > 27:
2019-08-28 08:18:01.048 Status: dzVents: > value: "475.80"
2019-08-28 08:18:01.048 Status: dzVents: > name: "rainofmonthly"
2019-08-28 08:18:01.048 Status: dzVents: > 28:
2019-08-28 08:18:01.048 Status: dzVents: > value: "Apply"
2019-08-28 08:18:01.049 Status: dzVents: > name: "rainofyearly"
2019-08-28 08:18:01.049 Status: dzVents: > 29:
2019-08-28 08:18:01.049 Status: dzVents: > value: "Cancel"
2019-08-28 08:18:01.049 Status: dzVents: > name: "Apply"
2019-08-28 08:18:01.049 Status: dzVents: > 30:
2019-08-28 08:18:01.049 Status: dzVents: > value: "Rain
2019-08-28 08:18:01.049 Status: dzVents: > name: "Cancel"
2019-08-28 08:18:01.049 Status: dzVents: > 31:
2019-08-28 08:18:01.049 Status: dzVents: > value: "Refresh"
2019-08-28 08:18:01.049 Status: dzVents: > name: "rain_Default"
2019-08-28 08:18:01.049 Status: dzVents: > 32:
2019-08-28 08:18:01.049 Status: dzVents: > value: "Stop
2019-08-28 08:18:01.049 Status: dzVents: > 0:
2019-08-28 08:18:01.049 Status: dzVents: > name: "livedata"
2019-08-28 08:18:01.049 Status: dzVents: Info: ambientWeather: ------ Finished ambientweather 
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

Looks like it is working, now I should probably define some devices under dummy hardware ...
What do I need to do to get this working ?
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by Toulon7559 »

@eddieb

:) Another misunderstanding ....
Pointing you to https://ambientweather.docs.apiary.io/# ... altime-api was only meant to show to you the layout of a JSON-file applicable for AmbientWeather.
If you can obtain the local JSON-file from the PWS, it may be different from the remote JSON-file coming by means of the API in the example.
Although I expect a very high similarity, because for AmbientWeather there is no real reason to make them different:
would not be surprised if the remote JSON-file is just a copy of the file uploaded from the PWS.
[But to check that you need to have a look with a LAN-sniffer such as Wireshark or similar]
Last edited by Toulon7559 on Wednesday 28 August 2019 9:05, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

Hi Toulon,

the PWS is running ObserverIP software.
It has a local web page with all the info and sends its data every minute to WU and Ambient.
As far as I can see there is no local json available.
(and the api does not contain in-house sensor data ...)

Eddie
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by Toulon7559 »

eddieb wrote: Wednesday 28 August 2019 9:05 the PWS is running ObserverIP software.
It has a local web page with all the info it has and sends its data every minute to WU and Ambient.
As far as I can see there is no local json available.
(and the api does not contain in-house sensor data ...)
;-) Still talking on different wavelengths ........

Your PWS has a local web page, locally produced as a html-file.
Your PWS sends it's data every minute to WU and Ambient, but that is certainly not in html-format:
- for WU-Upload the required format is defined e.g. in https://projects.raspberrypi.org/en/pro ... nderground or https://feedback.weather.com/customer/e ... b_id=17298
- AmbientWeather may apply it's own proprietary package

Quite often the equipment-suppliers do not tell that they have a local JSON-file available:
such 'extras' then become available only by search&experience of other people, like ;-) members of this forum.
Sometimes just ask the equipment-supplier whether it is available and how ........
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by eddieb »

Hi Toulon,

tnx for thinking with me.
As far as I can see in the packet stream the PWS is not sending any json like stuff.
The code provided by maaren, reads the PWS fine, exactly what I want.
Now I just need to find out which devices I need to create so the values are displayed.

Eddie
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Get weather data from LAN based ambient weather stations webpage

Post by Toulon7559 »

@eddieb

Reading your posts, you are more or less in the situation described here:
https://obrienlabs.net/redirecting-weat ... bserverip/
You would like to read the data on the (undocumented?) interface between the PWS and ObserverIP.
Out of ObserverIP you get derivatives in the form of the webpage and the 2 uploads, not the 'real thing'.

As you can see in the indicated link, it takes 'some' effort to go for the other route:
waaren's approach certainly yields quicker results.

NB. Which type of PWS do you have?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest