Bonjour @Salvialf, @Almy
Je reprends l’ancienne discussion sur l’ancien forum
https://forum.jeedom.com/viewtopic.php?t=45217
Du coup je recherche ou faire un widget pour afficher mon ph, redox et sel de la piscine.
J’avais trouvé ce code là, mais qui ne semble pas fonctionner en jeedom V4 (rien ne s’affiche)
Du coup sinon quelles autres alternatives d’après vous.
<div style="width:300px;min-height : 100px;" class="cmd #history# tooltips cmd-widget conso#id#" data-type="info" data-subtype="numeric" data-cmd_id="#id#" data-cmd_uid="#uid#">
<div class="gauge-element" id="pressureGauge" style="height: 100px; max-width: 300px; margin: 0 auto"></div>
<script src='/plugins/widget/core/template/dashboard/cmd.info.numeric.PhPiscine/dx.all.js'></script>
<script>
jeedom.cmd.update['#id#'] = function(_options){
$("#pressureGauge").dxLinearGauge({
title: {
text: "Pression filtration",
font: {
size: 26,
color: '#61B872'
}
},
geometry: { orientation: "horizontal" },
scale: {
label: {
format: {
type: "fixedPoint",
precision: 1
},
indentFromTick: 15
},
startValue: 0, endValue: 250,
tick: {
color: 'white',
length: 15
},
customTicks: [50, 100,150,200]
},
rangeContainer: {
offset: 0,
width: 15,
ranges: [
{ startValue: 0, endValue: 50, color: "red" },
{ startValue: 50, endValue: 100, color: "orange" },
{ startValue: 100, endValue: 150, color: "green" },
{ startValue: 150, endValue: 200, color: "orange" },
{ startValue: 200, endValue: 250, color: "red" }
]
},
valueIndicator: {
type: "textcloud",
color: "#61B872",
text: {
format: {
precision: 1
}
}
},
value : _options.display_value
}).dxLinearGauge("instance");
$('.cmd[data-cmd_uid=#uid#]').attr('title','Valeur du '+_options.valueDate+', collectée le '+_options.collectDate)
}
jeedom.cmd.update['#id#']({display_value:'#state#',valueDate:'#valueDate#',collectDate:'#collectDate#',alertLevel:'#alertLevel#'});
</script>
</div>
J’ai modifié la ligne du script par
<script src='/data/customTemplates/dashboard/cmd.info.numeric.PhPiscine/dx.all.js'></script>