Logic Machine Forum
Local Weatherstation to Logicmachine - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Local Weatherstation to Logicmachine (/showthread.php?tid=5837)



Local Weatherstation to Logicmachine - epps - 14.01.2025

Hello there,

we have a local weatherstation that can log his data to a webserver like "Ecowitt" or "WeatherUnderground".
This ist the Station : ELV WLAN-Wetterstation WS980WiFi
https://de.elv.com/p/elv-wlan-wetterstation-ws980wifi-inkl-funk-aussensensor-868-mhz-app-pc-auswertesoftware-P250408/?itemId=250408

In the settings of this Weatherstation there is an option where you can loud the data to an customized Site. With the Ecowitt or the WeatherUnderground protocoll. (See the Picture attached)

   

Because we have there no internet connection we cannot load the data to the online weathersites. 

Is it possible that the Logicmachine can recive the Data local from the Weatherstation in any way?
I dont know how to do.

Thanks
Kind regards
Epps


RE: Local Weatherstation to Logicmachine - admin - 14.01.2025

Create a resident script with 10 seconds sleep time.
Code:
require('socket')

server = socket.bind('*', 8000)

while true do
  client = server:accept()
  client:settimeout(1)

  data, err, partial = client:receive('*a')
  log(data, err, partial)

  client:send('HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n')
  client:close()
end

On your weather station set Server IP to LM IP and Port to 8000. Set upload interval to 10-15 seconds and post what you get in LM Logs tab.