This is OH3 with the main UI.
I have a map page with markers representing temperature sensors. My goal is to be able to click on one and get a popup showing the temperature over the last 24 hours, and I have a working solution as you can see here:
I’ve done this by creating a chart page using this code:
config:
label: Temperature
period: D
slots:
grid:
- component: oh-chart-grid
config: {}
xAxis:
- component: oh-time-axis
config:
gridIndex: 0
yAxis:
- component: oh-value-axis
config:
gridIndex: 0
scale: true
series:
- component: oh-time-series
config:
name: Temperature
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: line
item: DeckTemperatureSensor_Temperature
And then in the map page, configuring the marker to open it as a popup, like so:
- component: oh-plan-marker
config:
name: Deck Temperature
coords: 1641.4678410014806,712.534271817363
icon: oh:temperaturef
iconUseState: true
tooltipPermanent: true
item: DeckTemperatureSensor_Temperature
action: popup
actionModal: page:page_150f35cb60
slots:
default: []
The catch here is that this requires me to create a chart page for every marker, which is kind of a pain. So I have two questions:
- Am I going about this the right way? If not, then what’s a better approach?
- Assuming this is the right approach, can I/how do I configure the things such that I can use the same chart page for each marker (passing the marker item name to the underlying page in the popup)? It seems like this should be possible, but I’ve not been able to figure out a syntax for it. Possibly because I’ve missed an example somewhere in the documentation or forums.