Tips welcome, ESP for ESPHome with serial Interface to Arduino MEGA for Pins

Hey @CeeCee thought I’d go ahead and try to create an MQTT set up with an esp32, few headaches having no idea what I was doing but got there in the end: MQTT no callback - PubSubClient - ESP32 snippet of the Arduino code/some pointers.

had to set anonymous: from false to true in the configuration for MQTT in the supervisor menu

logins: []
anonymous: true
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

added the following to the configuration.yaml:

mqtt:
    broker: 192.168.0.200
    username: !secret mqttUserName
    password: !secret mqttPassword
    
light:
  - platform: mqtt
    name: "Office light"
    state_topic: "office/light1/status"
    command_topic: "office/light1/switch"
    payload_on: "ON"
    payload_off: "OFF"
    optimistic: false