Okay need a little help.
I installed Kodi Notification component to the letter following this guide
My conf is installed properly on a running 0.33.1 HASS
When invoking an automation which triggers action to notify Kodi nothing happens.
Ran config check and this is what I get
Component not found: kodi_notification
Why is it looking for a kodi_notification notify component instead of the kodi notify compoment?
ps: https://github.com/home-assistant/home-assistant.github.io/compare/current...dennisaion:patch-2
Okay I figured it out already. This kodi_notification: is supposed to be this kodi: in the configuration file.
Instruction needs updating. I posted a PR already for first mishap but second should be done based on this remark.
ih8gates
(Scott Reston)
November 21, 2016, 12:41pm
3
The example here looks correct. Where you see kodi_notification - thatâs defining a script.
I know. But nothing shows.
Config of kodi is correct. The script and calling notify.kodi directly without script is both working but not showing any notification on screen.
ih8gates
(Scott Reston)
November 21, 2016, 8:30pm
5
Iâm not clear what you mean by this. What do you mean by âworkingâ if you donât see a notification. Post some YAML so that we can see what youâre trying. Are you sure you have the port correct? Do you have Kodi set up as a media platform and is that working?
I see in the logs that it fired but the message is not ending up on screen on my Kodi device.
Config to my Kodi device is correct also.
notify:
- platform: kodi
host: 192.168.0.106
port: 80
username: kodi_user
password: kodi_password
automation:
- alias: 'Notify Kodi Test 1'
hide_entity: true
trigger:
platform: state
entity_id: device_tracker.kylo_ren
from: 'not_home'
action:
service: notify.kodi
- alias: 'Notify Kodi Test 2'
hide_entity: true
trigger:
platform: state
entity_id: device_tracker.kylo_ren
from: 'not_home'
action:
service: notify.kodi
script:
kodi:
alias: 'Notify Kodi Test 3'
sequence:
- service: notify.kodi
data:
title: "Home Assistant"
message: "Kylo Ren has entered the home!"
data:
displaytime: 20000
icon: "warning"
Manually entering following in a browser
http://192.168.0.106:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Sample%20Title","message":"Kylo%20Ren%20is%20standing%20outside.","image":"","displaytime":5000},"id":1 }
gives me following result
{"id":1,"jsonrpc":"2.0","result":"OK"}
so I think there is some more work to do?
ih8gates
(Scott Reston)
November 22, 2016, 1:12pm
7
When youâre typing this into a browser, are you getting a basic authentication challenge?
And using âkodi_userâ / âkodi_passwordâ (or the correct values) to clear it? In your browser, youâll only be challenged the first time.
And when you get the JSON success result, youâre seeing the notification in Kodi?
With and without username/password using this URL I see a nice notification on my Kodiâ's.
Changing IP I tested on Android and Raspberry units.
What I would like to know iâs if there is anyone who has actually gotten the Kodi notification component to work and if yes what there exact configuration looks like.
ih8gates
(Scott Reston)
November 22, 2016, 7:08pm
9
Yes. I use it and it works great for me.
I wonder if port 80 is your problem. You reference 8080 in your URL, but 80 in your config.
Hereâs what Iâve got:
notify:
- name: kodi
platform: kodi
host: http://192.168.1.110
port: 8111
username: xbmc
password: 1234
and then from within the action block of an automation:
- service: notify.kodi
data:
message: "Motion front porch"
title: "Front Porch"
80 or 8080 doesnât matter. Anyway I am using a template now with the URL. Works that way.
ih8gates
(Scott Reston)
November 22, 2016, 7:43pm
11
Also - I just noticed that you were calling the service in the code you posted without passing it any data. This by itself does nothing:
action:
service: notify.kodi
This should work:
action:
- service: notify.kodi
data:
message: "Motion front porch"
title: "Front Porch"
I left out the message cause it is obvious.
action:
service: notify.kodi
data:
message: "Kylo Ren has entered the home!"
title: "Front Door"
data:
displaytime: 20000
icon: "warning"
anyway it looks like this in the logs
16-11-22 20:56:18 homeassistant.components.automation: Executing Notify Kodi Test
16-11-22 20:56:18 homeassistant.core: Bus:Handling <Event logbook_entry[L]: domain=automation, name=Notify Kodi Test, entity_id=automation.notify_kodi_test, message=has been triggered>
16-11-22 20:56:18 homeassistant.helpers.script: Script Notify Kodi Test: Running script
16-11-22 20:56:18 homeassistant.helpers.script: Script Notify Kodi Test: Executing step call service
16-11-22 20:56:18 homeassistant.core: Bus:Handling <Event call_service[L]: domain=notify, service_data=message=Kylo Ren has entered the home!, data=displaytime=20000, icon=warning, title=Front Door, service_call_id=1977260816-14, service=kodi>
16-11-22 20:56:18 homeassistant.components.automation: Executing Kylo Ren State Change Alert
16-11-22 20:56:18 homeassistant.core: Bus:Handling <Event logbook_entry[L]: domain=automation, name=Kylo Ren State Change Alert, entity_id=automation.kylo_ren_state_change_alert, message=has been triggered>
16-11-22 20:56:18 homeassistant.helpers.script: Script Kylo Ren State Change Alert: Running script
16-11-22 20:56:18 homeassistant.helpers.script: Script Kylo Ren State Change Alert: Executing step call service
16-11-22 20:56:18 homeassistant.core: Bus:Handling <Event call_service[L]: domain=persistent_notification, service_data=notification_id=Kylo Ren, message=Kylo Ren is home since 20:56:18, service_call_id=1977260816-15, service=create>
16-11-22 20:56:18 homeassistant.core: Unable to find service notify/kodi
ih8gates
(Scott Reston)
November 22, 2016, 8:43pm
13
Ah. You missed the name parameter.
name: kodi
You could call it name: mediaserver and youâd have notify.mediaserver.
It might get a default name if you donât specify. Dunno. You can look in your states dev tool in HASSâ UI (icon that looks like < > in sidebar). Thatâll list all entity_idâs that are defined.
My friend. You are guessing now. The name parameter is optional.
I told you already that it is configured correctly and I posted log contents which show i triggers correctly.
Only thing is that message is not ending up on my kodi while if I post a straight URL entry in my browser it pops up nicely.
Meaning the travel from one PC to Kodi is not the issue.
The issue is between Kodi component and Kodi.
It can not be HA since it clearly has no problems operating my Kodi.
Problem is communication between Kodi component and Kodi.
What version Kodi do you have and what version json rpc?
Mine is 16.1 and 6
ih8gates
(Scott Reston)
November 23, 2016, 5:02pm
15
jsonrpc = 2.0
kodi = 15.2
So that suggests weâve both got the same API version.
Confirming: Youâve got a notify.kodi
in your states tab?
Molodax
(Alex)
November 23, 2016, 5:46pm
16
Hi,
I use Kodi notifications and they work perfectly.
And my configuration looks pretty much the same as yours, but I also have
name: Kodi
Omg I found the culprit. Moi overlooked following
host: 192.168.0.106
Should be
host: http://192.168.0.106
So it needed the http:// part to formulated the adres correctly for the JSON RPC call.
I think this is broken for me. I canât do http://myip as it only accepts ip now. But I always get this in the log even though my Kodi Media Player instance works fine.
17-03-29 22:26:20 WARNING (Thread-8) [homeassistant.components.notify.kodi] Unable to fetch Kodi data, Is Kodi online?
My notify config:
- name: kodi_notify
platform: kodi
host: 192.168.0.32
Iâm using the Services tab to do a call with data in JSON like this:
{ "title" : "test", "message" : "this is a test" }
looking at the jsonrpc output from kodi @ http://192.168.0.32:8080/jsonrpc both title and message are required:
"GUI.ShowNotification": {
"description": "Shows a GUI notification",
"params": [
{
"name": "title",
"required": true,
"type": "string"
},
{
"name": "message",
"required": true,
"type": "string"
},
{
"default": "",
"name": "image",
"type": [
{
"enums": [
"info",
"warning",
"error"
],
"type": "string"
},
{
"type": "string"
}
]
},
{
"default": 5000,
"description": "The time in milliseconds the notification will be visible",
"minimum": 1500,
"name": "displaytime",
"type": "integer"
}
],
"returns": {
"type": "string"
},
"type": "method"
},
ih8gates
(Scott Reston)
March 30, 2017, 3:12pm
19
If memory serves, 9090 is the default port. Have you tried setting the port in your config?
- name: kodi_notify
platform: kodi
host: http://192.168.0.32
port: 8080
username: xbmc
password: 1234
WarbleSync
(WarbleSync)
March 30, 2017, 10:00pm
20
I did. I did some more testing yesterday with jsonrpc-asyn (used in the component) and I think my config is valid. Also on the latest version of HA 0.40.2 (version Iâm on) there where some changes to the kodi notify component to make it async. I think the issue is kodi is expecting image as one of the data attributes but HA is passing icon instead.