Serial / Uart communication rx/tx-pins

Is it possible to integrate this or does it already exists? My intention is to use mqtt to send json commands which controls a arduino connected to OMG, using it on espurna now but want to change to minimize the amounts of esp’s.

The arduino is controlling 3 pwm fans, so maybe I’m able to control them directly from the esp32

Could you share the kind of function you are expecting to use to control your fan (as an arduino function)?

Currently you can control one GPIO with the ZactuatorONOFF module.

yes sure,

today I send a json msg like in this automation using HA

- alias: 'fan0'
    - platform: state
      entity_id: input_number.fan0
    - service: mqtt.publish
        topic: ESPURNA-000000/uartout/set
        payload: "{'0':{{ states.input_number.fan0.state | int }}}"

The msg is bypassed by espurna (I guess) directly to uart, an arduino nano is connected (rx-tx and tx-rx) with the esp.

The arduino is programmed with this quick-hack

:slight_smile: so a mqtt msg which could be sent to uart. Feel like this text was super unclear, but I hope you get it

I was thinking a component named ZgatewaySerial using the RX and TX pin

and communication with something like
commands/MQTTtoSerial (no json support from OMG only passing the message to connected device)
commands/MQTTtoSerial/config (for buadrate, 8N1 and tx+rx or rx or tx)
SerialtoMQTT (response from connected device)

This would could possible create some problems for the Serial print from the OMG itself, so it should probably get disabled.

Will try to build something,

1 Like