these are the default wiki instructions. Maybe you have customized your Sonoff and you are using different topics? (I am not sure)
From your logs, I haven’t seen your Sonoff using the defaults.
these are the default wiki instructions. Maybe you have customized your Sonoff and you are using different topics? (I am not sure)
From your logs, I haven’t seen your Sonoff using the defaults.
thanks Dim. time to call it a night.
tail -f /var/log/openhab2/openhab.log -f /var/log/mosquitto/mosquitto.log
==> /var/log/openhab2/openhab.log <==
2017-08-20 03:02:28.962 [DEBUG] [org.openhab.binding.mqtt ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService}={event.topics=openhab/*, service.pid=org.openhab.mqtt-eventbus, component.name=org.openhab.binding.mqtt.eventbus, component.id=204, service.id=323, service.bundleid=237, service.scope=bundle} - org.openhab.binding.mqtt
2017-08-20 03:02:29.013 [DEBUG] [org.openhab.binding.mqtt ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler}={event.topics=openhab/*, component.name=org.openhab.binding.mqtt.MqttItemBinding, component.id=205, service.id=324, service.bundleid=237, service.scope=bundle} - org.openhab.binding.mqtt
2017-08-20 03:02:29.017 [DEBUG] [org.openhab.binding.mqtt ] - BundleEvent STARTED - org.openhab.binding.mqtt
2017-08-20 03:02:44.858 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Stopped HABmin servlet
2017-08-20 03:02:45.004 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-08-20 03:02:51.645 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-08-20 03:02:51.934 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-08-20 03:08:39.065 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-08-20 03:08:39.078 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
2017-08-20 03:08:39.086 [ERROR] [org.apache.felix.configadmin ] - Cannot use configuration org.openhab.mqtt for [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=272, bundle=239/mvn:org.openhab.action/org.openhab.action.mqtt/1.10.0]: No visibility to configuration bound to mvn:org.openhab.io/org.openhab.io.transport.mqtt/1.10.0
==> /var/log/mosquitto/mosquitto.log <==
1503214395: New client connected from ::1 as mosqsub|5544-openHABian (c1, k60, u'openhab').
1503214398: New connection from ::1 on port 1883.
1503214398: New client connected from ::1 as mosqpub|5545-openHABian (c1, k60, u'openhab').
1503214398: Client mosqpub|5545-openHABian disconnected.
1503214459: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1503214850: Socket error on client mosqsub|5544-openHABian, disconnecting.
1503215766: Client openhabian disconnected.
1503216145: New connection from 127.0.0.1 on port 1883.
1503216145: New client connected from 127.0.0.1 as openhabian (c1, k60).
1503216260: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
==> /var/log/openhab2/openhab.log <==
2017-08-20 03:18:47.043 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command ON to cmnd/diana/cord1/POWER
2017-08-20 03:18:47.042 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command ON to cmnd/diana/cord1/POWER
2017-08-20 03:18:47.350 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command ON to cmnd/diana/cord1/POWER
2017-08-20 03:18:49.387 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command OFF to cmnd/diana/cord1/POWER
2017-08-20 03:18:50.604 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command OFF to cmnd/diana/cord1/POWER
==> /var/log/mosquitto/mosquitto.log <==
1503218061: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
==> /var/log/openhab2/openhab.log <==
2017-08-20 03:39:54.410 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'lights.items'
2017-08-20 03:39:54.487 [DEBUG] [.internal.MqttGenericBindingProvider] - Removing message consumers for item Cord1
2017-08-20 03:39:54.498 [DEBUG] [.internal.MqttGenericBindingProvider] - Removing message publishers for item Cord1
2017-08-20 03:39:54.512 [DEBUG] [binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'Cord1' : 1 subscribers, 1 publishers
and you are subscribing to what seems to be the correct topics (diana/cord1/#
):
/etc/mosquitto$ mosquitto_sub -h localhost -t 'diana/cord1/#' -v
hmm…
something is (still) wrong with the OH2->MQTT Broker connection…
your mqtt.cfg is not being loaded (maybe?).
Try again (tomorrow ) the:
Also, uninstall the org.openhab.action.mqtt
I have seen that in some cases, it creates a conflict with the MQTT Binding…
Openhab integration excerpt:
If not done yet, you first need to install and activate the MQTT binding, the MQTT action and the JsonPath transformation, e.g. via the openHAB Paper UI Add-ons section.
yeah… the MQTT Action is used by the rules (e.g. this part)
you can try to re-install it to see if this will help the situation.
OK… Catastrophic failure… Hurricane and all. Had to start from scratch. But it was worth it. I can now toggle my light from ssh:
What I can’t do is toggle it from Habpanel or classic UI
what next? Thanks for all your help before @Dim
mosquitto_pub -u openhabian -P Dxxxxxxx -d -t diana/cord1/cmnd/POWER -m on
Client mosqpub|1818-DianaHAB sending CONNECT
Client mosqpub|1818-DianaHAB received CONNACK
Client mosqpub|1818-DianaHAB sending PUBLISH (d0, q0, r0, m1, 'diana/cord1/cmnd/POWER', ... (2 bytes))
Client mosqpub|1818-DianaHAB sending DISCONNECT
and the same for off.
and when I do toggle it through sub pub i get
mosquitto_sub -u openhabian -P Dxxxxxxx -d -t '$SYS/broker/clients/active'
Client mosqsub|1608-DianaHAB sending CONNECT
Client mosqsub|1608-DianaHAB received CONNACK
Client mosqsub|1608-DianaHAB sending SUBSCRIBE (Mid: 1, Topic: $SYS/broker/clients/active, QoS: 0)
Client mosqsub|1608-DianaHAB received SUBACK
Subscribed (mid: 1): 0
Client mosqsub|1608-DianaHAB received PUBLISH (d0, q0, r1, m0, '$SYS/broker/clients/active', ... (1 bytes))
1
Client mosqsub|1608-DianaHAB received PUBLISH (d0, q0, r0, m0, '$SYS/broker/clients/active', ... (1 bytes))
2
mosquitto.conf
pid_file /var/run/lib/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
connection_messages true
allow_anonymous false
password_file /etc/mosquitto/passwd
items -(openhab Generator is the bomb)- don’t bother scrolling
Group Home "Diana" <house>
Group Cords "Cords" <poweroutlet> (Lights, Home)
Switch cord1 "Cord-1" <poweroutlet> (Cords, Lights, Power)
{ mqtt=">[mosquitto:diana/cord1/POWER:on], >[mosquitto:diana/cord1/POWER:off]
<[mosquitto:stat/Cord1_Light/POWER:state:default]" }
Switch Cord2_Light "Cord-2" <poweroutlet> (Cords, Lights, Power)
{ mqtt=">[mosquitto:cmd/Cord2_Light/POWER:command:*:default],
<[mosquitto:stat/Cord2_Light/POWER:state:default]" }
Group Attic "Attic" <attic> (Home)
Number Attic_Temperature "Attic Temp" <temperature> (Attic, Temperature)
Number Attic_Humidity "Attic Humidity" <humidity> (Attic, Humidity)
Group LaundryRoom "Laundry Room" <washingmachine> (Home)
Switch LaundryRoom_Light "Laundry Room" <light> (LaundryRoom, Lights)
Contact LaundryRoom_Door "Laundry Room Door" <door> (LaundryRoom, Doors)
Group Kitchen "Kitchen" <kitchen> (Home)
Switch Kitchen_Light "Kitchen" <light> (Kitchen, Lights)
Switch Island_Light "Kitchen Island" <light> (Kitchen, Lights)
Switch Dinette_Light "Dinette" <light> (Kitchen, Lights)
Contact Kitchen_Window "Kitchen Window" <window> (Kitchen, Windows)
Contact Kitchen_Door "Kitchen Door" <door> (Kitchen, Doors)
Number Kitchen_Temperature "Kitchen Temp" <temperature> (Kitchen, Temperature)
Group Dining "Dining" (Home)
Switch Dining_Light "Diningroom" <light> (Dining, Lights)
Number Dining_Temperature "Diningroom Temp" <temperature> (Dining, Temperature)
Group Living "Livingroom" <sofa> (Home)
Switch Living_Light "Livingroom" <light> (Living, Lights)
Switch Living_Fan "Livingroom Fan" <fan_ceiling> (Living, Fans)
Switch Livingroom_Power "Power outlets" <poweroutlet> (Living, Power)
Number Living_Temperature "Temperature" <temperature> (Living, Temperature)
Group Entrance "Entrance" <frontdoor> (Home)
Switch Entrance_Light "Entrance" <light> (Entrance, Lights)
Contact Entrance_Door "Front Door" <door> (Entrance, Doors)
Switch Entrance_Power "Power outlets" <poweroutlet> (Entrance, Power)
Number Entrance_Temperature "Entrance Temp" <temperature> (Entrance, Temperature)
Group Hallway "Hallway" <corridor> (Home)
Switch Hallway_Light "Hallway" <light> (Hallway, Lights)
Group MasterBedroom "Master Bedroom" <bedroom_red> (Home)
Switch MasterBedroom_Light "Master Bedroom" <light> (MasterBedroom, Lights)
Contact MasterBedroom_Door "Master Bedroom Door" <door> (MasterBedroom, Doors)
Switch MasterBedroom_Fan "Master Bedroom Fan" <fan_ceiling> (MasterBedroom, Fans)
Number MasterBedroom_Temperature "Master Bedroom Temp" <temperature> (MasterBedroom, Temperature)
Group Bedroom "Bedroom" <bedroom> (Home)
Switch Bedroom_Light "Front Bedroom" <light> (Bedroom, Lights)
Contact Bedroom_Window "Bedroom 1 Window" <window> (Bedroom, Windows)
Switch Bedroom_Fan "Bedroom 1 Fan" <fan_ceiling> (Bedroom, Fans)
Number Bedroom_Temperature "Bedroom 1 Temp" <temperature> (Bedroom, Temperature)
Group Bedroom2 "Bedroom 2" (Home)
Switch Bedroom2_Light "Bedroom 2" <light> (KidRoom1, Lights)
Contact Bedroom2_Window "Bedroom 2 Window" <window> (KidRoom1, Windows)
Switch Bedroom2_Fan "Bedroom 2 Fan" <fan_ceiling> (KidRoom1, Fans)
Number Bedroom2_Temperature "Bedroom 2 Temp" <temperature> (KidRoom1, Temperature)
Group Bedroom3 "Bedroom 3" (Home)
Switch Bedroom3_Light "Bedroom 3" <light> (KidRoom2, Lights)
Contact Bedroom3_Window "Bedroom 3 Window" <window> (KidRoom2, Windows)
Switch Bedroom3_Fan "Bedroom 3 Fan" <fan_ceiling> (KidRoom2, Fans)
Number Bedroom3_Temperature "Bedroom 3 Temp" <temperature> (KidRoom2, Temperature)
Group Bathroom "Bathroom" <bath> (Home)
Switch Bathroom_Light "Bathroom" <light> (Bathroom, Lights)
Contact Bathroom_Window "Bathroom Window" <window> (Bathroom, Windows)
Number Bathroom_Humidity "Bathroom Humidity" <humidity> (Bathroom, Humidity)
Group MasterBathroom "Master Bathroom" (Home)
Switch MasterBathroom_Light "Master Bathroom" <light> (MasterBathroom, Lights)
Contact MasterBathroom_Window "Master Bathroom Window" <window> (MasterBathroom, Windows)
Number MasterBathroom_Temperature "Master Bathroom Temp" <temperature> (MasterBathroom, Temperature)
Number MasterBathroom_Humidity "Master Bathroom Humidity" <humidity> (MasterBathroom, Humidity)
Group Porch "Porch" <group> (Home)
Switch Porch_Light "Porch" <light> (Porch, Lights)
Group Garage "Garage" <garage> (Home)
Switch Garage_Light "Garage" <light> (Garage, Lights)
Contact Garage_Door "Garage Door" <Garage> (Garage, Doors)
Number Garage_Temperature "Garage Temp" <temperature> (Garage, Temperature)
Group Outdoor_Floods "Outdoor" <garden> (Home)
Switch GarageFront_Light "Garage Front" <light> (Outdoor, Lights)
Switch YardFL_Light "Yard" <light> (Outdoor, Lights)
Switch PatioFL1_Light "Light" <light> (Outdoor, Lights)
Switch PatioFL2_Light "Light" <light> (Outdoor, Lights)
Group:Number:AVG Temperature "Temperature" <temperature> (Home)
Group:Number:AVG Humidity "Humidity" <humidity> (Home)
//Group:Switch:OR(ON, OFF) Lights "Lights" <light> (Home)
Group:Contact:OR(OPEN, CLOSED) Windows "Windows" <window> (Home)
//Group:Switch:OR(ON, OFF) Fans "Fans" <fan_ceiling> (Home)
Group:Contact:OR(OPEN, CLOSED) Doors "Doors" <door> (Home)
Group:Switch:OR(ON, OFF) Power "Power outlets" <poweroutlet> (Home)
//Group HomeCinema "Home Cinema" <television> (Home)
// Switch HomeCinema_Light "Light" <light> (HomeCinema, Lights)
//Group KidsRoom "Kids Room" (Home)
// Switch KidsRoom_Light "Light" <light> (KidsRoom, Lights)
// Contact KidsRoom_Window "Window" <window> (KidsRoom, Windows)
// Switch KidsRoom_Fan "Fan" <fan_ceiling> (KidsRoom, Fans)
// Number KidsRoom_Temperature "Temperature" <temperature> (KidsRoom, Temperature)
//Group Lounge "Lounge" <sofa> (Home)
// Switch Lounge_Light "Light" <light> (Lounge, Lights)
// Switch Lounge_Fan "Fan" <fan_ceiling> (Lounge, Fans)
// Number Lounge_Temperature "Temperature" <temperature> (Lounge, Temperature)
//Group Office "Office" <office> (Home)
// Switch Office_Light "Light" <light> (Office, Lights)
// Contact Office_Window "Window" <window> (Office, Windows)
// Switch Office_Fan "Fan" <fan_ceiling> (Office, Fans)
// Number Office_Temperature "Temperature" <temperature> (Office, Temperature)
//Group SecondBedroom "Second Bedroom" <bedroom_orange> (Home)
// Switch SecondBedroom_Light "Light" <light> (SecondBedroom, Lights)
// Contact SecondBedroom_Window "Window" <window> (SecondBedroom, Windows)
// Switch SecondBedroom_Fan "Fan" <fan_ceiling> (SecondBedroom, Fans)
mqtt.cfg
mosquitto.url=tcp://127.0.0.1:1883
mosquitto.clientId=mosqtt
mosquitto.qos=1
mosquitto.retain=true
mosquitto.async=false
mosquitto.user=openhabian
mosquitto.pwd=Dxxxxxxxx
sitemap
sitemap diana label="Diana" {
Frame {
Group item=Attic
Group item=LaundryRoom
Group item=Kitchen
Group item=Dining
Group item=Living
Group item=Entrance
Group item=Hallway
Group item=Bedroom
Group item=Bedroom2
Group item=Bedroom3
Group item=MasterBedroom
Group item=Bathroom
Group item=MasterBathroom
Group item=Garage
Group item=Cords
Group item=Porch
Group item=Outdoor
//Group item=HomeCinema
//Group item=KidRoom1
//Group item=KidRoom2
//Group item=Lounge
//Group item=Office
//Group item=SecondBathroom
}
Frame {
Group item=Temperature
Group item=Humidity
//Group item=Lights
Group item=Windows
//Group item=Fans
Group item=Doors
//Group item=Power
}
}
On reboot this is the only warning from the Openhab.log
2017-08-28 20:29:43.123 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'mqtt' of item 'cord1' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration 'mosquitto:diana/cord1/POWER:on' is not a valid outbound configuration: Configuration requires 5 parameters separated by ':'