Beginner, ESPHome, RelayBoard connectio to OH3

Merry XMAS to those celebrating that.

  • Platform information:
    • Win10, 64bit, 16Gb, 120Gb ssd
    • ESPHome downloaded 3 days ago
    • openjdk version “11.0.9.1” 2020-11-04 LTS
    • openHAB version:3.0.0

I created ESP code with ESPHome and this yaml file:

esphome: name: syd_gavl_lys platform: ESP8266 board: esp01

wifi:
ssid: xxxxxx
password: yyyyyyyyy

'# Optional manual IP
manual_ip:
static_ip: 192.168.2.40
gateway: 192.168.2.1
subnet: 255.255.255.0

'# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “Syd_Gavl_Illumi_FallBack_HS”
password: xxxxxxxxx

mqtt:
broker: 192.168.2.4

switch:

  • platform: gpio
    name: “SydGavlIllumination”
    pin: 0

captive_portal:

'# Enable logging
logger:

'# Enable Home Assistant API
'# api:

ota:

As indicated above I have a MQTT running at a static address (192.168.2.4) which gives this MQTT trace:
{
“name”:“SydGavlIllumination”,
“state_topic”: “syd_gavl_lys/switch/sydgavlillumination/state”,
“command_topic”:“syd_gavl_lys/switch/sydgavlillumination/command”,
“availability_topic”:“syd_gavl_lys/status”,
“unique_id”:“ESPswitchsydgavlillumination”,
“device”:{
“identifiers”:“5ccf7f664677”,
“name”:“syd_gavl_lys”,
“sw_version”:“esphome v1.15.3 Dec 22 2020, 21:56:00”,
“model”:“PLATFORMIO_ESP01”,
“manufacturer”:“espressif”
}
}

Posting commands like
mosquitto_pub -t ‘syd_gavl_lys/switch/sydgavlillumination/command’ -m on

or “off” makes the relay switch. Check :smiley:

Following the tutorial Openhab tutorial I got a model created:
image with the “SydGavlLys” auto discovered :slight_smile:
To me this looks reasonable:
image
although I wonder how it knows which command to send in order to operate the relay (the mqtt command above with the “on” or “off” payload.

(Excuse the mix of Danish and English)

Just above the picture above, a toggle button is shown. I’d assume operating that one should be visible in the MQTT trace. but nothing happens…

I probably miss some/a lot of understanding, (this is after all my first attempt at OH) and some configuration.

As I stated in my first post I have not fully grasped the vocabulary/concepts/naming.
E.G I still wonder why the MQTT broker does not contain the IP/PORT/USR/PWD etc configuration. That showed up at (in my understanding) some random place :slight_smile: but then again. The auto-discover worked, that is running :slight_smile:

Should anyone get bored during X-mas and read this so far, I’d definitely appreciate a kick in my behind, with a manual reference that I must re-read and understand.

Is there a debug/dry run method/log I could exersize/inspect to understand which commands OH is trying to send?

Enjoy the holiday season and stay safe.
Best regards.

Please disregard.
Out of the blue it has started working. :slight_smile:
Not sure what has changed :smirk: