Comments (1)
Hi,
This may help: https://community.jeedom.com/t/fonction-archive-de-la-class-history/75979
I personally use this code in a scenario:
$totI = 0;
$totKey = 0;
$totCmd = 0;
$histoCmds = cmd::allHistoryCmd();
foreach ($histoCmds as $histoCmd) {
if ($histoCmd->getConfiguration('historizeMode') == 'none' &&
($histoCmd->getConfiguration('repeatEventManagement') == 'never'
|| $histoCmd->getConfiguration('repeatEventManagement') == 'auto')) {
$totCmd++;
$scenario->setLog($histoCmd->getId() . ' ---> ' . $histoCmd->getHumanName());
$historys = history::all($histoCmd->getId());
$i = 0;
$key = 0;
foreach ($historys as $key => $history) {
if ($key == 0)
continue;
if ($history->getValue() === $historys[$key-1]->getValue()
&& substr($history->getDatetime(), 0, 10) === substr($historys[$key-1]->getDatetime(), 0, 10)) {
//$history->remove(); // *** Uncomment me to DELETE FOR REAL ***
$i++;
}
}
$scenario->setLog("Nb d'enregistrements effacés $i, sur $key précédement");
$totI = $totI + $i;
$totKey = $totKey + $key;
}
}
$scenario->setLog("-------------------------------------------------------------------");
$scenario->setLog("Nb d'enregistrements effacés $totI, sur $totKey précédement");
$scenario->setLog("Nb de commandes historisées : $totCmd");
Bad
from core.
Related Issues (20)
- [BUG] On log page and small screen width no button (like delete log) are display
- [FEAT] Improve action bouton on log page with small screen
- [BUG] PHP8 curl is_resource et curl_close HOT 2
- [BUG] PHP8 trim null parameter HOT 1
- [FEAT] Review ban system
- [BUG] Order of message in message center not by date
- [FEAT] Improve configuration page of history
- [BUG] Size calculation of plugin can take too much time and slow down Jeedom
- [BUG] Review fetch pdo when it's insert/update/delete
- [BUG] Missing index on interactQuery
- [BUG] In php8 issue with cronExpression lib does not handle year anymore HOT 8
- [BUG] Issue with table sorter
- [BUG] Jeeasy not found on first install
- [BUG] Issue with fail2ban status
- [FEAT] Add option to disallow some api request
- [FEAT] Allow add extra parameters by plugins on eqLogic
- [BUG] Issue with backup cloud if backup is not in standard dir HOT 1
- [BUG] Issue with update page when there is filters
- [FEAT] Improve cron check system (merge all function)
- [BUG] Remove fail2ban check
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.