# MQTT Not updating on subscribe

**URL:** <https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808>\
**Category:** Tutorials & Examples\
**Created:** [December 26, 2017, 9:25pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808 "2017-12-26T21:25:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atikan](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@Atikan](https://community.openhab.org/u/Atikan)\
**Post date:** [December 26, 2017, 9:25pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/1 "2017-12-26T21:25:55Z")

</div>

HI, I am very much a noob to Openhab and MQTT. But certainly enjoying playing around with them.

I have a test sitemap setup, and a switch which is turning an LED on or off on an arduino board. This works fine. As part of the code on the arduino I am publishing back the value of the LED Status (1 or 0). I have a text item on the frame that is supposed to show the status of the led, however this does not update when the switch value changes. It does update of I refresh the page however. I have tested with MQTT.fx and the publish side of things is working fine, so the arduino code is not the issue.

Code is below.

Items  
// This is the test items file  
Switch TestSwitch “Test Switch”  
Switch LED\_Test “LED Test” {mqtt=“\>[broker:inTopic:command:ON:1],\>[broker:inTopic:command:OFF:0]”}  
Number LED\_Status “LED Status” {mqtt=“\<[broker:LEDStatus:state:default]”}

SiteMap  
sitemap test label=“Test Sitemap” {  
Frame label=“Test” {  
Switch item=TestSwitch  
Switch item=LED\_Test  
Text item=LED\_Status \<---- this is the item that is not updating unless a page refresh is done  
}  
}

---

<div class="post-metadata">

**Author:** ![binderth](https://community.openhab.org/user_avatar/community.openhab.org/binderth/32/56257_2.png) [@binderth](https://community.openhab.org/u/binderth)\
**Post date:** [December 26, 2017, 9:39pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/2 "2017-12-26T21:39:28Z")

</div>

please use code fences (``` or one of the Icons on the right), makes it easier to read.

and then, please have a look in your `events.log`, from what you’re telling, the state update via mqtt works. There should be entries, if you changed the LEDs.  
There might be some poblems with auto refresh with OH2.2 stable, (e.g. [No autoupdate in basicui after sitemap update](https://community.openhab.org/t/no-autoupdate-in-basicui-after-sitemap-update/37726)).

---

<div class="post-metadata">

**Author:** ![Atikan](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@Atikan](https://community.openhab.org/u/Atikan)\
**Post date:** [December 26, 2017, 9:57pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/3 "2017-12-26T21:57:07Z")

</div>

Thanks for the reply Thomas. Forgive me for such a simple question but where would I find the events.log (is this the tail log in openhab?). Sorry, very much a noob

---

<div class="post-metadata">

**Author:** ![sihui](https://community.openhab.org/user_avatar/community.openhab.org/sihui/32/55674_2.png) [@sihui](https://community.openhab.org/u/sihui)\
**Post date:** [December 27, 2017, 6:32am UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/4 "2017-12-27T06:32:49Z")

</div>

> [@Atikan](#):
>
> where would I find the events.log

If new to openHAB, a good starting point are the docs 🤣

[http://docs.openhab.org/administration/logging.html#file-system](http://docs.openhab.org/administration/logging.html#file-system)

---

<div class="post-metadata">

**Author:** ![binderth](https://community.openhab.org/user_avatar/community.openhab.org/binderth/32/56257_2.png) [@binderth](https://community.openhab.org/u/binderth)\
**Post date:** [December 27, 2017, 7:46am UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/5 "2017-12-27T07:46:54Z")

</div>

as sihui already pointed you to the docs, one word for better understanding: openHAB is primarily a backend system, combining different home automation related systems together, so you can automate within and between different systems.  
The UI(s) are only a means to show something happening in the backend. That being said: don’t rely on the UI, look at the logs or the console if you’re experiencing issues. 😉

and to add to sihui’s hint, if completely new to openHAB, there’s a ton of documentation already in place:

- [http://docs.openhab.org/tutorials/beginner/index.html](http://docs.openhab.org/tutorials/beginner/index.html)
- [http://docs.openhab.org/introduction.html](http://docs.openhab.org/introduction.html)

just keep digging through! It’s a bit of a steep learning curve, but worth it - and you can always come to the forum for help, if you’re stuck.

---

<div class="post-metadata">

**Author:** ![Atikan](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@Atikan](https://community.openhab.org/u/Atikan)\
**Post date:** [December 27, 2017, 7:30pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/6 "2017-12-27T19:30:35Z")

</div>

Thanks suhui. Much appreciated. I do use the documentation quite a bit. Its how I have got things working so far. And now I also have the log working, so cheers for that.

---

<div class="post-metadata">

**Author:** ![Atikan](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@Atikan](https://community.openhab.org/u/Atikan)\
**Post date:** [December 27, 2017, 7:31pm UTC](https://community.openhab.org/t/mqtt-not-updating-on-subscribe/37808/7 "2017-12-27T19:31:50Z")

</div>

Steep learning curve, thats true (for a windows developer its a whole new world), but great fun. Thanks for the help so far.
