Since when I enabled “last notification” sensor on (wonderful) Home Assistant app for Android, I keep receiving errors in the log, like the following one:
Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:526
Integration: Recorder (documentation, issues)
First occurred: 3:00:58 PM (9 occurrences)
Last logged: 3:48:44 PM
Error executing query: (MySQLdb._exceptions.OperationalError) (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xB7 F...' for column `homeassistant`.`states`.`state` at row 1") [SQL: INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, old_state_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('sensor', 'sensor.moto_g_8_plus_ultima_notifica', '?? Foto', '{"android.appInfo": "ApplicationInfo{d1ea52 com.whatsapp}", "android.infoText": "null", "android.largeIcon": "null", "android.people.list": "[android ... (370 characters truncated) ... s_ongoing": false, "package": "com.whatsapp", "post_time": 1610460055813, "friendly_name": "moto g(8) plus Ultima notifica", "icon": "mdi:bell-ring"}', 2326651, datetime.datetime(2021, 1, 12, 14, 0, 57, 368083, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 1, 12, 14, 0, 57, 368083, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 1, 12, 14, 0, 57, 368083, tzinfo=datetime.timezone.utc), 2307850)] (Background on this error at: http://sqlalche.me/e/13/e3q8)
I suspect it has something to do with the emoji characters in the states column since I’ve seen the error only when the recorder is saving whatsapp notification with emoji in the message.
Recorder is configured to use a MariaDB on a docker container ver. 10.5.8-MariaDB-1:10.5.8+maria~focal
Server character_set is utf8mb4 and server collation is utf8mb4_general_ci
Honestly I’m not sure if this is the right place to seek for help, but maybe someone can head me there
Thanks!