boas pessoal estou com um problema para conseguir por o meu esp8266 a trabalhar com o mqtt …
é o seguinte :
- o esp8266 tem a o código do Bruno Horta do video do homeassistant mais o esp8266
- estou a utilizar o mqtt como guest (sem pass)
- o mqtt arranca sem erros (parece -me)
- o mqtt.fx ele abre a ligação, mas não me deixa subscrever nenhum tópico(não sei porque)
- no log do hassio no addon do mqtt, aparece sempre istas mensagem de detectou o esp mas depois desliga dele!
1557317641: New client connected from 192.168.1.104 as MAKERSWITCH (c1, k15). 1557317641: Socket error on client MAKERSWITCH, disconnecting. 1557317641: New connection from 192.168.1.104 on port 1883. 1557317662: New client connected from 192.168.1.104 as MAKERSWITCH (c1, k15). 1557317662: Socket error on client MAKERSWITCH, disconnecting. 1557317672: New client connected from 192.168.1.104 as MAKERSWITCH (c1, k15). 1557317672: Socket error on client MAKERSWITCH, disconnecting.
mqtt configuração:
{
"logins": [],
"anonymous": true,
"quiet_logs": true,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
configuração do ficheiro do homeassistant :
homeassistant:
# Name of the location where Home Assistant is running
name: CASA
# Location required to calculate the time the sun rises and sets
latitude: 41.412696
longitude: -8.198800
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 292
# 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: Europe/Lisbon
# Customization file
customize: !include customize.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
http:
base_url: 192.168.1.xx1:8123
api_password: "xxxxxxxxx"
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
ip_ban_enabled: True
login_attempts_threshold: 3
mqtt:
broker: 192.168.1.xx1 #127.0.0.1 Duvida aqui <------------------------------------------
port: 1883
client_id: homeassistant
keepalive: 60
# protocol: 3.1
# Discover some devices automatically
discovery:
##############################################
#####################telivisão###############
media_player:
- platform: samsungtv
host: 192.168.1.103
port: 8001
mac: b8:bb:af:2f:f5:90
name: TV QUARTO
##############################################
##############################################
################TEMPO#########################
weather:
- platform: ipma
latitude: 41.412696
longitude: -8.198800
###############################################
###############################################
# Sensors
sensor:
# Weather prediction
- platform: yr
###############################################
###############################################
switch:
- platform: mqtt
name: "sala"
state_topic: "casa/sala/luz/state"
command_topic: "casa/sala/luz/set"
payload_on: "ON"
payload_off: "OFF"
optimistic: false
qos: 0
retain: true
###############################################
###############################################
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml