Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


chimera

563 posts

Ultimate Geek
+1 received by user: 199

ID Verified

#198059 24-Jun-2016 12:42
Send private message

Got a weird issue with OpenHAB and MQTT broker (mosquitto) that was doing my head in last night...

 

I have MQTT running on same box as OpenHAB, sends messages to open/close the Garage Door and open/close the Roller Blinds.

 

The Garage door works perfectly fine.  The roller blinds don't. However with the rollerblinds if I publish a message from Linux command line (eg: mosquitto_pub -t "openhab/blinds/trigger" -m "OPEN") it works fine, the blinds will open.  There seems to be some issue between OpenHAB and Mosquitto - however I can't work it out because I've already proved that the communication must be fine as the Garage Door still works.  I just copied the garage door lines and altered for the blinds, changing the topic and message to suit. 

 

Here are the items and sitemap file:

 

 

 

Items file:

 

Switch doorButton "Garage Door" <garage> (gGarage) {mqtt=">[mqttbroker:openhab/garage/doorswitch:command:ON:ACTIVATE],>[mqttbroker:openhab/garage/doorswitch:command:OFF:DEACTIVATE]"}
Number doorStatus "Door Status [MAP(switch.map):%d]" <garagedoor> (gGarage) {mqtt="<[mqttbroker:openhab/garage/doorstatus:state:default]"}
Switch hallBlinds "Hall Blinds" <rollershutter> (gBlinds) {mqtt=">[mqttbroker:openhab/blinds/trigger:command:ON:OPEN],>[mqttbroker:openhab/blinds/trigger:command:OFF:CLOSE]"}
Number blindStatus "Controller [MAP(blinds.map):%d]" <icon16x16> (gBlinds) {mqtt="<[mqttbroker:openhab/blinds/status:state:default]"}

 

 

 

Sitemap:

 

Frame label="Doors and Blinds" {
  Switch item=hallBlinds mappings=[ON="Up", OFF="Down"]
  Text item=blindStatus
  Switch item=doorButton mappings=[ON="Open", OFF="Close"]
  Text item=doorStatus

 

 

 

Any ideas?

 

 


Create new topic
SumnerBoy
2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #1579496 24-Jun-2016 12:46
Send private message

Can't see anything obviously wrong in there. Time to enable debug logging for the OH MQTT binding and see what is happening in there maybe?

 

There is nothing at all appearing on your openhab/blinds/trigger topic when you switch via OH?




chimera

563 posts

Ultimate Geek
+1 received by user: 199

ID Verified

  #1579543 24-Jun-2016 13:41
Send private message

Wow, can you believe the issue is with the icon name?

 

I remove the dash in the icon name and it resolves the problem.

 

Changed from <rollershutter-20> to just <rollershutter> and that sorted it!  Ironically I posted the text without the - in it above...

 

 


Blanch
254 posts

Ultimate Geek
+1 received by user: 19


  #1579555 24-Jun-2016 14:08
Send private message

chimera:

 

Wow, can you believe the issue is with the icon name?

 

I remove the dash in the icon name and it resolves the problem.

 

Changed from <rollershutter-20> to just <rollershutter> and that sorted it!  Ironically I posted the text without the - in it above...

 

 

 

 

The fun to be had when playing with Openhab,

 

SumnerBoy comment “Can't see anything obviously wrong in there.” Had me worried

 

 




SumnerBoy
2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #1579590 24-Jun-2016 15:04
Send private message

Yeah I have come across that before - the openHAB parser is pretty sensitive to dashes. I once decided to re-name my entire config using a better naming scheme, thinking that "<FLOOR>-<ROOM>-<NAME>" was the way to go. Went through and spent an age renaming everything and when I loaded it up for the first time openHAB had all sorts of meltdowns. 

 

Had to revert to "<FLOOR>_<ROOM>_<NAME>" and everything was fine.

 

Definitely something to watch out for!


SumnerBoy
2079 posts

Uber Geek
+1 received by user: 306

ID Verified
Lifetime subscriber

  #1579592 24-Jun-2016 15:04
Send private message

Yeah I have come across that before - the openHAB parser is pretty sensitive to dashes. I once decided to re-name my entire config using a better naming scheme, thinking that "<FLOOR>-<ROOM>-<NAME>" was the way to go. Went through and spent an age renaming everything and when I loaded it up for the first time openHAB had all sorts of meltdowns. 

 

Had to revert to "<FLOOR>_<ROOM>_<NAME>" and everything was fine.

 

Definitely something to watch out for!


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.