Prototype of the first automation stull ugly

This commit is contained in:
Valère Plantevin
2026-05-12 14:00:12 -04:00
parent 20d59ed0ba
commit 7f54aea439
9 changed files with 152 additions and 4 deletions

View File

@@ -267,6 +267,48 @@
"legendFormat": "{{type}} {{direction}}"
}
]
},
{
"id": 11,
"title": "Machine State (Relay)",
"type": "stat",
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 8 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"mappings": [
{
"options": { "0": { "color": "green", "index": 0, "text": "RUNNING" } },
"type": "value"
},
{
"options": { "1": { "color": "red", "index": 1, "text": "STOPPED" } },
"type": "value"
}
]
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"relay\", stat=\"max\"}",
"refId": "A"
}
]
},
{
"id": 12,
"title": "Manual Control",
"type": "text",
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 16 },
"options": {
"mode": "html",
"content": "<div style=\"text-align: center; margin-top: 20px;\">\n <button onclick=\"fetch('http://localhost:9002/trigger', {method: 'POST'})\" style=\"padding: 15px 30px; font-size: 20px; background: #e24d42; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; width: 100%;\">\n 🚨 TRIGGER PRESENCE\n </button>\n</div>"
}
}
]
}