Изборник Затворити

ESPHome: Sending sensor data to remote URL

Скраћена веза: https://pedja.supurovic.net/veza/10714

It is common need to send data read from sensor or states of device to some remote location, like web site or database. ESPHome allows doing that, and it works pretty well, once you find out how to do it.

For sending data, you can use HTTP GET or POST method. As data usually has some complexity, I prefer using POST and send all info as JSON structure. That is universal way.

First thing you have to use is to include  http_request component into code:

  id: http_request_data
  useragent: esphome/device
  timeout: 10s

You have to set id for component so you can access it later. […]
[ ... види цео чланак ... ]

ESPHome: Showing Project Name and Version as Text Sensors

Скраћена веза: https://pedja.supurovic.net/veza/10698

There is option to assign project name and version in ESPHome device config. Values are displayed in log when device is powered up. It is useful to have those information as sensors so it is easy to check them, if needed. Here is how.

How to set project name and version:

  name: "my_device"
    name: "Me.MyProject"
    version: "0.1.0"

And now create Text Sensors:

  - platform: template
    name: "Project"
    lambda: |-
     return to_string(ESPHOME_PROJECT_NAME);

  - platform: template
    name: "Version"
    lambda: |-
      return to_string(ESPHOME_PROJECT_VERSION);

I like to use substitutions as it let’s me put all configuration at the beginning of the yaml and reuse values where needed. […]
[ ... види цео чланак ... ]

Tuya ZigBee сензор температуре и влажности ваздуха за паметну кућу

Скраћена веза: https://pedja.supurovic.net/veza/10595

Сензор CoRui Tuya ZigBee Smart Temperature & Humidity је уређај врло малих димензија тако да га је лако сместити где год је потребно. Ради на две АА батерије и оне у њему врло дуго трају јер их користи на оптималан начин. Сензор, како му име и каже, мери температуру и влажност ваздуха.

Узео сам верзију која ради по ZigBee протоколу надајући се да ће се лако интегрисан мојим Home Assistant системом. Мој Home Assistant поред WiFi подржава и ZigBee протокол захваљујући прикљученој УСБ картици SONOFF ZBDongle-E (Пун назив је Universal Zigbee 3.0 USB Stick Gateway Dongle Plus) која ради као ZigBee контролер. […]
[ ... види цео чланак ... ]

ESP8266 Temperature and Humidity Web Service

Скраћена веза: https://pedja.supurovic.net/veza/8605

After I successfuly tested HTTP server using Arduino and Ethernet Shield, I decided to try to accomplish the same thing using wireless connectivity. I decided to use ESP8266 on NodeMCU board. That is microcontroler with wireless interface all in one package, and quite low priced which makes it interesting for various purposes. I used the same temperature and humidity sensor DHT-22.

ESP8266 is supported within Arduino IDE which is big plus, as one can use the same development environment.

Soon I realized that popularity of this platform is well earned. It was very easy to set it up. […]
[ ... види цео чланак ... ]

Arduino Temperature and Humidity Web Service

Скраћена веза: https://pedja.supurovic.net/veza/8576

I needed simple device that is able to measure temperature and make it available for collecting that info from remote places via Internet. Arduino platform was the first thought and it ended up as expected: nice and simple.

For hardware I used Arduino UNO, Ethernet Shield and DHT22 Temperature and Humidity sensor.

Ethernet Shield pinpoint matches Arduino UNO so it is simply attached on top of it. It provides RJ45 connector for ethernet connection and SD card socket which I did not need for this small project.

All pins on Ethernet Shield are pass-through which means all Arduino pins are available on the this shield too. […]
[ ... види цео чланак ... ]