openems icon indicating copy to clipboard operation
openems copied to clipboard

OpenEMS UI: New widgets (Live & History) for Thermometer nature.

Open laupp opened this issue 2 years ago • 4 comments

laupp avatar Mar 09 '23 15:03 laupp

The new Thermometer widget lists all component which fulfills the Thermometer nature. This is not a good practice. E.g. the consolinno temperature hw module supports 16 temperatures. Thus the Thermometer widget would show all 16 temperatures. In most cases only a few temperature sensors are of relevance for showing in the UI. We need to find a way how to configure which temperatures are shown within the UI. For example the Controller IO Fix digital output widget is only shown, if such a controller exists. It doesn't matter how many relays are there. Maybe we could add a very simple ControllerThermometer and show the temperature only if such a controller is active. But the name ControllerThermometer is bad, because there is no Controller functionality. Someone an idea how we can do the selection which temperatures to show and which not to show?

clehne avatar Mar 13 '23 13:03 clehne

The new Thermometer widget lists all component which fulfills the Thermometer nature. This is not a good practice. E.g. the consolinno temperature hw module supports 16 temperatures. Thus the Thermometer widget would show all 16 temperatures. In most cases only a few temperature sensors are of relevance for showing in the UI. We need to find a way how to configure which temperatures are shown within the UI. For example the Controller IO Fix digital output widget is only shown, if such a controller exists. It doesn't matter how many relays are there. Maybe we could add a very simple ControllerThermometer and show the temperature only if such a controller is active. But the name ControllerThermometer is bad, because there is no Controller functionality. Someone an idea how we can do the selection which temperatures to show and which not to show?

@clehne (1) I have been thinking about introducing an Edge Component that holds UI configuration (e.g. "Core.UI"). This component could hold a JSON configuration that is used to parameterize the UI, e.g. which Widgets should be shown, different ording of the widgets on the screen, etc.. Benefit of using an Edge Component is, that there is already a way to transfer the information via EdgeConfig and it would work both with Edge and Backend. Downside is, that there would be only one config per Edge, so it is not directly supported to have multiple configs e.g. per User. Example:

{
   "widgets":[
      {
         "widget":"ThermometerWidget",
         "componentId":"thermometer0",
         "hide":true
      }
   ]
}

(2) Of course, the ControllerThermometer idea is more like the existing architecture and should be followed if possible, because it puts the Temperature value in a context (e.g. in the SingleThresholdController, etc.)

(3) Even another idea we discussed at the Hackathon, was the introduction of a Widget that allows defining an SVG (e.g. via Inkscape) and then inserts the Channel-Values (e.g. Temperature values) in placeholders. This could be done similarly and additiionally to idea (1) above and would also make it possible to put Temperature in context (e.g. visualize an actual floor plan or hot water boiler)

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <path d="M30,1h40l29,29v40l-29,29h-40l-29-29v-40z" stroke="#000" fill="none"/> 
  <path d="M31,3h38l28,28v38l-28,28h-38l-28-28v-38z" fill="#a23"/> 
  <text x="50" y="68" font-size="48" fill="#FFF" text-anchor="middle">{{ thermometer0/Temperature }}</text>
</svg>

(Source is not relevant, just for completeness: https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/410.svg)

(4) Similarly to idea (3), a Config could also parameterize oe-modal-lines

{
   "lines":[
      {
         "title":"My Temperature",
         "channel":"thermometer0/Temperature"
      }
   ]
}

sfeilmeier avatar Mar 14 '23 21:03 sfeilmeier

This PR has been automatically marked as stale due to inactivity. It will be closed in 7 days if no further activity occurs.

github-actions[bot] avatar Sep 20 '25 14:09 github-actions[bot]

@laupp @DerStoecki any update on this branch?

lukasrgr avatar Sep 25 '25 08:09 lukasrgr