# Read Only Switch does not work // workaround realized - please check if this is the proper way

**URL:** <https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677>\
**Category:** Beginners\
**Tags:** sitemap1, switch, readonly\
**Created:** [September 19, 2021, 8:17pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677 "2021-09-19T20:17:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rey](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@Rey](https://community.openhab.org/u/Rey)\
**Post date:** [September 19, 2021, 8:17pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677/1 "2021-09-19T20:17:10Z")

</div>

Hi everyone,  
I am currently in the process of upgrading from Openhab 2 to Openhab 3 and face some issues/questions.

- Platform information:
  - Hardware: Raspi3
  - OS: Openhabian
  - openHAB version: 3

**Read Only Switch**  
I am connected to a service which tells me if there is a weather warning for the region (“DWD Unwetter Warnungen”). The corresponding channel is represented as a switch and I linked it to an Item. The issue now is that I added that status info to the sitemap and I can switch the status manually, which should not be the case - the switch should be read only. I already saw the option to set “Readonly” in the metadata settings for the item but that does not work unfortunately.

My workaround now is that I added mapping info inside the metadata and set up the status as a text element inside the sitemap.

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/c/b/cbed20de7c10570714b555dad2615465673d1b5d.png)

That workaround works for me now… but isn’t there a proper “Read Only” Setting for switches which I overlooked?

Or did I realize already the “best practice” for this issue?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [September 20, 2021, 2:24pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677/2 "2021-09-20T14:24:44Z")

</div>

> [@Rey](#):
>
> The issue now is that I added that status info to the sitemap and I can switch the status manually, which should not be the case - the switch should be read only.

If you have a read only Item of _any_ type, use a Text element to display it on your sitemap.

---

<div class="post-metadata">

**Author:** ![Rey](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@Rey](https://community.openhab.org/u/Rey)\
**Post date:** [September 20, 2021, 3:23pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677/3 "2021-09-20T15:23:40Z")

</div>

> [@rlkoshak](#):
>
> If you have a read only Item of _any_ type, use a Text element to display it on your sitemap.

Ok, but then this means that it will not be visualized as a switch symbol anymore but just as a text with ON / OFF -or as in my case- with the mapped values. Is that right?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [September 20, 2021, 3:37pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677/4 "2021-09-20T15:37:16Z")

</div>

Correct, but in sitemaps the toggle will _always_ be interactive. There isn’t such a thing as a read only Switch element on the sitemap.

---

<div class="post-metadata">

**Author:** ![Rey](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@Rey](https://community.openhab.org/u/Rey)\
**Post date:** [September 20, 2021, 3:40pm UTC](https://community.openhab.org/t/read-only-switch-does-not-work-workaround-realized-please-check-if-this-is-the-proper-way/126677/5 "2021-09-20T15:40:55Z")

</div>

Ok, thank you for your fast feedback!
