Izbornik Zatvoriti

ESPHome: Sending sensor data to remote URL

Skraćena veza: 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. […]
[ ... vidi ceo članak ... ]

ESPHome: Showing Project Name and Version as Text Sensors

Skraćena veza: 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. […]
[ ... vidi ceo članak ... ]

Tuya ZigBee senzor temperature i vlažnosti vazduha za pametnu kuću

Skraćena veza: https://pedja.supurovic.net/veza/10595

Senzor CoRui Tuya ZigBee Smart Temperature & Humidity je uređaj vrlo malih dimenzija tako da ga je lako smestiti gde god je potrebno. Radi na dve AA baterije i one u njemu vrlo dugo traju jer ih koristi na optimalan način. Senzor, kako mu ime i kaže, meri temperaturu i vlažnost vazduha.

Uzeo sam verziju koja radi po ZigBee protokolu nadajući se da će se lako integrisan mojim Home Assistant sistemom. Moj Home Assistant pored WiFi podržava i ZigBee protokol zahvaljujući priključenoj USB kartici SONOFF ZBDongle-E (Pun naziv je Universal Zigbee 3.0 USB Stick Gateway Dongle Plus) koja radi kao ZigBee kontroler. […]
[ ... vidi ceo članak ... ]

ESP8266 Temperature and Humidity Web Service

Skraćena veza: 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. […]
[ ... vidi ceo članak ... ]

Arduino Temperature and Humidity Web Service

Skraćena veza: 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. […]
[ ... vidi ceo članak ... ]