mosquitto tools package isn’t installed in the hass.io container
tested what??? I can’t understand your setup or what you are trying to do here.
I have a RPi running my coffee roaster with a script that sends messages via mqtt to my HA broker using mosquitto_pub and an MQTT sensor that sees those and sends notifications to my phone… You just need to make sure you only have one broker on the Pi. One broker, one ip address one port (1883)
Yep
You can potentially have 3 although port conflicts wont allow them to all run
Remember there is an internal mqtt that HA has
If you just add mqtt: to your config it gets enabled
If you specified a broker it won’t enable it and will look for the broker instead.
No you can but your host would need to use non default ports and the add-on the same
If you just have
mqtt:
And nothing else
It will attempt to load the internal broker. Using default ports.
Its possible !
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 25.5263
longitude: -48.0307
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 90
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Tegucigalpa
# Customization file
customize: !include customize.yaml
# Show links to resources in log and frontend
#introduction:
# Enables the frontend
frontend:
# Enables configuration UI
config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time
history:
# View all events in a logbook
logbook:
# Enables a map showing the location of tracked devices
map:
# Track the sun
sun:
# Example configuration.yaml entry
input_boolean:
notify_home:
name: Publish MQTT msg
icon: mdi:car
power_kompressor:
name: Kompressor
icon: mdi:car
power_solenoid:
name: Solenoid
icon: mdi:car
# MQTT Switches RPi2 - RPi3
switch:
- platform: mqtt
name: kompressor
command_topic: "test_channel"
payload_on: "komp-on"
payload_off: "komp-off"
- platform: mqtt
name: solenoid
command_topic: "test_channel"
payload_on: "sole-on"
payload_off: "sole-off"
# Sensors
sensor:
# Weather prediction
- platform: yr
# Emoncms
- platform: emoncms
api_key: myapikey
url: http://myserver.com/emoncms/
id: 1
# Example configuration.yaml entry configuring HomeKit
homekit:
mqtt:
broker: 192.168.1.117
sonoff:
username: [email protected]
password: mypass
scan_interval: 60
grace_period: 600
api_region: 'us'
# Example configuration.yaml entry
device_tracker:
- platform: bluetooth_le_tracker
# Text to speech
tts:
- platform: google_translate
service_name: google_say
# Cloud
cloud:
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
panel_iframe:
configurator:
title: Configurator
icon: mdi:wrench
url: http://hassio.local:3218
system_health:
Log
[19:20:01] INFO: Setup mosquitto configuration
[19:20:01] WARNING: SSL not enabled - No valid certs found!
[19:20:01] INFO: No local user available
[19:20:02] INFO: Initialize Hass.io Add-on services
[19:20:02] INFO: Initialize Home Assistant discovery
[19:20:02] INFO: Start Mosquitto daemon
1578014402: mosquitto version 1.6.3 starting
1578014402: Config loaded from /etc/mosquitto.conf.
1578014402: Loading plugin: /usr/share/mosquitto/auth-plug.so
1578014402: ├── Username/password checking enabled.
1578014402: |-- *** auth-plug: startup
1578014402: ├── TLS-PSK checking enabled.
1578014402: └── Extended authentication not enabled.
1578014402: Opening ipv4 listen socket on port 1883.
1578014402: Opening ipv6 listen socket on port 1883.
1578014402: Opening websockets listen socket on port 1884.
1578014402: Warning: Mosquitto should not be run as root/administrator.
1578014450: New connection from 192.168.1.117 on port 1883.
1578014450: Socket error on client <unknown>, disconnecting.
1578016203: Saving in-memory database to /data/mosquitto.db.
So is the Pi running the broker on 192.168.1.117?
You can actually remove
mqtt:
broker: 192.168.1.117
both lines.
When you don’t define a local user, you need to use a Home Assistant user to authenticate with the broker… You haven’t said what devices you are using.
Known issues and limitations
Since version 4.1 of the add-on, an explicit ACL definition is now required if you plan to use legacy logins and "anonymous": true see these instructions.
Previously you stated
rpi2-hassio has home assistant running on it. Its 192.168.1.113
rpi3-raspbian has python scripts that run based on the mqtt message received. Its 192.168.1.117.
Then you said
rpi2-hassio is .117 and it runs the lovelace interface.
rpi3-raspbian is .113 and it runs the python script mqttReceive.py in my OP which receives the msg and its payload in order to determine which python script to run for relay activation.
So which is it.
Either way
Leave the config
Change broker to the hassio ip
Either disable anonymous
Add user in users and add to config
or setup acl
Set you pi3 to talk to the hassio broker