I’m trying to connect a Sonoff with Openhabian, but appears all the time “MQT: Connect failed to openhabianpi:1883, rc -2. Retry in 60 sec”
I already did the test of the Mosquitto Broker, by sending messages and I verified that it is received.
Yet, appears that the Mosquitto Broker is not accepting new devices.
I read some posts, I try several solutions, but continue to appear this error.
For testing, try commenting out your broker.clientId=openhabianpi in the MQTT config.
Also test with broker.url=tcp://OH IP:1883, where OH IP is your local IP ex. 10.0.1.15.
Then try removing tasmota in the items.file ( not knowing what your sonoff device config looks like, full topic or no) like this: {mqtt=">[broker:cmnd/kitchenLightSonoff/POWER:command:*:default], <[broker:stat/kitchenLightSonoff/POWER:state:default]"}
I did all you said, continue to appear the connection fail, and at this moment in the log of the openhabian appear this error:
“2018-08-31 16:25:37.614 [ERROR] [org.apache.felix.configadmin ] - Cannot use configuration org.openhab.mqtt for [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=317, bundle=200/mvn:org.openhab.action/org.openhab.action.mqtt/1.12.0]: No visibility to configuration bound to mvn:org.openhab.io/org.openhab.io.transport.mqtt/1.12.0”
I unistall the MQTT action and persistence, only having the MQTT binding.
It starts to work.
I did some tests, I change the host in Sonoff to a name again. At that moment appear the error again, so I put the IP again.
Thank you for solving my problem. But this means that if the IP of the openhabian changes, I need to change the IP in all the Sonoff. Do you know what I can do?
It’s best to make your OH IP address static/fixed (usually done by adding the MAC address of your server) in the router so it doesn’t change. By default you should have mapdb as persistence just check the persistence file and add your items if needed.That should not have caused your issue. As you work with openhab keep a separate browser open with your logs and read them as you make changes. You will pick up on how to identify issues in no time.
If you start using sonoff GPIO 14 for sensors and what to chart the value you will need to use a different persistence.
I’m using openhabian and sonoff. I have changed the hostname via openhabian-config and can use this name on all sonoff devices for the MQTT broker hostname.
Can you connect to your raspi using the name or do you need thei IP for that as well?
As a conclusion of this topic, and with the tests I did, I’m not able to put a name in my host.
It only works when I put the IP in the Sonoff.
Two days ago I had everything working with a name in the Host.
At this moment it is working in this way, so it is good
Thank you for your support, two days ago I had this working with 5 Sonoff and 2 of them with the AM2301.
Yesterday, it starts to do this error. So I’ll put everything together again.
I’ll follow your advice
Can you give me support again? Sorry to boring you again
I’m tried to replicate what you show to me about the graph. But the values appear strange, I divided into 2 graphs to try to see what is occuring. As you can see in the image, the values are strange. It is receiving the correct values, but it is drawing strange values.
The first graph represents the Temperature and the second the Humidity, I divided because (as you can see) the temperature have values so low that do not appear.
Since you are persisting the items directly (and not only the groups) you could use the items directly on the charts (you are showing one item per chart anyway). I’d try that.
If that doesn’t help try stopping OH, deleting all .rrd files (to be found in /ar/lib/openhab2/persistence/rrd4j) and restarting OH.
Such is needed if (for example) the item type has been changed after the .rrd file has been created.
I’m using the same setup, however without the groups, and my charts are working as the ones from @H102. Your basic setup seems to correct (see the actual temp and humidity readings), the problem is either with the database or the chart creation.
Thanks @opus for pointing that out I should have caught that.
@JAF if needed, you can do this to clean up your system:
Stop OH if it is running. ```
sudo systemctl stop openhab2.service
2. Delete the contents of /var/lib/openhab2/cache and /var/lib/openhab2/tmp. For manual installations these folders are in your OH home folder under userdata. DO NOT DELETE THE FOLDERS THEMSELVES, JUST THE CONTENTS.
3. Start OH. ```
sudo systemctl start openhab2.service
Your item ValuesBathroomTemp is not needed because it’s already being persisted by the items group HomeSensorChart*.
My chart is working with both items listed as shown above (item and group in persistence), but it shouldn’t be required to list both. You can test by commenting out the item and use only the Group with // . Like this: