What`s the correct command to restart openhab service ?
I was normally restarting RPI with sudo reboot
no need to reboot the entire rPi
you are in the Linux world now where uptime is important
sudo systemctl restart openhab2
Thanks. After changing port to 8080 and restarting service it looks like its connected this time according to log.
2018-12-07 19:22:06.510 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.513 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.520 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.523 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.526 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.573 [INFO ] [lgtv.lginteraction.LgTvMessageReader] - Started LgTv Servlet at /udap/api/event
2018-12-07 19:22:06.576 [ERROR] [binding.lgtv.internal.LgtvConnection] - sendtotv but connection status is CS_NOTCONNECTED
2018-12-07 19:22:06.593 [INFO ] [binding.lgtv.internal.LgtvConnection] - lgtv connectionstatus of ip=192.168.1.19 changed from CS_NOTCONNECTED to CS_PAIRED
2018-12-07 19:22:06.596 [INFO ] [binding.lgtv.internal.LgtvConnection] - sendpairkey with result=200 successconnectionstatus=CS_PAIRED
So now need to solve items and sitemap for this tv , still something isn`t right with my syntax here
sitemap
}
Frame label=“Tv” {
Switch item=LgTvConnStatus
Switch item=LgTvPower mappings=[ON=“Power Off”]
Setpoint item=LgTvChannel minValue=0 maxValue=300 step=1.0
Setpoint item=LgTvVolume minValue=0 maxValue=100 step=1.0
Switch item=LgTvMute mappings=[ON=“Mute”, OFF=“Mute”]
Text item=LgTvChannelName
Selection item=LgTvChannel mappings=[1=“ORF1”,2=“ORF2”]
Switch item=LgTvAppExecute label=“AppExecute” mappings=[Skype=Skype, Spotify=Spotify]
Switch item=LgTvAppTerminate label=“AppTerminate” mappings=[Skype=Skype, Spotify=Spotify]
}
}
items
/* LGTV */
Switch LgTvPower "Power Command" (GF_Living) {lgtv="ON:lg:POWER"}
Switch LgTvMute "Mute" (GF_Living) {lgtv="ON:lg:KEY_MUTE, OFF:lg:KEY_MUTE"}
Number LgTvVolume "lgVolume [%.1f]" (GF_Living) {lgtv="INIT:lg:VOLUME_CURRENT, INCREASE:lg:VOLUME_UP, DECREASE:lg:VOLUME_DOWN, *:lg:VOLUME_SET"}
Number LgTvChannel "Channel [%.1f]" (GF_Living) {lgtv="INIT:lg:CHANNEL_CURRENTNUMBER, INCREASE:lg:CHANNEL_UP, DECREASE:lg:CHANNEL_DOWN, *:lg:CHANNEL_SET" }
String LgTvChannelName "Channelname [%s]" (GF_Living) {lgtv="INIT:lg:CHANNEL_CURRENTNAME"}
String LgTvGetChannels "getchannels [%s]" (GF_Living) {lgtv="INIT:lg:GET_CHANNELS, ON:lg:GET_CHANNELS"}
String LgTvGetApps "getapps [%s]" (GF_Living) {lgtv="INIT:lg:GET_APPS, ON:lg:GET_APPS"}
String LgTvAppExecute "excuteapp" (GF_Living) {lgtv="*:lg:APP_EXECUTE"}
String LgTvAppTerminate "terminateapp" (GF_Living) {lgtv="*:lg:APP_TERMINATE"}
Switch LgTvConnStatus "connstatus " (GF_Living) {lgtv="*:lg:CONNECTION_STATUS"}
Not trying to butt in, just following the thread and learning, but:
FYI, It’s best to stop OH from running before rebooting.
Thanks H102. Is there a command to stop openhab2 before restarting RPI ?
guys @vzorglub @H102 we have found another documentation issue!
unbelievable… who would expect to find 2 inaccuracies in the same day against such perfect docs ! (joking of course )
port default is 8080 versus docs showing 60128
wait for more corrections… I think PR 5726 will be 2 pages long …
now we debug Andy’s sitemap and Items
Use the same command @Dim provided above.
sudo systemctl stop openhab2
And just something to keep in your back pocket, if you need to clean the cache and tmp files b/c of weird things showing up in the logs or as a first step in troubleshooting.
First, stop OH
sudo systemctl stop openhab2
then
sudo openhab-cli clean-cache
and start back up
sudo systemctl start openhab2
Great - thanks a lot, I made a note for future.
syntax of both sitemap (the partial entries that you posted) and Items file looks good to me…
what do you see in the logs now?
@Dim think setting the logs to DEBUG will help? Also the doc’s mention that turning the T.V. on is not possible, scrape that item?
For those who try to POWER ON - LgTV shuts down the network port so only power off is availiable
#
But that could be incorrect as well.
got it: wrong alias used lg
in the binding config:
Switch LgTvPower "Power Command" (GF_Living) {lgtv="ON:wohnzimmer:POWER"}
Switch LgTvMute "Mute" (GF_Living) {lgtv="ON:wohnzimmer:KEY_MUTE, OFF:wohnzimmer:KEY_MUTE"}
Number LgTvVolume "lgVolume [%.1f]" (GF_Living) {lgtv="INIT:wohnzimmer:VOLUME_CURRENT, INCREASE:wohnzimmer:VOLUME_UP, DECREASE:wohnzimmer:VOLUME_DOWN, *:wohnzimmer:VOLUME_SET"}
Number LgTvChannel "Channel [%.1f]" (GF_Living) {lgtv="INIT:wohnzimmer:CHANNEL_CURRENTNUMBER, INCREASE:wohnzimmer:CHANNEL_UP, DECREASE:wohnzimmer:CHANNEL_DOWN, *:wohnzimmer:CHANNEL_SET" }
String LgTvChannelName "Channelname [%s]" (GF_Living) {lgtv="INIT:wohnzimmer:CHANNEL_CURRENTNAME"}
String LgTvGetChannels "getchannels [%s]" (GF_Living) {lgtv="INIT:wohnzimmer:GET_CHANNELS, ON:wohnzimmer:GET_CHANNELS"}
String LgTvGetApps "getapps [%s]" (GF_Living) {lgtv="INIT:wohnzimmer:GET_APPS, ON:wohnzimmer:GET_APPS"}
String LgTvAppExecute "excuteapp" (GF_Living) {lgtv="*:wohnzimmer:APP_EXECUTE"}
String LgTvAppTerminate "terminateapp" (GF_Living) {lgtv="*:wohnzimmer:APP_TERMINATE"}
Switch LgTvConnStatus "connstatus " (GF_Living) {lgtv="*:wohnzimmer:CONNECTION_STATUS"}
(let’s hope that the docs are not wrong… even here
Ref: https://www.openhab.org/addons/bindings/lgtv1/#examples
The latest lines from openhab2 log , strangely the last entry was 20 minutes ago…
2018-12-07 19:22:06.510 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.513 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.520 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.523 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.526 [ERROR] [ab.binding.lgtv.internal.LgtvBinding] - cannot find device lg
2018-12-07 19:22:06.573 [INFO ] [lgtv.lginteraction.LgTvMessageReader] - Started LgTv Servlet at /udap/api/event
2018-12-07 19:22:06.576 [ERROR] [binding.lgtv.internal.LgtvConnection] - sendtotv but connection status is CS_NOTCONNECTED
2018-12-07 19:22:06.593 [INFO ] [binding.lgtv.internal.LgtvConnection] - lgtv connectionstatus of ip=192.168.1.19 changed from CS_NOTCONNECTED to CS_PAIRED
2018-12-07 19:22:06.596 [INFO ] [binding.lgtv.internal.LgtvConnection] - sendpairkey with result=200 successconnectionstatus=CS_PAIRED
2018-12-07 19:22:14.125 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.persistence.logging-1.8.3.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.persistence.logging [192]
Unresolved requirement: Import-Package: ch.qos.logback.classic
at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]
Need to add persistence to the item? Just guessing, as its not mention in the doc’s
fix your Items as in the example
change the alias from lg
Switch LgTvPower "Power Command" (GF_Living) {lgtv="ON:lg:POWER"}
to lgtv
in all Item binding configs:
Switch LgTvPower "Power Command" (GF_Living) {lgtv="ON:lgtv:POWER"}
this is something else I think (not related to the lgtv binding)…
Andy: why did you install this addon jar?
(/usr/share/openhab2/addons/org.openhab.persistence.logging-1.8.3.jar
)
Hi guys, I changed the items as per suggestion above and it looks Im getting some data but its displayed under my living room tab now , not where I was trying to display so there is possibly issue with grouping them.
Anyway this is what I`m seeing at the moment. Mute seems to work !!! So we are heading in right direction.
you need to customize your sitemap file to place these Items wherever you want
so: you are all good… Your LG TV is working with OH2
We got comms , I will amend sitemap post the results anyminute
wow… old style stuff! (6 years old actually)
Author: Kai
Source: openhab1-addons/bundles/persistence/org.openhab.persistence.logging/src/main/java/org/openhab/persistence/logging/internal/LoggingPersistenceService.java at main · openhab/openhab1-addons · GitHub
Persisting states of Items via log files… nice
@rlkoshak did you ever use this one on openHAB1?
@andy31 : Why would you deploy this jar in your addons folder?