Closed yukulehe closed 2 years ago
So I have not the answer for now. but the error for the mqtt lib is
[Errno -2] Name or service not known
I have print params and it seems OK. I usually used paho
lib for MQTT so I have some difficulties to found the issue here.
I have tried to setup the mqtt host with IP or HOSTNAME, but same issue. Any idea ?
The error indicates clearly a problem of network. But hard to answer because I don't know your config. Your Mqtt broker is an add-on of HASS (so I guess on the same host) or a self hosted container ? Do you have the same issue with the enedisgateway2mqtt Hass add-on which, I suppose, target the same mqtt broker ?
It's the official mqtt broker available in HA Supervisor :
Mosquitto broker
Current version: 6.0.1 (Changelog)
logins:
- username: *********
password: *********
customize:
active: false
folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
I use it with for all my others add-on without issue. For example the enedisgateway use it without issue and the add-on is made by @alexbelgium too Yes Broker, gazpar2mqtt, enedisGW, etc are working on the same PI Host.
And I suppose you cannot see any logs on the mqtt broker side... (cause the add-on cannot reach him)
Yes. but I don't use the Docker, I just run the script with args. There is an issue too :
2021-11-18 21:47:03,411 Welcome to gazpar2mqtt
2021-11-18 21:47:03,411 -----------------------------------------------------------
2021-11-18 21:47:03,411 -----------------------------------------------------------
2021-11-18 21:47:03,412 Environement variable 'GRDF_USERNAME' is mandatory
so I comment the env part to bypass it.
Here is my fork for ssl working: https://github.com/Minims/gazpar2mqtt/commits/ssl But it ran outside of my home assistant. It's the only way I found for now. But I would prefer make it work as a local add-on like the Enedis one.
Ok I see I'll fix it.
And I suppose you cannot see any logs on the mqtt broker side... (cause the add-on cannot reach him)
No, nothing on mqtt side if it runs on HA.
Agree, I would prefer that the add-on works too. But I'm not able to test it.
I don't understand, what is not working in the addon?
If it works on your docker image there is no reason it wouldn't work on the addon...
For now I have only test docker in HA. On my Debian it just python without docker. I really don't understand the problem. I would like to test migrating to pho, but it seems a bit too long for now.
@Minims Did you check that the string representation of the host is correct when you lauchn it with the add-on ? I was thinking about your other issue on the port. Maybe the program try to reach the host with an additional quote as "'190.x.x.x'" instead of "190.x.x.x". You know what I mean ?
Good idea - the addon shows in the log the text with which it is exported
C'était bien ça, bien vu ! Nouvelle version pushée et je confirme que mqtt se connecte
Cool. Plus qu'à attendre la confirmation de @Minims . Et c'est très bien d'arrêter de parler en anglais :P
Alors oui c'est beaucoup mieux ! Je reçois bien les data dans mon Mqtt \o/. Merci !
1/
J'ai eu un petit soucis dans la conf entre true
et True
.
Seul True
avec la majuscule est compris. true
tout en minuscule équivaut a False
ici.
Si y a moyen de remonter une erreur de conf ou de comprendre les 2 cas ça peut être bien.
2/ autre chose pour le HaDiscovery, il manque une partie device dans la conf des sensors pour que gazpar apparaisse comme un nouvel appareil dans homeassistant et relie toutes les entités:
"device":
{"identifiers": ["gazpar_xxx"],
"name": "Gazpar xxx",
"model": "Gazpar",
"manufacturer": "GRDF"}
}
Super ! pour le true je pense que c'est l'interpréteur de l'app qui cherche un = "True"? Ce serait donc de ton côté @yukulehe ? Ou bien qu'il cherche un str (donc True) et qu'un bool ne marche pas (donc true)?
oui faut que je gère mieux les booleans, je vais faire un fix.
Du coup je clôture l'issue. La mise à jour d' @alexbelgium a corrigé. Merci à lui !
I cannot connect to Mqtt, I don't know why for now.
I have tried to run the script directly on my Debian, I have the same issue. So it seems not related to the add-on.
Originally posted by @Minims in https://github.com/yukulehe/gazpar2mqtt/issues/5#issuecomment-972969423