Broadlink RM4C mini no longer working - trailing comma error

I had my broadlink remote set up with different commands and everything was working fine until recently. Not sure how long ago it stopped working because sometimes I don’t use any commands for 2 months. I get this error when I try to use any remote service call in dev tools

“Failed to call service remote.delete_command. trailing comma is not allowed: line 12 column 6 (char 783)”

I tried removing the comma but then I get an error for a different comma and then another and so on. I then read somewhere not to mess with the file so I returned it to how it was. I tried removing the device and re adding but the .storage file with the remote codes remained so it just gives the same errors. Is there a way to start again or an obvious fix to the code?

Here is my code at /config/.storage/broadlink_remote_<*********>_codes:

{
  "version": 1,
  "minor_version": 1,
  "key": "broadlink_remote_*********_codes",
  "data": {
    "Living Room TV": {
      "PS5": "JgBQAAABIZATERMSEhISExETEhISEhMREzYSNxI2EzYSNxI2EzYRNxI3EjYSNhMSEzYSEhITERMSEhISExETNhITETcSOBE2EgAE8QABIUkTAA0F",
      "Xbox 360": "JgBMABETEhMREhMRExITERMSERMSNhM2EzYSNhI3ETYTNhM2EhMRNxISExETNhISEhITEhI2EhMSNhM2EhISNhM2EzYRAATxAAEhSRMADQU=",
      "Chromecast": "JgBQAAABIZATEhISExETEhISEhMSERMSEjcSNhI2EzYSNxI2EzYSNhM2EhITEhE3EjYTEhM2EhETEhI3EjYSEhMREzYTEhE3EgAE8QABI0cSAA0F",
      "Cameras": "JgBIAAABIpASEhMRExITERITERITEhISEzYSNxI2EjcRNxI2EzYSNxISEhITERM2EhMREhMSEhITNhI3EjYSEhM2EjYTNhI3EQANBQ==",
      "Xbox_360": "JgBQAAABIZESEhISExETEhISExISEhITETYTNhM2EjYTNhM2EjYSNxISEjcSERMSEzYSEhITERMSNhMREzYSNhMSEjcSNhI2EwAE8AABIkkTAA0F",
    },
    "Bedroom TV": {
      "Cameras": "JgBYAAQAC00GAAIqAAEikBISExETEhISExIRExITERITNhM2EjYSNxI2EjYTNhM2EjYTNhISEhMSERMSEhITEhISEhMRNhM2EzYSNhM2EzYSAATwAAEiSRIADQU=",
      "Chromecast": "JgBQAAABIZESEhMREhMSEhISExETEhISEjcSNhM2EjYTNhM2ETcSNxI2EhMSNhMRExIRExITERITEhI2EhMSNhM2EjcRNxI2EwAE8QABIkgSAA0F",
      "Xbox 360": "JgBMABISEhITEhISExESExISEhITNhI3ETcSNxI2EjYTNhM2EhMRNxI2EhMSEhISExETEhI3ERMSEhI2EzYSNhM2EzYSAATyAAEhSBMADQU=",
      "PS5": "JgBgAAABIpASExISEhISEhMSEhITERMSEjYTNhI3ETcSNhM2EjYTNhMSEjYSNhM2EzYSEhI3EhITNhIRExISEhMSEjcRExI2EwAE8AABIkkSAAwEAAEiSREADAQAASNJEQANBQ==",
      "Xbox_360": "JgBQAAABIZATEhISExETEhISEhMSERMSEjcSNhI2EzYTNhI2EzYTNhETEjYTNhISEhMSEhISEhITNhISEhMSNhM2EjcRNhM2EwAE8AABIkkSAA0F"
    }
  }
}

Remove the comma after each last element of each JSON dictionary (i.e. every last command). You have a trailing comma after the living room’s Xbox.

What was the last thing you changed?

Yes.

I removed the comma, then I get the error about the comma at the end of the line above. Removed that, now I get:

Failed to call service remote.send_command. unexpected character: line 13 column 5 (char 787)

I initially set up the device and commands immediately after and haven’t made any changes since. Just noticed it doesn’t work anymore and I get errors now when I go to use it. Only things that would have changed are HA updates over the last few months.

It’s that comma Pieter was talking about. Did you get him right?

1 Like

Ok it’s working now…I don’t think anything was wrong at all, which makes sense because nothing was altered since initial setup. I have set up HA widgets on my phone home screen that run a simple script which is just the remote command. When I tap on the widget I get a message pop up “Unable to send service call”. From there I went into dev tools to test and started getting the error messages. Turns out the device ID and command fields are case sensitive and must be typed exactly as in the remote codes file. So I have the service calls working with dev tools, and my original scripts work, just not my widgets. Maybe a problem with permissions or something on my phone? I will look into this further - unless someone knows the answer there? Nonetheless thank you all for the time taken to look into my issue and respond.