You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($sensor['sensor_class'] == 'state' && $sensor['sensor_current'] != $sensor_value) {
191
-
log_event($class . ' sensor has changed from ' . $sensor['sensor_current'] . ' to ' . $sensor_value, $device, $class, 3, $sensor['sensor_id']);
192
+
if ($sensor['sensor_class'] == 'state' && $prev_sensor_value != $sensor_value) {
193
+
$trans = array_column(
194
+
dbFetchRows(
195
+
"SELECT `state_translations`.`state_value`, `state_translations`.`state_descr` FROM `sensors_to_state_indexes` LEFT JOIN `state_translations` USING (`state_index_id`) WHERE `sensors_to_state_indexes`.`sensor_id`=? AND `state_translations`.`state_value` IN ($sensor_value,$prev_sensor_value)",
196
+
array($sensor['sensor_id'])
197
+
),
198
+
'state_descr',
199
+
'state_value'
200
+
);
201
+
202
+
log_event("$class sensor has changed from {$trans[$prev_sensor_value]} ($prev_sensor_value) to {$trans[$sensor_value]} ($sensor_value)", $device, $class, 3, $sensor['sensor_id']);
0 commit comments