so⊠did the mosqsub|1730-openHABian
dissapear?
no response from what? (OH2 or the Sonoff?)
post your item config to check it
yes! (for now?)
EDIT: NO!
1500719565: New connection from 127.0.0.1 on port 1883.
1500719565: New client connected from 127.0.0.1 as openHAB2 (c1, k60).
1500720088: New connection from 127.0.0.1 on port 1883.
1500720088: New client connected from 127.0.0.1 as mosqsub|7105-openHABian (c1, k60).
1500720244: New connection from 192.168.178.160 on port 1883.
still no communication with openHAB2 ?
[12:34:38] openhabian@openHABianPi:~$ mosquitto_sub -v -t 'tele/#' -t 'stat/#'
tele/sonoff/LWT Online
stat/sonoff/RESULT {"POWER":"OFF"}
stat/sonoff/POWER OFF
tele/sonoff/STATE {"Time":"2017-07-22T11:43:00", "Uptime":3, "Vcc":3.204, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"NETGEAR47", "RSSI":32, "APMac":"80:2A:A8:4A:C7:AC"}}
thoughts: if the TOPIC is âsonoff1â, my item should be:
Switch Sonoff_TH16A "Sonoff Test" <light>
{ mqtt=">[broker:cmnd/sonoff1/POWER:command:*:default],
<[broker:stat/sonoff1/POWER:state:default]" }
right?
'til now i have used the client id of the sonoff deviceâŠ
changing (correcting) the item doesnât help, still no signs in openhab.logâŠ
[quote=âDim, post:28, topic:31993â]
no response from what? (OH2 or the Sonoff?)
[/quote] no response from Sonoff. I donât know how to see if could be any chance on OH2. But the log is below:
2017-07-22 07:23:49.078 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-07-22 07:23:49.083 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'raspberrypiâ
2017-07-22 07:23:49.619 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-07-22 07:23:49.921 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-07-22 07:23:50.023 [WARN ] [mqtt.internal.MqttPersistenceService] - mqtt-persistence:topic
2017-07-22 07:23:50.026 [WARN ] [mqtt.internal.MqttPersistenceService] - mqtt-persistence:message
the sonoff.item:
Switch Abajur_light âAbajurâ (LR, gLight)
{ mqtt=">[raspberrypi:cmnd/sonoff-abajur/POWER:command:ON:on], >[raspberrypi:cmnd/sonoff-abajur/POWER:command:OFF:off],
<[raspberrypi:stat/sonoff-abajur/POWER:state:default]" }
When I tried to move the switch at OH2, I got the following message:
2017-07-22 07:56:06.192 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2017-07-22 07:56:06.207 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item âAbajurâ for widget org.eclipse.smarthome.model.sitemap.Switch
2017-07-22 07:56:06.211 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item âAbajurâ for widget org.eclipse.smarthome.model.sitemap.Switch
2017-07-22 07:56:06.215 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Switch
2017-07-22 07:56:06.244 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value â93.25861â of item LivingRoom_Light_RSSI with format â%d %%â: java.util.IllegalFormatConversionException: d != java.math.BigDecimal
anything useful with lsof -i :1883
?
or ps -efwww |grep 7105
(that seems to be the process id)
checking your item nowâŠ
for starters, change broker
to mqttson
edit: check examples from here:
it should be something like:
Switch Sonoff_TH16A "Sonoff Test" <light> { mqtt=">[mqttson:cmnd/sonoff/power:command:*:default], <[mqttson:stat/sonoff1/power:state:default]" }
Hello, jumping in here because of the mentioning before.
Pay attention to the first topic level: cmnd vs. stat - thatâs something I personally donât like about the Tasmota default settings. This order can btw be changed in settings.
The config is in sync with what Iâve given as a template here.
Sooo from what Iâve read we are looking at two problems here. Why is there an additional connection with the clientID mosqsub|1234-openHABian
and why is your openHAB not able to receive states and send commands.
- The additional connection is not present on my system
- @narf27 looking at this posting your setup is simply wrong. The topic name of your module is âsonoffâ, you are subscribing to âsonoff1â. Change the topic of your module before adding it to openHAB! Also just as @Dim said, you need to use the right broker name. Please check your setup against this article: https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB#requirements
this is driving me crazy
anyway this thread is a mess with 2 different setups that we are trying to debug
edit: You are right⊠I didnât see the first topic level
Example setup Click to see fill image
â> Added to the Tasmota wiki
And the corresponding items configuration:
Switch BK_Balkonmagic "Balkonmagic" <stars> (BK,gLight) {mqtt=">[broker:tasmota/sonoff-A00EEA/cmnd/POWER:command:*:default], <[broker:tasmota/sonoff-A00EEA/stat/POWER:state:default]"}
Number BK_Balkonmagic_RSSI "Balkonmagic RSSI [%d %%]" (gRSSI) {mqtt="<[broker:tasmota/sonoff-A00EEA/tele/STATE:state:JSONPATH($.Wifi.RSSI)]"}
Switch BK_Balkonmagic_Unreach "Balkonmagic unreachable" <siren> (gUnreach) {mqtt="<[broker:tasmota/sonoff-A00EEA/tele/LWT:state:MAP(unreach.map)]"}
Click the image
@paulo9999 : you have some errors in your sitemap file
your item is defined as Abajur_light
but your sitemap is complaining about an item named Abajur
post your items and sitemap contents to be checked
@Dim:
thank you, sorry for this slight mistake, Iâve corrected it, now sitemap is ok but unfortunately things still isnât workingâŠ
Paulo
is anything useful in the logs?
read again the examples that Thom posted, You will get it working (it seems that your broker connection is fine)
[19:34:12] openhabian@openHABianPi:~$ lsof -i :1883
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mosquitto 7105 openhabian 5u IPv4 21570 0t0 TCP localhost:40962->localhost:1883 (ESTABLISHED)
ANYWAY⊠these are my settings now:
sonoff device TH16:
Client Id = OH2MQTT
Topic = sonoff1
Full Topic = tasmota/%topic%/%prefix%/
items (according to @ThomDietrich) :
Switch Sonoff_TH16A "Balkonmagic" <stars> {mqtt=">[broker:tasmota/sonoff1/cmnd/POWER:command:*:default], <[broker:tasmota/sonoff1/stat/POWER:state:default]"}
Number Sonoff_TH16A_RSSI "Balkonmagic RSSI [%d %%]" {mqtt="<[broker:tasmota/sonoff1/tele/STATE:state:JSONPATH($.Wifi.RSSI)]"}
Switch Sonoff_TH16A_Unreach "Balkonmagic unreachable" <siren> {mqtt="<[broker:tasmota/sonoff1/tele/LWT:state:MAP(unreach.map)]"}
mqtt.cfg:
[19:59:02] openhabian@openHABianPi:~$ cat /var/lib/openhab2/config/org/openhab/mqtt.config
mqttson.clientId="openHAB2"
mqttson.url="tcp://127.0.0.1:1883"
service.pid="org.openhab.mqtt"
So⊠does it work?
I feel like both of you should take a step back. For example in your posting the Client Id = OH2MQTT
- Do you know what this means? Your setting doesnât make much sense, you should just leave it with the default setting. Next your Topic setting. Why sonoff1? Give it a meaningful name, something you can work with (e.g. âsonoff-coridorlightâ, not too long, no underscore).
Your config looks okay. You can again leave the client Id setting commented to have a random one generated. I take it your broker doesnât provide authentication? If youâve installed via openHABian setting up a password was offered.
After youâve set up everything do a test. You could for example restart openHAB, then wait a few minutes and check the log for mqtt related messages. It should look similar to this one:
[21:22:34] openhabian@openHABianPiW66a:~$ grep "mqtt" /var/log/openhab2/*
/var/log/openhab2/openhab.log:2017-07-22 16:52:19.891 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
/var/log/openhab2/openhab.log:2017-07-22 16:52:19.893 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'broker'
/var/log/openhab2/openhab.log:2017-07-22 17:13:40.344 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'broker'
/var/log/openhab2/openhab.log:2017-07-22 17:15:24.084 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
/var/log/openhab2/openhab.log:2017-07-22 17:15:24.089 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'broker'
sadly it doesnât
Client id - itâs the id iâm connecting to the broker?
which part of the (mqtt.cfg?) setting doesnât make sense?
why sonoff1? because for now i have two sonoff devices and this is the one iâm testing with (iâm not sure where the device will be installed later, so a meaningful name would be hard to find)
[quote=âThomDietrich, post:43, topic:31993â]
Your config looks okay. You can again leave the client Id setting commented to have a random one generated. I take it your broker doesnât provide authentication? If youâve installed via openHABian setting up a password was offered.
[/quote]didnât set auth.
reboot:
2017-07-22 23:28:41.980 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)[197:org.openhab.io.transport.mqtt:1.10.0]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)[197:org.openhab.io.transport.mqtt:1.10.0]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)[197:org.openhab.io.transport.mqtt:1.10.0]
2017-07-22 23:28:41.998 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'mqttson' was lost: Connection lost : ReasonCode 32109 : Cause : null
2017-07-22 23:28:41.999 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mqttson'
2017-07-22 23:28:52.002 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mqttson'
2017-07-22 23:28:55.288 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'broker'
2017-07-22 23:28:55.289 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'mqttson'
2017-07-22 23:30:04.375 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-07-22 23:30:04.387 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mqttson'
2 mqtt broker configs⊠did you clear /var/lib/openhab2/config/org/openhab/mqtt.config
?
Since when is this really needed? I personally never had to mess around in these filesâŠ