What do these errors mean and how to fix?

New openhab.log

2017-08-29 00:23:06.432 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.168.1.200:8443
2017-08-29 00:23:20.703 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'weather.items'
2017-08-29 00:23:21.129 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'diana.items'
2017-08-29 00:23:30.688 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'diana.sitemap'
2017-08-29 00:23:34.510 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-08-29 00:23:34.560 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
2017-08-29 00:23:35.913 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-08-29 00:23:36.285 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2017-08-29 00:23:37.653 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-08-29 00:23:38.185 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-08-29 00:23:38.496 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-08-29 00:23:56.935 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Stopped HABmin servlet
2017-08-29 00:23:57.069 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-08-29 00:24:02.764 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-08-29 00:24:03.147 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin

looks nice & clean :sunny:

Well
 somethings different. when I toggle through Habpanel,

2017-08-29 00:28:41.131 [ItemCommandEvent          ] - Item 'cord1' received command ON
2017-08-29 00:28:41.238 [ItemStateChangedEvent     ] - cord1 changed from NULL to ON
2017-08-29 00:28:41.238 [GroupItemStateChangedEvent] - Power changed from NULL to ON through cord1
2017-08-29 00:28:43.502 [ItemCommandEvent          ] - Item 'cord1' received command ON
2017-08-29 00:28:46.469 [ItemCommandEvent          ] - Item 'cord1' received command ON

but the icon reverts back to the off state.
going to try a lowercase :power"

post your current item config

maybe the command part is not working (the mqtt message is not being delivered) and your status part is working, so OH2 reads that the Sonoff is off and it changes the switch state to OFF

what is the real state of the Sonoff module? (on or off)

just changed it a bit. testing.

scroll down a bit.

Group Home "Diana"   <house>

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 Cords "Cords" <poweroutlet> (Lights, Home)
    Switch cord1 "Cord-1" <poweroutlet> (Cords, Lights, Power)
     { mqtt=">[mosquitto:cmnd/diana/cord1/power:command:1:on], >[mosquitto:cmnd/diana/cord1/power:command:0:off],
             <[mosquitto:stat/diana/cord1/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 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)

1 Like

open up a subscription to all topics using a shell command to check if the mqtt messages reach the broker at the correct topics when you toggle the switch from your OH2 sitemap:

mosquitto_sub -u openhabian -P Dxxxxxx -t '#'

(or use a tool like MQTT.fx etc to monitor the payload traffic to the broker)

looks ok
in theory, you don’t need to separate the on/off commands
cmnd/diana/cord1/power:command:*:default should cover both on and off

mosquitto_sub -u openhabian -P Dxxxxxx -t diana/cord1/cmnd/power

[00:36:33] openhabian@DianaHAB:~$ mosquitto_sub -u openhabian -P Dxxxx -t diana/cord1/cmnd/POWER
^C
[00:38:20] openhabian@DianaHAB:~$ mosquitto_sub -u openhabian -P Dxxxxx -t diana/cord1/cmnd/power
^C
[00:39:14] openhabian@DianaHAB:~$ mosquitto_sub -u openhabian -P Dxxxxxx -t diana/cord1/cmnd/power/"#"
^C
[00:39:57] openhabian@DianaHAB:~$ mosquitto_sub -u openhabian -P Dxxxxxxx -t cmnd/diana/cord1/cmnd/power/"#"

``
not receiving from Habpanel

I really wish that I had a Sonoff to be able to help more :slight_smile:
I am not 100% clear on the correct structure of the topics
 you need to play around with config options to find the correct method

by the way: if you want to use a trigger and a transformation, it should be the other way around (I think):

the trigger should be ON and the transformation should be 1

{ mqtt=">[mosquitto:cmnd/diana/cord1/power:command:ON:1], >[mosquitto:cmnd/diana/cord1/power:command:OFF:0],

(ON and OFF triggers with capital letters)

keep the subscription command open at the top level topic (#) (means all) at the shell and then toggle the switch from your UI and check what shows up in the shell while leaving the subscription connected continuously

just switched it back to:

cmnd/diana/cord1/power:command:*:default

1 Like

events.log

2017-08-29 00:43:40.687 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'diana.items'
2017-08-29 00:43:41.065 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'diana.items'
==> /var/log/openhab2/events.log <==
2017-08-29 00:45:10.882 [ItemCommandEvent          ] - Item 'cord1' received command ON
2017-08-29 00:45:10.895 [ItemStateChangedEvent     ] - cord1 changed from NULL to ON
2017-08-29 00:45:10.900 [GroupItemStateChangedEvent] - Power changed from NULL to ON through cord1
2017-08-29 00:45:11.890 [ItemCommandEvent          ] - Item 'cord1' received command ON
2017-08-29 00:45:12.392 [ItemCommandEvent          ] - Item 'cord1' received command ON

bottom of MQTT features wiki page


Until version 5.0.5 the MQTT topic was defined rigidly by using the commands Prefix<x> and Topic resulting in a command topic string like cmnd/sonoff/Power.

Starting with version 5.0.5 the MQTT topic is more flexible using command FullTopic and tokens to be placed within the user definable string up to 100 characters in size. The provided tokens are:

%prefix% to be dynamically substituted by one of three prefixes as defined by commands Prefix1, Prefix2 and Prefix3.
%topic% to be dynamically substituted by one of five topics as defined by commands Topic, GroupTopic, ButtonTopic, SwitchTopic and MqttClient.
Using the tokens the following example topics can be made:

FullTopic %prefix%/%topic%/ being the legacy situation up to version 5.0.5
FullTopic tasmota/%topic%/%prefix%/
FullTopic tasmota/bedroom/%topic%/%prefix%/
FullTopic penthouse/bedroom1/bathroom2/%topic%/%prefix%/

This is where my topic string came from.
full topic diana/cord1
but according to this I should add /%topic%/%prefix%/ to the end

so your %topic% is: cord1 and your %prefix% is: diana (according to: this)

correct?

as I understand it.

by the way, the correct mosquitto_sub command (to sub to all topics) is:

mosquitto_sub -u openhabian -P Dxxxx -t '#'

it’s easier to use a tool like MQTT.fx since it will show you the topic also. The command will only show you the message.

edit: with debug on it will show you also the topics:

mosquitto_sub -u openhabian -d -P Dxxxx -t '#'

it’s 9am in Europe, so I need to run to my office :slight_smile:
it’s 1am in US East coast, so you need to take a break and try again tomorrow morning :slight_smile:

1 Like

yea thanks.

1 Like

in terminal:

 openhabian@DianaHAB:~$ mosquitto_sub -u openhabian -d -P D1aNAL@n3 -t '#'
Client mosqsub|2170-DianaHAB sending CONNECT
Client mosqsub|2170-DianaHAB received CONNACK
Client mosqsub|2170-DianaHAB sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 0)
Client mosqsub|2170-DianaHAB received SUBACK
Subscribed (mid: 1): 0
Client mosqsub|2170-DianaHAB received PUBLISH (d0, q0, r1, m0, 'diana/cord1/LWT', ... (6 bytes))
Online
Client mosqsub|2170-DianaHAB received PUBLISH (d0, q0, r1, m0, 'cmd/cord1/POWER', ... (3 bytes))
OFF
Client mosqsub|2170-DianaHAB received PUBLISH (d0, q0, r1, m0, 'cmd/Cord2_Light/POWER', ... (3 bytes))
OFF
Client mosqsub|2170-DianaHAB received PUBLISH (d0, q0, r1, m0, 'cmnd/diana/cord1/POWER', ... (2 bytes))
ON
Client mosqsub|2170-DianaHAB received PUBLISH (d0, q0, r1, m0, 'cmnd/diana/cord1/power', ... (2 bytes))
ON

in MQTTlens same topic - NOTHING