Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to add notifications support? #106

Open
quack3d opened this issue Oct 27, 2021 · 36 comments
Open

Possible to add notifications support? #106

quack3d opened this issue Oct 27, 2021 · 36 comments

Comments

@quack3d
Copy link

quack3d commented Oct 27, 2021

Is it possible to add support for notifications so we can display text on our TVs? It seems like it's possible with the SmartThings hub:

https://community.smartthings.com/t/get-notifications-from-smartthings-on-samsung-tv/82528

@ffurious01
Copy link

I second that. It would be really nice to have that feature to show notification some events from connected devices.

@mendoncart
Copy link

It'd be awesome to be able to send notifications to the tv.

@ollo69
Copy link
Owner

ollo69 commented Jan 11, 2022

I don't know how to send notification using API. If someone have this info, I can implement it.

@andrewdolphin
Copy link

Ape/samsungctl#37

@dibyadip-das
Copy link

I am looking forward to it as well.

@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 23, 2022
@quack3d
Copy link
Author

quack3d commented Nov 23, 2022

Beep. Still wanted.

@whittin3
Copy link

Definitely still wanted. Happy to help test

@github-actions github-actions bot removed the Stale label Nov 24, 2022
@rogerveijk
Copy link

I'm also interested in this feature. Found some official samsung documentation, maybe someone can make something of this: https://docs.tizen.org/application/web/guides/messaging/push/

@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 15, 2023
@whittin3
Copy link

This is a wanted feature, still.

@github-actions github-actions bot removed the Stale label Jan 16, 2023
@Mishta
Copy link

Mishta commented Feb 15, 2023

Is someone working on this?
Can I help, as beta tester?

@ollo69
Copy link
Owner

ollo69 commented Feb 15, 2023

I do not found any documentation that explain how to send notification to TV with SmartThings API used by this integration to comunicate with TV. If someone have more information, please share here.

@Mishta
Copy link

Mishta commented Feb 15, 2023

I do not found any documentation that explain how to send notification to TV with SmartThings API used by this integration to comunicate with TV. If someone have more information, please share here.

Thank you ollo69!

It is true!
Sadly, I cannot identify anything in the SmartThings API that could be used for Notifications on TV...

@whittin3
Copy link

whittin3 commented Mar 4, 2023

Might this work if the location id specified is the desired TV you wish to target with the notification?

@ScottRoach
Copy link

Might this work if the location id specified is the desired TV you wish to target with the notification?

This seems to only create notifications for the mobile apps belonging to the location. Docs on the endpoint.

The locationId seems to be the home and the TV is it's own device (deviceId) inside the location (locationId). Specifying a locationId and deviceId or just a deviceId does not work.

@alexpatcas
Copy link

I will literally pay for this.

@emmaly
Copy link

emmaly commented Jun 8, 2023

I will literally pay for this.

If it's a thing, I would very happily pitch in as well for this. Just tell me how, when, and how much.

@torsteinelv
Copy link

Me also. Have tried my self and it should be possible to create a better integration. I just dont understand the crappy documentation on how to develop this.

@torsteinelv
Copy link

There is also samsung smart things that could be added to the tv in its own application that could possibly do these things if someone with knowledge in how to develop an integration for this.

@kamoteshake
Copy link

@ollo69 Im not really familiar with the smart things API but from reading the docs, is it possible to call the executeDeviceCommands and the command would be deviceNotification based on this docs?

@gsportelli
Copy link

gsportelli commented Sep 6, 2023

The TV seems to have some notification functionality, e.g., with the Ring doorbell camera. I've been experimenting with the smartthings CLI and my Q80 series but with no success.
My TV doesn't have the "notification" capability. Maybe somebody else with a newer TV has more luck.
After installing smartthings-cli, I run smartthings devices which outputs this

──────────────────────────────────────────────────────────────────────────────────────────────────────
#  Label                    Name                          Type  Device Id
──────────────────────────────────────────────────────────────────────────────────────────────────────
1  Samsung 7 Series (43)    [TV] Samsung 7 Series (43)    OCF   xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
2  Samsung Q80 Series (55)  [TV] Samsung Q80 Series (55)  OCF   yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
──────────────────────────────────────────────────────────────────────────────────────────────────────

the I run smartthings devices:commands yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy getting

Samsung Q80 Series (55)

Capabilities:
────────────────────────────────────
1   ocf
2   switch
3   audioVolume
4   audioMute
5   tvChannel
6   mediaInputSource
7   mediaPlayback
8   mediaTrackControl
9   custom.error
10  custom.picturemode
11  custom.soundmode
12  custom.accessibility
13  custom.launchapp
14  custom.recording
15  custom.tvsearch
16  custom.disabledCapabilities
17  samsungvd.remoteControl
18  samsungvd.ambient
19  samsungvd.ambientContent
20  samsungvd.ambient18
21  samsungvd.mediaInputSource
22  refresh
23  execute
24  samsungvd.firmwareVersion
25  samsungvd.supportsPowerOnByOcf
26  sec.diagnosticsInformation
────────────────────────────────────

the script then asks for which command to execute. Nothing seemed to be relevant.

@kamoteshake
Copy link

kamoteshake commented Sep 7, 2023

@gsportelli That's interesting. So it seems like you need to run the execute command which you can then use the notification command from this doc.

smartthings devices:commands <device uuid>

That should output a list of commands you can run then it will ask you which command you want to run. With your TV, the execute command is 23

It will then ask you to enter a command to execute

execute("deviceNotification", {"notification": "Test Notification"})

deviceNotification - that is the command that you want to run.
{"notification": "Test Notification"} - is the argument for that command. Again, based on the docs, notification is the argument and it accepts a string, which in the example above is "Test Notification"

I just tried it but I was getting a 500 error. 🤷🏼‍♂️
image

@torsteinelv
Copy link

torsteinelv commented Sep 7, 2023 via email

@gsportelli
Copy link

@gsportelli That's interesting. So it seems like you need to run the execute command which you can then use the notification command from this doc.

smartthings devices:commands <device uuid>

That should output a list of commands you can run then it will ask you which command you want to run. With your TV, the execute command is 23

It will then ask you to enter a command to execute

execute("deviceNotification", {"notification": "Test Notification"})

deviceNotification - that is the command that you want to run. {"notification": "Test Notification"} - is the argument for that command. Again, based on the docs, notification is the argument and it accepts a string, which in the example above is "Test Notification"

I just tried it but I was getting a 500 error. 🤷🏼‍♂️ image

I did the same, tried all possible combinations of notification and deviceNotification, nothing worked.

@kamoteshake
Copy link

@gsportelli were you getting any errors?

@gsportelli
Copy link

smartthings devices:commands <device-id> 'execute:execute("command")'
returns Command executed successfully whatever I write as command, e.g.,

$ smartthings devices:commands yyyyyyyy-... 'execute:execute("deviceNotification")'
> Command executed successfully

$ smartthings devices:commands yyyyyyyy-... 'execute:execute("iamNotACommand")'
> Command executed successfully

Instead, if I add an argument, whatever the argument is, it fails as follows

$ smartthings devices:commands yyyyyyyy-... 'execute:execute("deviceNotification", {"notification": "Test notification"})'
AxiosError: Request failed with status code 500:
{"requestId":"...","error":{"code":"UnexpectedError","message":"unsuccessful-http-call status=500","details":[]}}
Code: ERR_BAD_RESPONSE

If I use a non JSON argument, I get another error:

$ smartthings devices:commands yyyyyyyy-... 'execute:execute("deviceNotification", "Test notification")'
AxiosError: Request failed with status code 422:
{"requestId":"...","error":{"code":"ConstraintViolationError","message":"The request is
malformed.","details":[{"code":"UnprocessableEntityError","target":"commands[0].arguments[1]","message":"commands[
0].arguments[1]: string found, object expected","details":[]}]}}
Code: ERR_BAD_REQUEST

@mendoncart
Copy link

arguments[1]: string found, object expected","details":[]

It seems it needs you to pass an object on the argument 1.

Maybe try something like:
$ smartthings devices:commands yyyyyyyy-... 'execute:execute("deviceNotification", {"notification": ["Test notification"]})'

It's expecting something to be wrapped in [ ].

@gsportelli
Copy link

Same error:

$ smartthings devices:commands yyyyyyyy-... 'execute:execute("deviceNotification", {"notification": ["Test notification"]})'
AxiosError: Request failed with status code 500:
{"requestId":"...","error":{"code":"UnexpectedError","message":"unsuccessful-http-call status=500","details":[]}}
Code: ERR_BAD_RESPONSE

@mendoncart
Copy link

This looks like a syntax error.
The object probably is expecting a string, n image, and/or button text/style.
What the documentation says about it?

@mendoncart
Copy link

Here is the full json in the docs

{ "name": "Notification", "status": "live", "attributes": { }, "commands": { "deviceNotification": { "arguments": [ { "name": "notification", "schema": { "title": "String", "type": "string", "maxLength": 255 }, "optional": false } ], "name": "deviceNotification" } }, "id": "notification", "version": 1 }

So, after deviceNotification, you should pass the arguments: name, schema, ant others.

That's why the command is failing.

@kamoteshake
Copy link

kamoteshake commented Sep 8, 2023

@mendoncart I think that's just the JSON to build the docs. So it's just saying that the command deviceNotification has a required argument called notification and the type of it is a string

I was able to switch my tv on/off using the smartthing CLI. so I have a feeling that we're using execute in a wrong way. The doc doesn't really tell what commands we could run with execute

@magnolia61
Copy link

Would love this feature!

@whittin3
Copy link

whittin3 commented Jan 8, 2024

@mendoncart I think that's just the JSON to build the docs. So it's just saying that the command deviceNotification has a required argument called notification and the type of it is a string

I was able to switch my tv on/off using the smartthing CLI. so I have a feeling that we're using execute in a wrong way. The doc doesn't really tell what commands we could run with execute

Did you find any luck since getting this to work. I will attempt to use the samsung smart things cli this weekend and will post back with results.

@giof94is
Copy link

giof94is commented Jul 8, 2024

@ollo69 @mendoncart @kamoteshake any news on that? It would be super...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests