REPLACE does not update an existing record; it simply deletes any old record, and then inserts a new one.
You have to do the UPDATE or INSERT by hand:
CREATE TRIGGER ...
BEGIN
-- update the old record, if it already exists:
UPDATE hour_data
SET cou = (SELECT AVG(cou) * 6 ...),
max = (SELECT MAX(max) ...),
...
WHERE ic = NEW.ic
AND dt = strftime('%Y-%m-%d %H:00:00', NEW.dt);
-- insert the new record,
INSERT INTO hour_data(...)
SELECT ...
WHERE ...
-- if it does not yet exist:
AND NOT EXISTS (SELECT 1
FROM hour_data
WHERE ic = NEW.ic
AND dt = strftime('%Y-%m-%d %H:00:00', NEW.dt));
END;