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

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:

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

And now create Text Sensors:

text_sensor:
  - 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. […]
[ ... види цео чланак ... ]

Example: How to use ESPHome Select Component

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

ESPHome Select command allows creating entity that has several optional values, allowing one of them to be selected. Unfortunately it is not well documented, so new users have hard time to make it work.

One would expect that Select component should work as simple as setting up options, and that is it. It should set status based on selection on it’s own. but it does not work that way.

After some struggle I finally got it working and here I am making note (mostly to myself) how to do it, as I am sure I would need it again. […]
[ ... види цео чланак ... ]

Enabling two color LED on Sonoff Basic R2 Smart Home Switch

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

I like Sonoff Basic R2 Smart Home Switch as it is low priced but very functional multipurpose device. Most of all, it contains ESP8266 chipset which means it is easy to replace original firmware with custom one. I use ESPHome firmware but Tasmota is also good.

sonoff-basic-schematicBy looking at the board of this little device I found out that it contains two-colored LED. Actually, two LED-s are in one package with three contact legs. Green LED is used in factory assembly, and it is connected to GPIO13. The second LED is red colored and not used. It is actually meant to be used by optional RF module. […]
[ ... види цео чланак ... ]

Resolving problem flashing ESPHome into Amica NodeMCU with CP2102

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

I got myself ESP8266 Wireless module NodeMCU development board with CP2102 serial chip. It was advertised as original and with least problems of all NodeMCU versions.

I had nothing but problems trying to flash it with ESPHome Flashing Wizard (trying Tasmota was no better). Actually, issues were linked to CP2102 serial chip. One PC could not even recognize it when connected to USB. Other two did, but only after manual persuasion. And even than, flashing did not go through.

I finally managed to flash firmware by avoid using CP2102 at all and accessing ESP8266 chip directly. As I had other serial adapter, based on FT232RL FDTI232 USB to serial adapter I use for flashing ESPHome firmware to Sonoff devices, I build new adapter cable to connect it to ESP8266 bypassing serial interface on NodeMCU board. […]
[ ... види цео чланак ... ]