# \[SOLVED\] Grafana issue

**URL:** <https://community.openhab.org/t/solved-grafana-issue/92619>\
**Category:** Items & Sitemaps\
**Created:** [February 11, 2020, 9:47pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619 "2020-02-11T21:47:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max77](https://community.openhab.org/user_avatar/community.openhab.org/max77/32/36631_2.png) [@Max77](https://community.openhab.org/u/Max77)\
**Post date:** [February 11, 2020, 9:47pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/1 "2020-02-11T21:47:08Z")

</div>

Hi,

I followed [this guide](https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761) and I have configured influxdb + Grafana. Creating and manipulating a chart containing sensors temperature through Grafana server (openhab:3000) was as easy as it could be 😀

In the next step I have tried to include a graph in my sitemap, example taken [here](https://community.openhab.org/t/topic/13761/69).

```csv
       Text item=Charts icon="calendar"{
            Webview url="http://MYIP:3000/static/chartsDay.html" height=33 
    } 

```

However, the OpenHAB does not open any chart but a blank window with the message

> {message:“Invalid username or password”}

This is the corresponding log

> 2020-02-11 22:44:50.958 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item ‘Charts’ for widget org.eclipse.smarthome.model.sitemap.sitemap.  
> 2020-02-11 22:44:50.960 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item ‘Charts’ for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:50.964 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:50.966 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:51.842 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:52.013 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item ‘Charts’ for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:52.019 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item ‘Charts’ for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:52.025 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text  
> 2020-02-11 22:44:52.030 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.sitemap.Text

Please note I have enabled the anonymous access in /etc/grafana/grafana.ini

> #################################### Anonymous Auth ######################  
> [auth.anonymous]  
> enabled = true

Anything obvious I might have missed?

Thanks  
Max

---

<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:** [February 11, 2020, 11:20pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/2 "2020-02-11T23:20:50Z")

</div>

I think Grafana also has a setting to allow embedding charts in other websites that needs to be set. I don’t embed directly so can’t say what it is but this should give you enough to search on.

---

<div class="post-metadata">

**Author:** ![jswim788](https://community.openhab.org/user_avatar/community.openhab.org/jswim788/32/36341_2.png) [@jswim788](https://community.openhab.org/u/jswim788)\
**Post date:** [February 12, 2020, 12:25am UTC](https://community.openhab.org/t/solved-grafana-issue/92619/3 "2020-02-12T00:25:13Z")

</div>

The embedding is mentioned in this [post](https://community.openhab.org/t/openhab2-grafana-habdroid-webview/35214/26), but it looks like there may be other issues based on the log above.

```auto
[security]
allow_embedding=true

```

That’s in /etc/grafana/grafana.ini, and grafana will need to be restarted after the change is made.

---

<div class="post-metadata">

**Author:** ![pahansen](https://community.openhab.org/user_avatar/community.openhab.org/pahansen/32/4938_2.png) [@pahansen](https://community.openhab.org/u/pahansen)\
**Post date:** [February 12, 2020, 3:59am UTC](https://community.openhab.org/t/solved-grafana-issue/92619/4 "2020-02-12T03:59:00Z")

</div>

As mentioned, make sure you’ve restarted Grafana after the ini updates.

Also, the logs appear to show that you don’t have an appropriate item called “Charts” in your items file which makes me wonder if you might have an issue in the sitemap file.

Have you tried using the webview with just `Webview url="/static/chartsDay.html"` part called out like in the example?

---

<div class="post-metadata">

**Author:** ![Max77](https://community.openhab.org/user_avatar/community.openhab.org/max77/32/36631_2.png) [@Max77](https://community.openhab.org/u/Max77)\
**Post date:** [February 12, 2020, 6:23pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/5 "2020-02-12T18:23:07Z")

</div>

What a helpful community 🙂

Some steps done

- all settings adjusted, full (windows-style 😉) system restart

- sitemap reduced to

```csv
sitemap home label="Home" {
    Frame {
            Webview url="http://192.168.178.56:3000/static/chartsDay.html" height=33 
          }
}

```

Now grafana is loaded - I see the “sun” spinning and jumping around while loading the page, then a nice version of the classic “404 Page not found” appears 🤣 - see below.

The log does not show any error anymore  
Max

 ![error404](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/1/d/1d40c3d603c6d2054ab6a62d63ec46d197e5227c.jpeg)

---

<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:** [February 12, 2020, 6:31pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/6 "2020-02-12T18:31:57Z")

</div>

Wait, that URL doesn’t make sense. If you are following [Paul’s approach](https://community.openhab.org/t/topic/13761/69) you need to create `chartsDay.html` and put that in `$OH_CONF/html/chartsDay.html`. That HTML file has the links to your Grafana charts. On your sitemap you put

`http://<IP of your OH instance>:8080/static/chartsDay.html`

I highly recommend returning to Paul’s post and reread how it is supposed to work.

---

<div class="post-metadata">

**Author:** ![pahansen](https://community.openhab.org/user_avatar/community.openhab.org/pahansen/32/4938_2.png) [@pahansen](https://community.openhab.org/u/pahansen)\
**Post date:** [February 12, 2020, 6:53pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/7 "2020-02-12T18:53:46Z")

</div>

What is in your chartsDay.html file?

---

<div class="post-metadata">

**Author:** ![Max77](https://community.openhab.org/user_avatar/community.openhab.org/max77/32/36631_2.png) [@Max77](https://community.openhab.org/u/Max77)\
**Post date:** [February 12, 2020, 7:01pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/8 "2020-02-12T19:01:46Z")

</div>

> [@rlkoshak](#):
>
> On your sitemap you put
> 
> `http://<IP of your OH instance>:8080/static/chartsDay.html`
> 
> I highly recommend returning to Paul’s post and reread how it is supposed to work.

Fair point, I misunderstood the snipped needed for the Android workaround

> `Webview url="http://YOURIP:YOURPORT/static/chartsHour.html" height=33 visibility=[weatherChartPeriod=="0"]`

It is now solved when

- I put the right port in the sitemap
- I use in both the html and in the sitemap the FQN of the OH server (openhab).

Thanks all, I have learned something more!  
Max

---

<div class="post-metadata">

**Author:** ![Max77](https://community.openhab.org/user_avatar/community.openhab.org/max77/32/36631_2.png) [@Max77](https://community.openhab.org/u/Max77)\
**Post date:** [February 12, 2020, 10:33pm UTC](https://community.openhab.org/t/solved-grafana-issue/92619/9 "2020-02-12T22:33:45Z")

</div>

Next step - try to reproduce what @pahansen did in his original post.

Now sitemap contains

```csv
    Frame {
    Text item=Charts icon="calendar"{
        Switch item=weatherChartPeriod label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
        Webview url="http://openhab:8080/static/chartsHour.html" height=33 visibility=[weatherChartPeriod=="0"]
        Webview url="http://openhab:8080/static/chartsDay.html" height=33 visibility=[weatherChartPeriod=="1"]
        Webview url="http://openhab:8080/static/chartsWeek.html" height=33 visibility=[weatherChartPeriod=="2"]
        }
    }

```

with chart.items simply (I might have missed something here, but I could not find any hint in the original post)

```csv
Switch weatherChartPeriod "Chart Period"
String Charts "Charts"

```

All files are loaded w/o issues, but when I try to access the charts the log shows

```
2020-02-12 23:26:22.951 [WARN] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/weatherChartPeriod' with an invalid status value '1'.

```

with the ‘1’ actually being ‘0’, ‘1’ or ‘2’ according to the clicked mapping.

Be kind with me, I am not a Web frontend expert 😉

Thanks  
Max

---

<div class="post-metadata">

**Author:** ![mpampinos](https://community.openhab.org/user_avatar/community.openhab.org/mpampinos/32/72786_2.png) [@mpampinos](https://community.openhab.org/u/mpampinos)\
**Post date:** [February 13, 2020, 6:00am UTC](https://community.openhab.org/t/solved-grafana-issue/92619/10 "2020-02-13T06:00:35Z")

</div>

> [@Max77](#):
>
> Switch weatherChartPeriod “Chart Period”

```csv
String weatherChartPeriod "Chart Period"

```
