Send data from sensor over WAN

Hi,
how I can send data from temp sensor (wemos + DHT22) which is connected to another wi-fi to HA local server (RPi3)?

I have public IP address.

Before I use Blynk local server and over Arduino software I can setup address and port of Blynk server, auth ID and temp sensor send data directly to Blynk local server.

example

blynk

It is possible do it same with HA local server?

I want send directly data from sensor in one town (there is sensor connect to wifi) and send to second town where is HA local server, it is possible or must use example MQTT or some similarly.

Thank you

Yep, possible : you need two instance of HA and link together. So it means you need one Remote RPI (for example or whatever you want to host HA) near the sensor and another in the other town.

Docs : https://community.home-assistant.io/t/connect-two-home-assistant-instances-together/86117/2

To send data from a temperature sensor (such as a Wemos board with a DHT22 sensor) to a Home Assistant (HA) local server, you will need to use a communication protocol that allows the sensor to send data to the HA server over the internet. One common protocol that can be used for this purpose is MQTT (Message Queuing Telemetry Transport).

MQTT is a publish/subscribe-based messaging protocol that is designed to be lightweight and efficient. It allows devices, such as your temperature sensor, to publish data to a broker (in this case, your HA local server) and for the broker to distribute the data to any subscribed clients.

To use MQTT with your temperature sensor and HA local server, you will need to do the following:

  1. Install and configure an MQTT broker on your HA local server. There are several options for MQTT brokers that can be used with Home Assistant, such as Mosquitto or HiveMQ.
  2. Configure your temperature sensor to connect to the MQTT broker and publish data to a specific topic. The topic is a string that identifies the data being published and allows subscribed clients to filter the data they receive.
  3. Configure Home Assistant to subscribe to the MQTT topic that your temperature sensor is publishing to. This will allow HA to receive the data from the sensor and use it in your automation rules and other features.
  4. Use the MQTT integration in Home Assistant to configure the connection to the MQTT broker and specify the topics that you want to subscribe to.

Once you have completed these steps, your temperature sensor will be able to send data directly to your HA local server over the internet, using the MQTT protocol. You can then use the data in your HA automations and other features.