[SOLVED] Looking for help with MQTT and ESP8266 communication

In the rules file, there was a line of code

sendBroadcastNotification("SECURITY SYSTEM: SIDE DOOR OPEN")

That was supposed to send the message to your phone. I never set that up so it didn’t do anything but cause an error in the log file.

When the door sensor is OPEN, I want the “power” button on the BasicUI screen to turn red and then back to green when the door is closed.

@johntech you can do that with the sitemap, no rule needed. Here is one example that I use for doing what you describe.

ext item=Esp_Easy_Motion label="Garage Movement [%s]" labelcolor=[OFF="green", ON="red"]   valuecolor=[OFF="green", ON="red"]

Just change the item name and label description can be whatever you like. You will also need to change the label color part OFF to CLOSED as well as the ON to OPEN like below

ext item=Esp_Easy_Motion label="Garage Movement [%s]" labelcolor=[CLOSED="green", OPEN="red"]   valuecolor=[CLOSED="green", OPEN="red"]

Here is what mine looks like.

Here’s the documentation for all the things you can do with your sitemap.
https://www.openhab.org/docs/configuration/sitemaps.html#dynamic-sitemaps

1 Like

Thanks for the links. and it works great. I need to do A LOT more reading on the OH system now that you helped me get it working. Thanks again!!

I think my next step is to monitor that switch or any switch I use, in OH, to change the enable switch on the BasicUI screen to disabled if communication fails as a visual indication of failure.
say I lose power to that board or the switch goes bad.

Glad is working and hope you have fun with OH. I guess the thread is solved, so please click the square box (near the heart icon) on the post that solved your issue.

Best of Luck