Hi, I’ve been trying to integrate MQTT with HA for a project, and I’m using Relay Module for my home devices.
The MQTT has been working on my Pi/HA when I tested, but I’m still being rather confused about the configuration.yaml code for GPIO and Relay Module, any help?
I’ve been trying to use this link: https://github.com/flyte/mqtt-io, but that still didn’t work for me. Here’s my configuration for MQTT:
I think you are mixing config here. The gpio_modules entry should be in your configuration file for mqtt-io (the config file you start it with: python3 -m mqtt_io config.yml), not in Home Assistant’s configuration.yaml.
Oh ok, thank you for the information, first step to get out of my stuck state. Though I want to ask again that I’m still quite a beginner, where to edit the config.yml file in mqtt-io? I executed the command in RPi terminal and it ended with
FileNotFoundError: [Errno 2] No such file or directory: 'config.yml'
Create yourself a config file, following instructions and examples above, and save it somewhere, such as /home/pi/pi-mqtt-gpio.yml.
Do you have to create it in home/pi directory or anywhere? As you said you create it in /home/pi/Documents/mqtt-gpio-bridge instead? (the ‘mqtt-gpio-bridge’ is a folder right?). And the yml file was created with good-ol sudo nano config.yml?
And about the supervisor config file, as it’s an older instruction, it has to be changed into like this?
Part in the configuration.yaml? But are there any way for the Lovelace to reflect the MQTT device status? The switch entity in the Lovelace bounces back to off when I turned it on.
Also the flyte/mqtt-io can’t use the PIR and Flame Module Sensors? Are there any way to use them or I have to use substitutes?
I forgot to specify that the quote part is already the "" part.
And there wasn’t a problem of turning on/off the GPIO pins, sending the payload ON/ OFF to the MQTT topics completely work. The problem’s only the display (switch configuration) at the Lovelace.
OK finally got it for the Lovelace part, I had to use the entities provided by the server which appears after connecting to MQTT in the Terminal. But it seems that I don’t need the HA configuration.yaml for this.
Hi I’ve been trying to setup a basic relay control with MQTT-io but I keep getting errors around no access to DEV/mem.
The config I’ve been using is below (basic example from the docs) and I’m using pin 11 (GPIO17), I’ve tried every combination I can think of but I keep getting
RuntimeError: No access to /dev/mem. Try running as root!
I am running hassio on pi4 and looked into installing the addon via terminal as sudo but I can’t find installation instructions for installing with hassio, as well normal linux commands (like sudo or apt) dont seem to work. Does anyone have any experience with this? can i change permissions on hassio somehow?
I can control the gpio’s with the raspberry pi gpio integration so pin control is definitely doable.