Last notification sensor not saving in HA due to emojis
See original GitHub issueHome Assistant Android version: 3.0.2-full
Android version: 10
Phone model: Moto One Vision
Home Assistant version: 0.118.0
Last working Home Assistant release (if known):
Description of problem: I just received a push notification from a sudoku game and it seems like emojis in the notification message are added to the state which is not supported by the HA database schema.
Traceback (if applicable):
Error in database connectivity during commit: (MySQLdb._exceptions.OperationalError)
(1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\x89' for column `hassio`.`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.visionist_last_notification', 'Be the first one in the world to solve today’s new puzzle🎉', '{"android.appInfo": "ApplicationInfo{de8a77b sudoku.puzzle.free.game.brain}", "android.infoText": "null", "android.largeIcon": "Icon(typ=BITMAP size= ... (627 characters truncated) ... ficationCompat$BigPictureStyle", "package": "sudoku.puzzle.free.game.brain", "friendly_name": "visionist Last Notification", "icon": "mdi:bell-ring"}', 218697670, datetime.datetime(2020, 11, 19, 3, 22, 11, 674862, tzinfo=datetime.timezone.utc), datetime.datetime(2020, 11, 19, 3, 22, 11, 674862, tzinfo=datetime.timezone.utc), datetime.datetime(2020, 11, 19, 3, 22, 11, 674862, tzinfo=datetime.timezone.utc), 208339691)]
(Background on this error at: http://sqlalche.me/e/13/e3q8). (retrying in 3 seconds)
Screenshot of problem:
Additional information:
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Recorder error when an emoji is present in data #44037
Home Assistant Core release with the issue: 1.0b2; Last working Home Assistant ... Last notification sensor not saving in HA due to emojis...
Read more >emojis not not showing up in notification shade after factory ...
I factory reset my OP6 after android 10 upgrade, and now suddenly all the emojis are showing as unknown characters in my notification...
Read more >Sensors | Home Assistant Companion Docs
In App Configuration, open the server's settings and change Sensors Sent setting under Privacy. Options available: All sends all enabled ...
Read more >About iOS 15 Updates - Apple Support (IN)
Notifications have been redesigned and a new notification summary ... This update also includes new emoji, a new voice option for Siri, ...
Read more >No recent emoji [Not a SwiftKey bug]
The recently used emoji section is blank / they do not save. ... SwiftKey's recent emojis are not accessed by a button.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I have been way too busy to try this out over the past few weeks. I ended up disabling the sensor but will give it another shot when I get a chance.
The recorder docs have now been updated and a new fix will be in the next HA core release. Going to close this now. You may need to recreate the DB for the fix to get applied on existing installs:
https://discord.com/channels/330944238910963714/427516175237382144/785627526512508958
If you still have an issue after updating the recorder statement and HA core then we can revisit although it may ultimately be a core issue.
This may also help: https://github.com/home-assistant/core/issues/44037#issuecomment-740216825