upsert / lutron-caseta-pro

Custom Home Assistant Component for Lutron Caseta Smart Bridge PRO / RA2 Select
Apache License 2.0
184 stars 37 forks source link

Getting failed to call service error when trying to configure component. #71

Closed ghurty closed 2 years ago

ghurty commented 3 years ago

I am trying to configure the component. When I paste my integration report I get the following error: failed to call service configurator/configure expected value line 1 column 1 (char 0).

Any suggestions?

Thank you

upsert commented 3 years ago

Possible copy/paste issue?

I have gone back and reconfigured the component on the latest Home Assistant 2020.12.1 and confirmed it is still working as expected with the configurator.

tjfoth commented 3 years ago

I am getting the same problem with the same release that you tested with.

tjfoth commented 3 years ago

I just found the problem: At least in the case of the IOS Lutron app, it indents the JSON file with causes errors with Python's JSON parser. If you remove the leading spaces, it parses fine.

cajuncoding commented 3 years ago

Are you sending it to yourself via email and copying it after you receive the email, or are you copying it from the App UI?

I've not updated recently but I've never had any issues using the real email I receive.

tjfoth commented 3 years ago

Because I don't use IOS Mail, I let it compose the mail, copied the integration report out of the composed email before it was sent, pasted it into Gmail, and sent it. I received it in the browser version of Gmail (Google Chrome on MacOSX) and tried pasting it into the prompt.


Tom Foth tom@fothmail.com tom@foth.me

On Tue, Dec 29, 2020 at 8:29 PM Brandon notifications@github.com wrote:

Are you sending it to yourself via email and copying it after you receive the email, or are you copying it from the App UI?

I've not updated recently but I've never had any issues using the real email I receive.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/upsert/lutron-caseta-pro/issues/71#issuecomment-752296028, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOIIO3JDOFIL6OVPONKELDSXJ675ANCNFSM4UTYPATA .

cajuncoding commented 3 years ago

In case it's helpful, I do no use Apple (iOS) mail either, only Gmail but it is configured on my iPhone. So the Lutron app uses the default mail provider it seems because the sent mail from the Lutron app appears in my sent folder of Gmail, and in my inbox because I sent it to myself.

Try copy/pasting into Notepad (if you use Windows) or Notepad++ which can help show any invalid characters...another option might be to run it through an online JSON formatter first to sanitize it...

tjfoth commented 3 years ago

I used Atom to remove the leading spaces and I'm good.

And my bad for not saying thank you for writing this code and making it available. It is awesome.

Tom


Tom Foth tom@fothmail.com tom@foth.me

On Tue, Dec 29, 2020 at 8:56 PM Brandon notifications@github.com wrote:

In case it's helpful, I do no use Apple (iOS) mail either, only Gmail but it is configured on my iPhone. So the Lutron app uses the default mail provider it seems because the sent mail from the Lutron app appears in my sent folder of Gmail, and in my inbox because I sent it to myself.

Try copy/pasting into Notepad (if you use Windows) or Notepad++ which can help show any invalid characters...another option might be to run it through an online JSON formatted first to sanitize it...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/upsert/lutron-caseta-pro/issues/71#issuecomment-752299874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOIIOYHKQLLNJXA4RX64QTSXKCDFANCNFSM4UTYPATA .

upsert commented 3 years ago

Are the leading spaces before the first opening bracket of the JSON or are they inside individual values? A trim command could be added that would remove leading and trailing whitespace from the content entered in the configurator dialog.

tjfoth commented 3 years ago

It was before the brackets inside of the main bracket.

Much like python indenting.


Tom Foth tom@fothmail.com tom@foth.me

On Sun, Jan 3, 2021 at 12:32 PM upsert notifications@github.com wrote:

Are the leading spaces before the first opening bracket of the JSON or are they inside individual values? A trim command could be added that would remove leading and trailing whitespace from the content entered in the configurator dialog.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/upsert/lutron-caseta-pro/issues/71#issuecomment-753650359, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOIIO2U3C5JA2EQV475WS3SYCS4DANCNFSM4UTYPATA .