How To Control Mycodo GPIO -relays from homeassistant

i would like to send mqtt cmd with payload o/off from homeassistant to mycodo which could receive this msg and link to specific gpio
i figured out how to send from mycodo to home assistant and update it with gpio state using gpio function.
my code inside homeassistant is e.g.

    - name: "mycodo waterpump switch"
      state_topic: "mycodo/pump/state"
      command_topic: "mycodo/pump/cmd"
      qos: 0
      payload_on: "1"
      payload_off: "0"
      availability_topic: "mycodo/pump/status/LWT"
      payload_not_available: "Offline"
      payload_available: "Online"
      retain: true

thanks in advance

Mycodo is fully capable automation software, it doesn’t need HomeAssistant to do this, it can do this all by itself. Why would you want to control Mycodo from HomeAssistant when Mycodo is already far more capable and easier to setup? HomeAssistant is not really automation software, it is conglomeration software intended to get different automation software platforms talking to each other and working in coordination… you can already do that just using mqtt, so again, why use HomeAssistant on top of all of that?

I agree mycodo is more capable for sure.
I will use homeassistant just as a UI with few control buttons that are nicer smaller looking buttons.
Using mycodo directly on my iphone it takes time to load (slow) also widgets buttons are too big and their response is slow, therefore when i am away from home I like to be able to do essential control e.g pump air vents open close etc using homeassistant [HA ] just as UI for remote access. But when i am at home i use mycodo with PC works faster but still slow
may be I should use RPI4 instead PI3 with external solid drive in place SD memory card but this might be time consuming for now
Mycodo control buttons on PC the active/unactive buttons status is very slow changing.
thanks for reply

I use my phone all the time to control a 32-bit Pi model 2 running Mycodo, and don’t have any problems with buttons behaving slow, response is almost instant. The pages do load a little slow, but not terribly slow by any means. Mycodo’s interface does leave a little to be desired when viewed on a phone screen, if you need to activate outputs or functions, you should do it directly from the outputs or functions pages on a phone instead of trying to load a dashboard. If you need to view measurements or other data, create a dashboard just for use with your phone instead of trying to use one dashboard for PC and phone. If I really needed a nicer interface for remote access via internet, I’d probably go with Node Red before HomeAssistant.
If you are using a Pi 3 or 4, make sure you are running the 64-bit OS, and use the InfluxDB v2 when setting up Mycodo, that should improve the speed of things a little bit.

1 Like