BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

Warning appeared after enabling new voice assistants integration #96

Closed edwolfe3 closed 3 years ago

edwolfe3 commented 3 years ago

I received the following email:

Voice   Assistants
--
SmartThings   recently released a new version of the SmartThings Alexa1 Skill and   SmartThings Action on Google2, which includes faster response times, support for more   devices, and the ability to control multiple locations.
Enable new voice assistants integrations     by September 8, 2020          UPGRADE | Enable new voice assistants integrations     by September 8, 2020          UPGRADE
Enable new voice assistants integrations     by September 8, 2020          UPGRADE
The   legacy versions of the Alexa Skill or Action on Google you’re currently using   will be going away. Make the switch to ensure your voice integrations   continue to operate as expected.

After that I did the upgrade, I started receiving the following.

2020-09-04 21:11:18.442 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=org/openhab/binding/smartthings/discovery] {data={"data":["{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Bedroom Light\", \"id\": \"a102cce4-ab79-43c7-a6ab-681c8617bc6d\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Brandons Hall\", \"id\": \"bbced381-0d9d-4928-a7ce-5d226a175010\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Dartboard\", \"id\": \"7b0fb3ed-c7e7-47df-a3e2-99b17d161cbb\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Dining Room\", \"id\": \"2013ebc2-8e88-4044-ac22-d9f41cc35bef\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Eds Desk Fan\", \"id\": \"4925908d-5e50-48e3-8cf5-69eeed679d4c\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Eds Desk Lamp\", \"id\": \"091e38ac-a165-44a6-b17b-fc0095ad00c8\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Family Room Fan\", \"id\": \"7c4ca40d-6b28-4a00-bc17-b6774306a58f\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Family Room Light\", \"id\": \"5527f5c0-29cb-4759-b9d1-71a900d32252\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Front Door Light\", \"id\": \"4b1b8b91-413e-4a41-a4fb-cbf1e2af2641\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Garage Back Spotlight\", \"id\": \"918cc554-eea9-4962-a365-65a2521ad74f\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Garage Porch Spotlight\", \"id\": \"8a525fca-3bfb-4e9e-bb84-2c0b1fdaa459\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Guest Room Light\", \"id\": \"252dd684-e44a-4f49-8115-bd2d63b8a715\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Guest Room Television\", \"id\": \"fd15401d-2b5d-4790-a5ba-813fabac0f2d\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"House Spot Light\", \"id\": \"b68f759c-f902-46f8-bdfb-52805047c4dd\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Kitchen Counter\", \"id\": \"2b5eac94-dcc1-4e39-87f9-575669d1e63b\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Kitchen Main\", \"id\": \"b33fa603-2841-4ba8-8731-2526d0b15838\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Kitchen Sink\", \"id\": \"ac6adb15-4651-4eb2-979e-45a76335b804\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Kitchen Table Light\", \"id\": \"5f2dbe7c-12d0-42e4-a206-f55f8ce31156\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Living Room Lamp\", \"id\": \"98ed9afe-9961-4177-ab27-1a63352e7d11\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Outside Amp\", \"id\": \"0fd94d5d-1389-426f-8c75-5d18067959ee\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Over Family Room TV Light\", \"id\": \"7d2214b7-8d9e-4ede-bbf5-b12d45c93472\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Shuffleboard Ceiling Light\", \"id\": \"756d1d3b-4e68-4b9e-82b6-95841368b600\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Snack Bar Light\", \"id\": \"b4947a65-0976-4ed1-bc32-828962ac7ea3\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Theater Ceiling Light\", \"id\": \"e7f3879c-8ec2-4b25-84db-a85aa72fe642\" }","{\"capability\": \"switch\", \"attribute\": \"switch\", \"name\": \"Laundry Exhaust Fan\", \"id\": \"7188b5cb-3046-44e3-92a9-50b0de45c870\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Brandons Hall\", \"id\": \"bbced381-0d9d-4928-a7ce-5d226a175010\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Dining Room\", \"id\": \"2013ebc2-8e88-4044-ac22-d9f41cc35bef\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Eds Desk Fan\", \"id\": \"4925908d-5e50-48e3-8cf5-69eeed679d4c\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Eds Desk Lamp\", \"id\": \"091e38ac-a165-44a6-b17b-fc0095ad00c8\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Family Room Fan\", \"id\": \"7c4ca40d-6b28-4a00-bc17-b6774306a58f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Family Room Light\", \"id\": \"5527f5c0-29cb-4759-b9d1-71a900d32252\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Garage Back Spotlight\", \"id\": \"918cc554-eea9-4962-a365-65a2521ad74f\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Garage Porch Spotlight\", \"id\": \"8a525fca-3bfb-4e9e-bb84-2c0b1fdaa459\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Kitchen Counter\", \"id\": \"2b5eac94-dcc1-4e39-87f9-575669d1e63b\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Kitchen Main\", \"id\": \"b33fa603-2841-4ba8-8731-2526d0b15838\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Kitchen Table Light\", \"id\": \"5f2dbe7c-12d0-42e4-a206-f55f8ce31156\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Outside Amp\", \"id\": \"0fd94d5d-1389-426f-8c75-5d18067959ee\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Over Family Room TV Light\", \"id\": \"7d2214b7-8d9e-4ede-bbf5-b12d45c93472\" }","{\"capability\": \"switchLevel\", \"attribute\": \"level\", \"name\": \"Snack Bar Light\", \"id\": \"b4947a65-0976-4ed1-bc32-828962ac7ea3\" }"],"hubEndTime":1599268278141,"hubTime":384,"openHabStartTime":null}, timestamp=1599268278439} | {org.eclipse.smarthome.config.discovery.DiscoveryService, org.osgi.service.event.EventHandler}={service.id=339, service.bundleid=203, service.scope=bundle, event.topics=org/openhab/binding/smartthings/discovery, component.name=org.openhab.binding.smartthings.internal.discovery.SmartthingsDiscoveryService, component.id=189} | Bundle(org.openhab.binding.smartthings_2.5.7.202007152128 [203])]

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $

    at com.google.gson.Gson.fromJson(Gson.java:900) ~[?:?]

    at com.google.gson.Gson.fromJson(Gson.java:853) ~[?:?]

    at com.google.gson.Gson.fromJson(Gson.java:802) ~[?:?]

    at com.google.gson.Gson.fromJson(Gson.java:774) ~[?:?]

    at org.openhab.binding.smartthings.internal.discovery.SmartthingsDiscoveryService.handleEvent(SmartthingsDiscoveryService.java:172) ~[?:?]

    at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [bundleFile:?]

    at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [bundleFile:?]

    at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [bundleFile:?]

    at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [bundleFile:?]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_252]

    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $

    at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350) ~[?:?]

    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80) ~[?:?]

    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) ~[?:?]

    at com.google.gson.Gson.fromJson(Gson.java:888) ~[?:?]

    ... 13 more
BobRak commented 3 years ago

Hi:

I'm not using any of the openHAB voice services. What did you do to upgrade the voice services? Did you have to install a new version of openHAB? I'm running 2.5.6-2.

I took the json discovery result from above and pasted it into a json formatter web page and it is valid json.

Please tell me exactly what you did that started the problems. Is the problem consistent? Have you added or changed any devices? Especially have you changed any device names?

When I get more time I'll try to run my openHAB in the debugger and capture a discovery result and will compare that with yours from above.

Bob

edwolfe3 commented 3 years ago

Hi Bob,

The voice services are related to Amazon Echo. It was necessary to upgrade the SmartThings app (per the email) in order for my Alexa commands to continue to work with SmartThings devices. They are not related to Openhab except it started the issue reported.

Nothing changed except for upgrading to the SmartThings voice services as they required me to do.

It seems to happen on average every 10-20 minutes.

Ed

From: Bob Raker notifications@github.com Sent: Sunday, September 6, 2020 4:24 PM To: BobRak/OpenHAB-Smartthings OpenHAB-Smartthings@noreply.github.com Cc: edwolfe3 edwolfe@wolfecomputerservices.com; Author author@noreply.github.com Subject: Re: [BobRak/OpenHAB-Smartthings] Warning appeared after enabling new voice assistants integration (#96)

Hi:

I'm not using any of the openHAB voice services. What did you do to upgrade the voice services? Did you have to install a new version of openHAB? I'm running 2.5.6-2.

I took the json discovery result from above and pasted it into a json formatter web page and it is valid json.

Please tell me exactly what you did that started the problems. Is the problem consistent? Have you added or changed any devices? Especially have you changed any device names?

When I get more time I'll try to run my openHAB in the debugger and capture a discovery result and will compare that with yours from above.

Bob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BobRak/OpenHAB-Smartthings/issues/96#issuecomment-687891848 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRFDT4SHB5DAEEZC76CTR3SEPVVVANCNFSM4QZZXOQQ . https://github.com/notifications/beacon/AJRFDT7BKP7K6SKDLPSPC3TSEPVVVA5CNFSM4QZZXOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFEAGLCA.gif

edwolfe3 commented 3 years ago

When I put the displayed json (after changing all \” to just “) in a json validator (https://jsonlint.com/?code=) I get the following error:

Error: Parse error on line 1:

{ data = { "data": [

--^

Expecting 'STRING', '}', got 'undefined'

From: Bob Raker notifications@github.com Sent: Sunday, September 6, 2020 4:24 PM To: BobRak/OpenHAB-Smartthings OpenHAB-Smartthings@noreply.github.com Cc: edwolfe3 edwolfe@wolfecomputerservices.com; Author author@noreply.github.com Subject: Re: [BobRak/OpenHAB-Smartthings] Warning appeared after enabling new voice assistants integration (#96)

Hi:

I'm not using any of the openHAB voice services. What did you do to upgrade the voice services? Did you have to install a new version of openHAB? I'm running 2.5.6-2.

I took the json discovery result from above and pasted it into a json formatter web page and it is valid json.

Please tell me exactly what you did that started the problems. Is the problem consistent? Have you added or changed any devices? Especially have you changed any device names?

When I get more time I'll try to run my openHAB in the debugger and capture a discovery result and will compare that with yours from above.

Bob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BobRak/OpenHAB-Smartthings/issues/96#issuecomment-687891848 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRFDT4SHB5DAEEZC76CTR3SEPVVVANCNFSM4QZZXOQQ . https://github.com/notifications/beacon/AJRFDT7BKP7K6SKDLPSPC3TSEPVVVA5CNFSM4QZZXOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFEAGLCA.gif

BobRak commented 3 years ago

Ed: That structure is quite complicated. The "data":["{\"capability\":... part of it is a series of strings. First I use the Java GSON class to extract the "data:" as an array of strings and the other data at the end. Then I used GSON again on each element in the array to extract the discovery data. So, you can't just convert the \" to " and expect it to work. A few months ago openHAB was reviewing it for inclusion in the base openhab.. As part of that I removed much of the complication. I'll see if I can get that code and port it into my workspace and recompile. In the meantime can you try just reinstalling the two smartthings files and see if that helps. Bob

edwolfe3 commented 3 years ago

Bob,

I have not seen the JSON error occur since I installed the new module this morning.

Ed